Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.21.4 #15

Merged
merged 4 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Publish Release
on:
push:
branches: [ master, main ]

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
# build
- name: Build with Gradle Wrapper
run: ./gradlew assemble

- name: Get version
id: version
run: echo "version=$(./gradlew echoVersion)" >> $env:GITHUB_OUTPUT
- name: Get releaseName
id: releaseName
run: echo "releaseName=$(./gradlew echoReleaseName)" >> $env:GITHUB_OUTPUT

- name: Create Release
id: createRelease
uses: softprops/action-gh-release@v2
with:
files: build/libs/Underilla-Spigot-${{ steps.version.outputs.version }}.jar
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.releaseName.outputs.releaseName }}
body_path: CHANGELOG.md
prerelease: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ If you want to remove some of the game features, for example the `monster_room`
It can also be used to add feature to some biome. For example a quartz_ore feature if your nether is disabled you you still want your builder to have quartz.

## Build
Create a working jar with `./gradlew buildDependents`
Create a working jar with `./gradlew assemble`

## TODO
- Build-in pre-generation system.
Expand Down
32 changes: 27 additions & 5 deletions Underilla-Spigot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
plugins {
`java-library`
id("io.github.goooler.shadow") version "8.1.7"
id("io.papermc.paperweight.userdev") version "1.7.1" // paperweight // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev
// paperweight.userdev 2.0.0-beta.8 isn't working to have a Underilla-Spigot-1.6.9.jar which is the reobf jar.
id("io.papermc.paperweight.userdev") version "1.7.7" // paperweight // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev
`maven-publish` // Add ./gradlew publishToMavenLocal
id("xyz.jpenilla.run-paper") version "2.3.1"
}

group = "com.jkantrell.mc.underilla.spigot"
version = "1.6.6"
version = "1.6.10"
description="Generate vanilla cave in custom world."
val mainMinecraftVersion = "1.21.3"
val supportedMinecraftVersions = "[1.21.3 - 1.21.4]"

repositories {
mavenLocal()
Expand All @@ -22,9 +25,10 @@ repositories {

dependencies {
// compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT") // without paperweight
paperweight.paperDevBundle("1.21.1-R0.1-SNAPSHOT") // paperweight
paperweight.paperDevBundle("$mainMinecraftVersion-R0.1-SNAPSHOT")
implementation("com.jkantrell:Yamlizer:main-SNAPSHOT")
implementation(project(":Underilla-Core"))
implementation("fr.formiko.mc.biomeutils:biomeutils:1.1.8")
}

// tasks.build.dependsOn tasks.reobfJar // paperweight
Expand All @@ -44,6 +48,7 @@ tasks {
"co.aikar",
"org.bstats",
"jakarta.annotation",
"fr.formiko.mc.biomeutils",
).forEach { pkg ->
relocate(pkg, "$prefix.$pkg")
}
Expand Down Expand Up @@ -71,7 +76,11 @@ tasks {
// Configure the Minecraft version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
minecraftVersion("1.21.1")
minecraftVersion(mainMinecraftVersion)
// https://hangar.papermc.io/pop4959/Chunky
downloadPlugins {
hangar("Chunky", "1.4.28")
}
}
}

Expand All @@ -82,4 +91,17 @@ publishing {
}

// Break Yamlizer.
// paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
// paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION


tasks.register("echoVersion") {
doLast {
println("${project.version}")
}
}

tasks.register("echoReleaseName") {
doLast {
println("${project.version} ${supportedMinecraftVersions}")
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.jkantrell.mc.underilla.spigot;

import fr.formiko.mc.biomeutils.NMSBiomeUtils;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Map;
Expand All @@ -8,7 +9,6 @@
import com.jkantrell.mc.underilla.core.generation.Generator;
import com.jkantrell.mc.underilla.spigot.generation.UnderillaChunkGenerator;
import com.jkantrell.mc.underilla.spigot.impl.BukkitWorldReader;
import com.jkantrell.mc.underilla.spigot.impl.NMSBiomeUtils;
import com.jkantrell.mc.underilla.spigot.io.Config;
import com.jkantrell.mc.underilla.spigot.listener.StructureEventListener;
import jakarta.annotation.Nullable;
Expand Down Expand Up @@ -79,7 +79,7 @@ public void onEnable() {
@Override
public void onDisable() {
try {
if(Generator.times != null) {
if (Generator.times != null) {
long totalTime = Generator.times.entrySet().stream().mapToLong(Map.Entry::getValue).sum();
for (Map.Entry<String, Long> entry : Generator.times.entrySet()) {
this.getServer().getLogger()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraft.world.level.biome.BiomeSource;
import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.GenerationStep.Carving;
import net.minecraft.world.level.levelgen.Heightmap.Types;
import net.minecraft.world.level.levelgen.RandomState;
import net.minecraft.world.level.levelgen.blending.Blender;
Expand Down Expand Up @@ -42,8 +41,8 @@ protected MapCodec<? extends ChunkGenerator> codec() {

@Override
public void applyCarvers(WorldGenRegion chunkRegion, long seed, RandomState noiseConfig, BiomeManager biomeAccess,
StructureManager structureAccessor, ChunkAccess chunk, Carving carverStep) {
vanillaChunkGenerator.applyCarvers(chunkRegion, seed, noiseConfig, biomeAccess, structureAccessor, chunk, carverStep);
StructureManager structureAccessor, ChunkAccess chunk) {
vanillaChunkGenerator.applyCarvers(chunkRegion, seed, noiseConfig, biomeAccess, structureAccessor, chunk);
}

@Override
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.jkantrell.mc.underilla.spigot.impl;

import fr.formiko.mc.biomeutils.NMSBiomeUtils;
import com.jkantrell.mc.underilla.core.api.Biome;
import net.minecraft.core.Holder;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.jkantrell.mc.underilla.spigot.impl;

import fr.formiko.mc.biomeutils.NMSBiomeUtils;
import org.bukkit.block.data.BlockData;
import org.bukkit.generator.LimitedRegion;
import com.jkantrell.mc.underilla.core.api.Biome;
Expand All @@ -8,6 +9,7 @@
import com.jkantrell.mc.underilla.core.vector.VectorIterable;
import com.jkantrell.mc.underilla.spigot.Underilla;


public class BukkitRegionChunkData implements ChunkData {

// FIELDS
Expand Down Expand Up @@ -74,6 +76,6 @@ public void setBiome(int x, int y, int z, Biome biome) {
return;
}
// this.region_.setBiome(this.absX_ + x, y, this.absZ_ + z, bukkitBiome.getBiome());
BiomeHelper.setCustomBiome(bukkitBiome.getName(), this.absX_ + x, y, this.absZ_ + z);
NMSBiomeUtils.setCustomBiome(bukkitBiome.getName(), this.absX_ + x, y, this.absZ_ + z, this.region_.getWorld());
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.jkantrell.mc.underilla.spigot.impl;

import fr.formiko.mc.biomeutils.NMSBiomeUtils;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.jkantrell.mc.underilla.spigot.io;

import fr.formiko.mc.biomeutils.NMSBiomeUtils;
import java.util.Collections;
import java.util.List;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
import org.bukkit.generator.structure.Structure;
import com.jkantrell.mc.underilla.core.generation.GenerationConfig;
import com.jkantrell.mc.underilla.core.generation.MergeStrategy;
import com.jkantrell.mc.underilla.spigot.impl.NMSBiomeUtils;
import com.jkantrell.yamlizer.yaml.AbstractYamlConfig;
import com.jkantrell.yamlizer.yaml.ConfigField;
import com.jkantrell.yamlizer.yaml.YamlElementType;
Expand Down
Loading
Loading