From e831f85d4520253547cae0716a481348cdfc9b0e Mon Sep 17 00:00:00 2001 From: Astrash Date: Tue, 12 Jul 2022 09:47:29 +1000 Subject: [PATCH 001/126] Partial layered generator implementation --- .../chunk-generator-layered/build.gradle.kts | 12 +++ .../LayeredChunkGeneratorAddon.java | 85 ++++++++++++++++++ ...yeredChunkGeneratorPackConfigTemplate.java | 36 ++++++++ .../palette/BlockLayerPaletteTemplate.java | 20 +++++ .../BelowLayerPredicateTemplate.java | 20 +++++ .../RangeLayerPredicateTemplate.java | 20 +++++ .../SamplerLayerPredicateTemplate.java | 21 +++++ .../resolve/PaletteLayerResolverTemplate.java | 37 ++++++++ .../PredicateLayerResolverTemplate.java | 29 ++++++ .../generation/LayeredChunkGenerator.java | 88 +++++++++++++++++++ .../layer/palette/BlockLayerPalette.java | 27 ++++++ .../layer/palette/LayerPalette.java | 12 +++ .../layer/predicate/BelowLayerPredicate.java | 18 ++++ .../layer/predicate/LayerPredicate.java | 8 ++ .../layer/predicate/RangeLayerPredicate.java | 18 ++++ .../predicate/SamplerLayerPredicate.java | 20 +++++ .../layer/resolve/LayerResolver.java | 8 ++ .../layer/resolve/PaletteLayerResolver.java | 18 ++++ .../layer/resolve/PredicateLayerResolver.java | 26 ++++++ .../src/main/resources/terra.addon.yml | 12 +++ 20 files changed, 535 insertions(+) create mode 100644 common/addons/chunk-generator-layered/build.gradle.kts create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/LayeredChunkGeneratorPackConfigTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/BelowLayerPredicateTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/RangeLayerPredicateTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/LayerPalette.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/LayerPredicate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/LayerResolver.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PaletteLayerResolver.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PredicateLayerResolver.java create mode 100644 common/addons/chunk-generator-layered/src/main/resources/terra.addon.yml diff --git a/common/addons/chunk-generator-layered/build.gradle.kts b/common/addons/chunk-generator-layered/build.gradle.kts new file mode 100644 index 000000000..b26c61a77 --- /dev/null +++ b/common/addons/chunk-generator-layered/build.gradle.kts @@ -0,0 +1,12 @@ +version = version("0.1.0") + +dependencies { + compileOnlyApi(project(":common:addons:manifest-addon-loader")) + + implementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama) + testImplementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama) +} + +tasks.named("shadowJar") { + relocate("net.jafama", "com.dfsek.terra.addons.chunkgenerator.lib.jafama") +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java new file mode 100644 index 000000000..850bcffd3 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -0,0 +1,85 @@ +package com.dfsek.terra.addons.chunkgenerator; + +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.config.LayeredChunkGeneratorPackConfigTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.palette.BlockLayerPaletteTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.predicate.BelowLayerPredicateTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.predicate.RangeLayerPredicateTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.predicate.SamplerLayerPredicateTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.resolve.PaletteLayerResolverTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.resolve.PredicateLayerResolverTemplate; +import com.dfsek.terra.addons.chunkgenerator.generation.LayeredChunkGenerator; +import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.addons.manifest.api.AddonInitializer; +import com.dfsek.terra.api.Platform; +import com.dfsek.terra.api.addon.BaseAddon; +import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent; +import com.dfsek.terra.api.event.functional.FunctionalEventHandler; +import com.dfsek.terra.api.inject.annotations.Inject; + +import com.dfsek.terra.api.registry.CheckedRegistry; +import com.dfsek.terra.api.util.reflection.TypeKey; +import com.dfsek.terra.api.world.chunk.generation.util.provider.ChunkGeneratorProvider; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.function.Supplier; + + +public class LayeredChunkGeneratorAddon implements AddonInitializer { + + private static final Logger logger = LoggerFactory.getLogger(LayeredChunkGenerator.class); + + public static final TypeKey>> LAYER_PALETTE_TOKEN = new TypeKey<>() { + }; + + public static final TypeKey>> LAYER_RESOLVER_TOKEN = new TypeKey<>() { + }; + + public static final TypeKey>> LAYER_PREDICATE_TOKEN = new TypeKey<>() { + }; + + @Inject + private Platform platform; + + @Inject + private BaseAddon addon; + + @Override + public void initialize() { + + platform.getEventManager() + .getHandler(FunctionalEventHandler.class) + .register(addon, ConfigPackPreLoadEvent.class) + .priority(50) + .then(event -> { + CheckedRegistry>> paletteRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TOKEN); + paletteRegistry.register(addon.key("BLOCK"), BlockLayerPaletteTemplate::new); + }) + .then(event -> { + logger.info("Registering LayerResolvers.."); + LayeredChunkGeneratorPackConfigTemplate config = event.loadTemplate(new LayeredChunkGeneratorPackConfigTemplate()); + CheckedRegistry>> resolverRegistry = event.getPack().getOrCreateRegistry(LAYER_RESOLVER_TOKEN); + resolverRegistry.register(addon.key("PREDICATE"), PredicateLayerResolverTemplate::new); + resolverRegistry.register(addon.key("PALETTE"), () -> new PaletteLayerResolverTemplate(config.getPalettes())); + }) + .then(event -> { + CheckedRegistry>> predicateRegistry = event.getPack().getOrCreateRegistry(LAYER_PREDICATE_TOKEN); + predicateRegistry.register(addon.key("BELOW"), BelowLayerPredicateTemplate::new); + predicateRegistry.register(addon.key("RANGE"), RangeLayerPredicateTemplate::new); + predicateRegistry.register(addon.key("SAMPLER"), SamplerLayerPredicateTemplate::new); + }) + .then(event -> { + LayeredChunkGeneratorPackConfigTemplate config = event.loadTemplate(new LayeredChunkGeneratorPackConfigTemplate()); + event.getPack() + .getOrCreateRegistry(ChunkGeneratorProvider.class) + .register(addon.key("LAYERED"), + pack -> new LayeredChunkGenerator(platform, config.getResolver())); + }) + .failThrough(); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/LayeredChunkGeneratorPackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/LayeredChunkGeneratorPackConfigTemplate.java new file mode 100644 index 000000000..0363cd420 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/LayeredChunkGeneratorPackConfigTemplate.java @@ -0,0 +1,36 @@ +package com.dfsek.terra.addons.chunkgenerator.config; + +import com.dfsek.tectonic.api.config.template.ConfigTemplate; +import com.dfsek.tectonic.api.config.template.annotations.Default; +import com.dfsek.tectonic.api.config.template.annotations.Value; + +import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.api.config.meta.Meta; +import com.dfsek.terra.api.noise.NoiseSampler; + +import java.util.Map; + + +public class LayeredChunkGeneratorPackConfigTemplate implements ConfigTemplate { + @Value("generation.sampler") + private @Meta NoiseSampler sampler; + + @Value("generation.resolver") + private @Meta LayerResolver resolver; + + @Value("generation.palettes") + private @Meta Map palettes; + + public Map getPalettes() { + return palettes; + } + + public NoiseSampler getSampler() { + return sampler; + } + + public LayerResolver getResolver() { + return resolver; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java new file mode 100644 index 000000000..f3afff5ea --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java @@ -0,0 +1,20 @@ +package com.dfsek.terra.addons.chunkgenerator.config.palette; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.layer.palette.BlockLayerPalette; +import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.api.block.state.BlockState; + + +public class BlockLayerPaletteTemplate implements ObjectTemplate { + + @Value("block") + private BlockState block; + + @Override + public BlockLayerPalette get() { + return new BlockLayerPalette(block); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/BelowLayerPredicateTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/BelowLayerPredicateTemplate.java new file mode 100644 index 000000000..9b0c41917 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/BelowLayerPredicateTemplate.java @@ -0,0 +1,20 @@ +package com.dfsek.terra.addons.chunkgenerator.config.predicate; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.BelowLayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.api.config.meta.Meta; + + +public class BelowLayerPredicateTemplate implements ObjectTemplate { + + @Value("y") + private @Meta int y; + + @Override + public LayerPredicate get() { + return new BelowLayerPredicate(y); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/RangeLayerPredicateTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/RangeLayerPredicateTemplate.java new file mode 100644 index 000000000..309c5ba22 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/RangeLayerPredicateTemplate.java @@ -0,0 +1,20 @@ +package com.dfsek.terra.addons.chunkgenerator.config.predicate; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.RangeLayerPredicate; +import com.dfsek.terra.api.util.Range; + + +public class RangeLayerPredicateTemplate implements ObjectTemplate { + + @Value("range") + private Range range; + + @Override + public LayerPredicate get() { + return new RangeLayerPredicate(range); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java new file mode 100644 index 000000000..d47dd33ec --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java @@ -0,0 +1,21 @@ +package com.dfsek.terra.addons.chunkgenerator.config.predicate; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate; +import com.dfsek.terra.api.config.meta.Meta; +import com.dfsek.terra.api.noise.NoiseSampler; + + +public class SamplerLayerPredicateTemplate implements ObjectTemplate { + + @Value("sampler") + private @Meta NoiseSampler sampler; + + @Override + public LayerPredicate get() { + return new SamplerLayerPredicate(sampler); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java new file mode 100644 index 000000000..34955487d --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java @@ -0,0 +1,37 @@ +package com.dfsek.terra.addons.chunkgenerator.config.resolve; + +import com.dfsek.tectonic.api.config.template.ValidatedConfigTemplate; +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.tectonic.api.exception.ValidationException; + +import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.addons.chunkgenerator.layer.resolve.PaletteLayerResolver; + +import java.util.Map; + + +public class PaletteLayerResolverTemplate implements ObjectTemplate, ValidatedConfigTemplate { + + private final Map palettes; + + public PaletteLayerResolverTemplate(Map palettes) { + this.palettes = palettes; + } + + @Value("palette") + private String palette; + + @Override + public LayerResolver get() { + return new PaletteLayerResolver(palettes.get(palette)); + } + + @Override + public boolean validate() throws ValidationException { + if(!palettes.containsKey(palette)) throw new ValidationException("The palette " + palette + " does not exist!"); + return true; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java new file mode 100644 index 000000000..3e4da4d6e --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java @@ -0,0 +1,29 @@ +package com.dfsek.terra.addons.chunkgenerator.config.resolve; + +import com.dfsek.tectonic.api.config.template.annotations.Value; + +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.addons.chunkgenerator.layer.resolve.PredicateLayerResolver; +import com.dfsek.terra.api.config.meta.Meta; + + +public class PredicateLayerResolverTemplate implements ObjectTemplate { + + @Value("if") + private @Meta LayerPredicate predicate; + + @Value("then") + private @Meta LayerResolver trueResolver; + + @Value("else") + private @Meta LayerResolver falseResolver; + + + @Override + public PredicateLayerResolver get() { + return new PredicateLayerResolver(predicate, trueResolver, falseResolver); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java new file mode 100644 index 000000000..98b83a619 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java @@ -0,0 +1,88 @@ +package com.dfsek.terra.addons.chunkgenerator.generation; + +import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.api.Platform; +import com.dfsek.terra.api.block.state.BlockState; +import com.dfsek.terra.api.util.Column; +import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; +import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator; +import com.dfsek.terra.api.world.chunk.generation.ProtoChunk; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; +import com.dfsek.terra.api.world.info.WorldProperties; + +import org.jetbrains.annotations.NotNull; + + +public class LayeredChunkGenerator implements ChunkGenerator { + + private final Platform platform; + private final LayerResolver resolver; + + public LayeredChunkGenerator(Platform platform, LayerResolver resolver) { + this.platform = platform; + this.resolver = resolver; + } + + @Override + public void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldProperties world, @NotNull BiomeProvider biomeProvider, + int chunkX, int chunkZ) { + + platform.getProfiler().push("chunk_base_layered"); + + int xOrig = (chunkX << 4); + int zOrig = (chunkZ << 4); + long seed = world.getSeed(); + + for(int x = 0; x < 16; x++) { + for(int z = 0; z < 16; z++) { + + int cx = xOrig + x; + int cz = zOrig + z; + int paletteLevel = 0; + LayerPalette previousLayerPalette = null; + Column biomeColumn = biomeProvider.getColumn(cx, cz, world); + + for(int y = world.getMaxHeight() - 1; y >= world.getMinHeight(); y--) { + + Biome biome = biomeColumn.get(y); + + LayerPalette layerPalette = resolver.resolve(seed, biome, x, y, z); + + if (previousLayerPalette == layerPalette) { + paletteLevel++; + } else { + paletteLevel = 0; + } + previousLayerPalette = layerPalette; + + Palette palette = layerPalette.get(seed, biome, x, y, z); + + chunk.setBlock(cx, y, cz, palette.get(paletteLevel, x, y, z, seed)); + + } + } + } + + platform.getProfiler().pop("chunk_base_layered"); + } + + @Override + public BlockState getBlock(WorldProperties world, int x, int y, int z, BiomeProvider biomeProvider) { + long seed = world.getSeed(); + Biome biome = biomeProvider.getBiome(x, y, z, seed); + int layer = 0; // Default to layer 0 for now + return resolver.resolve(seed, biome, x, y, z) + .get(seed, biome, x, y, z) + .get(layer, x, y, z, seed); + } + + @Override + public Palette getPalette(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) { + long seed = world.getSeed(); + Biome biome = biomeProvider.getBiome(x, y, z, seed); + return resolver.resolve(seed, biome, x, y, z) + .get(seed, biome, x, y, z); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java new file mode 100644 index 000000000..28001ddf5 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java @@ -0,0 +1,27 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.palette; + +import com.dfsek.terra.api.block.state.BlockState; +import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; + + +public class BlockLayerPalette implements LayerPalette { + + private final Palette palette; + + public BlockLayerPalette(BlockState block) { + this.palette = new SingletonPalette(block); + } + + @Override + public Palette get(long seed, Biome biome, int x, int y, int z) { + return palette; + } + + private record SingletonPalette(BlockState blockState) implements Palette { + @Override + public BlockState get(int layer, double x, double y, double z, long seed) { + return blockState; + } + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/LayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/LayerPalette.java new file mode 100644 index 000000000..1b654e847 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/LayerPalette.java @@ -0,0 +1,12 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.palette; + +import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; +import com.dfsek.terra.api.world.info.WorldProperties; + + +public interface LayerPalette { + + Palette get(long seed, Biome biome, int x, int y, int z); + +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java new file mode 100644 index 000000000..8ccd3d200 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java @@ -0,0 +1,18 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.predicate; + +import com.dfsek.terra.api.world.biome.Biome; + + +public class BelowLayerPredicate implements LayerPredicate { + + private final int y; + + public BelowLayerPredicate(int y) { + this.y = y; + } + + @Override + public boolean test(long seed, Biome biome, int x, int y, int z) { + return y < this.y; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/LayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/LayerPredicate.java new file mode 100644 index 000000000..7e80604d0 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/LayerPredicate.java @@ -0,0 +1,8 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.predicate; + +import com.dfsek.terra.api.world.biome.Biome; + + +public interface LayerPredicate { + boolean test(long seed, Biome biome, int x, int y, int z); +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java new file mode 100644 index 000000000..36d8c7234 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java @@ -0,0 +1,18 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.predicate; + +import com.dfsek.terra.api.util.Range; +import com.dfsek.terra.api.world.biome.Biome; + + +public class RangeLayerPredicate implements LayerPredicate { + + private final Range range; + + public RangeLayerPredicate(Range range) { + this.range = range; + } + @Override + public boolean test(long seed, Biome biome, int x, int y, int z) { + return range.isInRange(y); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java new file mode 100644 index 000000000..04a770757 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java @@ -0,0 +1,20 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.predicate; + +import com.dfsek.terra.api.noise.NoiseSampler; +import com.dfsek.terra.api.world.biome.Biome; + + +public class SamplerLayerPredicate implements LayerPredicate { + + private final NoiseSampler sampler; + + public SamplerLayerPredicate(NoiseSampler sampler) { + this.sampler = sampler; + } + + + @Override + public boolean test(long seed, Biome biome, int x, int y, int z) { + return sampler.noise(seed, x, y, z) > 0; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/LayerResolver.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/LayerResolver.java new file mode 100644 index 000000000..ed7d1532e --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/LayerResolver.java @@ -0,0 +1,8 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.resolve; + +import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.api.world.biome.Biome; + +public interface LayerResolver { + LayerPalette resolve(long seed, Biome biome, int x, int y, int z); +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PaletteLayerResolver.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PaletteLayerResolver.java new file mode 100644 index 000000000..454c29139 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PaletteLayerResolver.java @@ -0,0 +1,18 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.resolve; + +import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.api.world.biome.Biome; + +public class PaletteLayerResolver implements LayerResolver { + + private final LayerPalette palette; + + public PaletteLayerResolver(LayerPalette palette) { + this.palette = palette; + } + + @Override + public LayerPalette resolve(long seed, Biome biome, int x, int y, int z) { + return palette; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PredicateLayerResolver.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PredicateLayerResolver.java new file mode 100644 index 000000000..fa56c42a7 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PredicateLayerResolver.java @@ -0,0 +1,26 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.resolve; + +import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.api.world.biome.Biome; + + +public class PredicateLayerResolver implements LayerResolver { + + private final LayerPredicate predicate; + + private final LayerResolver trueResolver; + + private final LayerResolver falseResolver; + + public PredicateLayerResolver(LayerPredicate predicate, LayerResolver trueResolver, LayerResolver falseResolver) { + this.predicate = predicate; + this.trueResolver = trueResolver; + this.falseResolver = falseResolver; + } + + @Override + public LayerPalette resolve(long seed, Biome biome, int x, int y, int z) { + return predicate.test(seed, biome, x, y, z) ? trueResolver.resolve(seed, biome, x, y, z) : falseResolver.resolve(seed, biome, x, y, z); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/resources/terra.addon.yml b/common/addons/chunk-generator-layered/src/main/resources/terra.addon.yml new file mode 100644 index 000000000..1b7a2d342 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/resources/terra.addon.yml @@ -0,0 +1,12 @@ +schema-version: 1 +contributors: + - Terra contributors +id: chunk-generator-layered +version: @VERSION@ +entrypoints: + - "com.dfsek.terra.addons.chunkgenerator.LayeredChunkGeneratorAddon" +website: + issues: https://github.com/PolyhedralDev/Terra/issues + source: https://github.com/PolyhedralDev/Terra + docs: https://terra.polydev.org +license: MIT License \ No newline at end of file From 2a9d94094cd62d6f07e31ee5af5dd5f8b9aab502 Mon Sep 17 00:00:00 2001 From: Astrash Date: Tue, 12 Jul 2022 13:15:27 +1000 Subject: [PATCH 002/126] Finish initial layered generator implementation --- .../LayeredChunkGeneratorAddon.java | 38 ++++++++++--------- ...yeredChunkGeneratorPackConfigTemplate.java | 36 ------------------ .../LayerPalettePackConfigTemplate.java | 21 ++++++++++ .../LayerPredicatePackConfigTemplate.java | 21 ++++++++++ .../LayerResolverPackConfigTemplate.java | 18 +++++++++ .../PredicateLayerResolverTemplate.java | 23 +++++++++-- .../generation/LayeredChunkGenerator.java | 10 ++--- .../layer/palette/LayerPalette.java | 2 - 8 files changed, 105 insertions(+), 64 deletions(-) delete mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/LayeredChunkGeneratorPackConfigTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/LayerPalettePackConfigTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/LayerPredicatePackConfigTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/LayerResolverPackConfigTemplate.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index 850bcffd3..4b03f5121 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -1,12 +1,18 @@ package com.dfsek.terra.addons.chunkgenerator; import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.function.Supplier; -import com.dfsek.terra.addons.chunkgenerator.config.LayeredChunkGeneratorPackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.palette.BlockLayerPaletteTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.palette.LayerPalettePackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.BelowLayerPredicateTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.predicate.LayerPredicatePackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.RangeLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.SamplerLayerPredicateTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.resolve.LayerResolverPackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.resolve.PaletteLayerResolverTemplate; import com.dfsek.terra.addons.chunkgenerator.config.resolve.PredicateLayerResolverTemplate; import com.dfsek.terra.addons.chunkgenerator.generation.LayeredChunkGenerator; @@ -19,16 +25,10 @@ import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent; import com.dfsek.terra.api.event.functional.FunctionalEventHandler; import com.dfsek.terra.api.inject.annotations.Inject; - import com.dfsek.terra.api.registry.CheckedRegistry; import com.dfsek.terra.api.util.reflection.TypeKey; import com.dfsek.terra.api.world.chunk.generation.util.provider.ChunkGeneratorProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.function.Supplier; - public class LayeredChunkGeneratorAddon implements AddonInitializer { @@ -51,34 +51,38 @@ public class LayeredChunkGeneratorAddon implements AddonInitializer { @Override public void initialize() { + + LayerPalettePackConfigTemplate paletteConfig = new LayerPalettePackConfigTemplate(); + LayerPredicatePackConfigTemplate predicateConfig = new LayerPredicatePackConfigTemplate(); + LayerResolverPackConfigTemplate resolverConfig = new LayerResolverPackConfigTemplate(); platform.getEventManager() .getHandler(FunctionalEventHandler.class) .register(addon, ConfigPackPreLoadEvent.class) - .priority(50) + .priority(1000) .then(event -> { CheckedRegistry>> paletteRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TOKEN); paletteRegistry.register(addon.key("BLOCK"), BlockLayerPaletteTemplate::new); - }) - .then(event -> { - logger.info("Registering LayerResolvers.."); - LayeredChunkGeneratorPackConfigTemplate config = event.loadTemplate(new LayeredChunkGeneratorPackConfigTemplate()); - CheckedRegistry>> resolverRegistry = event.getPack().getOrCreateRegistry(LAYER_RESOLVER_TOKEN); - resolverRegistry.register(addon.key("PREDICATE"), PredicateLayerResolverTemplate::new); - resolverRegistry.register(addon.key("PALETTE"), () -> new PaletteLayerResolverTemplate(config.getPalettes())); + event.loadTemplate(paletteConfig); }) .then(event -> { CheckedRegistry>> predicateRegistry = event.getPack().getOrCreateRegistry(LAYER_PREDICATE_TOKEN); predicateRegistry.register(addon.key("BELOW"), BelowLayerPredicateTemplate::new); predicateRegistry.register(addon.key("RANGE"), RangeLayerPredicateTemplate::new); predicateRegistry.register(addon.key("SAMPLER"), SamplerLayerPredicateTemplate::new); + event.loadTemplate(predicateConfig); + }) + .then(event -> { + CheckedRegistry>> resolverRegistry = event.getPack().getOrCreateRegistry(LAYER_RESOLVER_TOKEN); + resolverRegistry.register(addon.key("TEST_PREDICATE"), () -> new PredicateLayerResolverTemplate(predicateConfig.getPredicates())); + resolverRegistry.register(addon.key("USE_PALETTE"), () -> new PaletteLayerResolverTemplate(paletteConfig.getPalettes())); + event.loadTemplate(resolverConfig); }) .then(event -> { - LayeredChunkGeneratorPackConfigTemplate config = event.loadTemplate(new LayeredChunkGeneratorPackConfigTemplate()); event.getPack() .getOrCreateRegistry(ChunkGeneratorProvider.class) .register(addon.key("LAYERED"), - pack -> new LayeredChunkGenerator(platform, config.getResolver())); + pack -> new LayeredChunkGenerator(platform, resolverConfig.getResolver())); }) .failThrough(); } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/LayeredChunkGeneratorPackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/LayeredChunkGeneratorPackConfigTemplate.java deleted file mode 100644 index 0363cd420..000000000 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/LayeredChunkGeneratorPackConfigTemplate.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dfsek.terra.addons.chunkgenerator.config; - -import com.dfsek.tectonic.api.config.template.ConfigTemplate; -import com.dfsek.tectonic.api.config.template.annotations.Default; -import com.dfsek.tectonic.api.config.template.annotations.Value; - -import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; -import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; -import com.dfsek.terra.api.config.meta.Meta; -import com.dfsek.terra.api.noise.NoiseSampler; - -import java.util.Map; - - -public class LayeredChunkGeneratorPackConfigTemplate implements ConfigTemplate { - @Value("generation.sampler") - private @Meta NoiseSampler sampler; - - @Value("generation.resolver") - private @Meta LayerResolver resolver; - - @Value("generation.palettes") - private @Meta Map palettes; - - public Map getPalettes() { - return palettes; - } - - public NoiseSampler getSampler() { - return sampler; - } - - public LayerResolver getResolver() { - return resolver; - } -} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/LayerPalettePackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/LayerPalettePackConfigTemplate.java new file mode 100644 index 000000000..e68a0628d --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/LayerPalettePackConfigTemplate.java @@ -0,0 +1,21 @@ +package com.dfsek.terra.addons.chunkgenerator.config.palette; + +import com.dfsek.tectonic.api.config.template.ConfigTemplate; +import com.dfsek.tectonic.api.config.template.annotations.Value; + +import java.util.Map; + +import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.api.config.meta.Meta; + + +public class LayerPalettePackConfigTemplate implements ConfigTemplate { + + @Value("generation.palettes") + private @Meta Map palettes; + + public Map getPalettes() { + return palettes; + } + +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/LayerPredicatePackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/LayerPredicatePackConfigTemplate.java new file mode 100644 index 000000000..fbddab2c0 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/LayerPredicatePackConfigTemplate.java @@ -0,0 +1,21 @@ +package com.dfsek.terra.addons.chunkgenerator.config.predicate; + +import com.dfsek.tectonic.api.config.template.ConfigTemplate; +import com.dfsek.tectonic.api.config.template.annotations.Value; + +import java.util.Map; + +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.api.config.meta.Meta; + + +public class LayerPredicatePackConfigTemplate implements ConfigTemplate { + + @Value("generation.predicates") + private @Meta Map predicates; + + public Map getPredicates() { + return predicates; + } + +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/LayerResolverPackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/LayerResolverPackConfigTemplate.java new file mode 100644 index 000000000..8f848a27a --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/LayerResolverPackConfigTemplate.java @@ -0,0 +1,18 @@ +package com.dfsek.terra.addons.chunkgenerator.config.resolve; + +import com.dfsek.tectonic.api.config.template.ConfigTemplate; +import com.dfsek.tectonic.api.config.template.annotations.Value; + +import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.api.config.meta.Meta; + + +public class LayerResolverPackConfigTemplate implements ConfigTemplate { + + @Value("generation.resolver") + private @Meta LayerResolver resolver; + + public LayerResolver getResolver() { + return resolver; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java index 3e4da4d6e..03a9c3346 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java @@ -1,8 +1,11 @@ package com.dfsek.terra.addons.chunkgenerator.config.resolve; +import com.dfsek.tectonic.api.config.template.ValidatedConfigTemplate; import com.dfsek.tectonic.api.config.template.annotations.Value; - import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; +import com.dfsek.tectonic.api.exception.ValidationException; + +import java.util.Map; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; @@ -10,10 +13,16 @@ import com.dfsek.terra.api.config.meta.Meta; -public class PredicateLayerResolverTemplate implements ObjectTemplate { +public class PredicateLayerResolverTemplate implements ObjectTemplate, ValidatedConfigTemplate { + + private final Map predicates; + + public PredicateLayerResolverTemplate(Map predicates) { + this.predicates = predicates; + } @Value("if") - private @Meta LayerPredicate predicate; + private @Meta String predicate; @Value("then") private @Meta LayerResolver trueResolver; @@ -24,6 +33,12 @@ public class PredicateLayerResolverTemplate implements ObjectTemplate Date: Sat, 16 Jul 2022 16:28:57 +1000 Subject: [PATCH 003/126] Store palettes and predicates in registries --- .../LayeredChunkGeneratorAddon.java | 64 +++++++++++-------- .../{layer/palette => api}/LayerPalette.java | 2 +- .../predicate => api}/LayerPredicate.java | 2 +- .../{layer/resolve => api}/LayerResolver.java | 3 +- .../LayerPalettePackConfigTemplate.java | 4 +- .../LayerPredicatePackConfigTemplate.java | 9 ++- .../LayerResolverPackConfigTemplate.java | 4 +- .../palette/BlockLayerPaletteTemplate.java | 2 +- .../BelowLayerPredicateTemplate.java | 2 +- .../RangeLayerPredicateTemplate.java | 2 +- .../SamplerLayerPredicateTemplate.java | 2 +- .../resolve/PaletteLayerResolverTemplate.java | 28 ++------ .../PredicateLayerResolverTemplate.java | 28 ++------ .../generation/LayeredChunkGenerator.java | 4 +- .../layer/palette/BlockLayerPalette.java | 1 + .../layer/predicate/BelowLayerPredicate.java | 1 + .../layer/predicate/RangeLayerPredicate.java | 1 + .../predicate/SamplerLayerPredicate.java | 1 + .../layer/resolve/PaletteLayerResolver.java | 3 +- .../layer/resolve/PredicateLayerResolver.java | 5 +- .../chunkgenerator/util/InstanceWrapper.java | 12 ++++ 21 files changed, 88 insertions(+), 92 deletions(-) rename common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/{layer/palette => api}/LayerPalette.java (78%) rename common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/{layer/predicate => api}/LayerPredicate.java (70%) rename common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/{layer/resolve => api}/LayerResolver.java (53%) rename common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/{palette => pack}/LayerPalettePackConfigTemplate.java (77%) rename common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/{predicate => pack}/LayerPredicatePackConfigTemplate.java (56%) rename common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/{resolve => pack}/LayerResolverPackConfigTemplate.java (75%) create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/util/InstanceWrapper.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index 4b03f5121..3062d2027 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -7,18 +7,19 @@ import java.util.function.Supplier; import com.dfsek.terra.addons.chunkgenerator.config.palette.BlockLayerPaletteTemplate; -import com.dfsek.terra.addons.chunkgenerator.config.palette.LayerPalettePackConfigTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerPalettePackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.BelowLayerPredicateTemplate; -import com.dfsek.terra.addons.chunkgenerator.config.predicate.LayerPredicatePackConfigTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerPredicatePackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.RangeLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.SamplerLayerPredicateTemplate; -import com.dfsek.terra.addons.chunkgenerator.config.resolve.LayerResolverPackConfigTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerResolverPackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.resolve.PaletteLayerResolverTemplate; import com.dfsek.terra.addons.chunkgenerator.config.resolve.PredicateLayerResolverTemplate; import com.dfsek.terra.addons.chunkgenerator.generation.LayeredChunkGenerator; -import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; -import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerResolver; +import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.addons.manifest.api.AddonInitializer; import com.dfsek.terra.api.Platform; import com.dfsek.terra.api.addon.BaseAddon; @@ -34,13 +35,19 @@ public class LayeredChunkGeneratorAddon implements AddonInitializer { private static final Logger logger = LoggerFactory.getLogger(LayeredChunkGenerator.class); - public static final TypeKey>> LAYER_PALETTE_TOKEN = new TypeKey<>() { + public static final TypeKey>> LAYER_PALETTE_TYPE_TOKEN = new TypeKey<>() { }; - public static final TypeKey>> LAYER_RESOLVER_TOKEN = new TypeKey<>() { + public static final TypeKey> LAYER_PALETTE_TOKEN = new TypeKey<>() { }; - public static final TypeKey>> LAYER_PREDICATE_TOKEN = new TypeKey<>() { + public static final TypeKey>> LAYER_PREDICATE_TYPE_TOKEN = new TypeKey<>() { + }; + + public static final TypeKey> LAYER_PREDICATE_TOKEN = new TypeKey<>() { + }; + + public static final TypeKey>> LAYER_RESOLVER_TYPE_TOKEN = new TypeKey<>() { }; @Inject @@ -51,38 +58,39 @@ public class LayeredChunkGeneratorAddon implements AddonInitializer { @Override public void initialize() { - - LayerPalettePackConfigTemplate paletteConfig = new LayerPalettePackConfigTemplate(); - LayerPredicatePackConfigTemplate predicateConfig = new LayerPredicatePackConfigTemplate(); - LayerResolverPackConfigTemplate resolverConfig = new LayerResolverPackConfigTemplate(); platform.getEventManager() .getHandler(FunctionalEventHandler.class) .register(addon, ConfigPackPreLoadEvent.class) .priority(1000) .then(event -> { - CheckedRegistry>> paletteRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TOKEN); - paletteRegistry.register(addon.key("BLOCK"), BlockLayerPaletteTemplate::new); - event.loadTemplate(paletteConfig); - }) - .then(event -> { - CheckedRegistry>> predicateRegistry = event.getPack().getOrCreateRegistry(LAYER_PREDICATE_TOKEN); - predicateRegistry.register(addon.key("BELOW"), BelowLayerPredicateTemplate::new); - predicateRegistry.register(addon.key("RANGE"), RangeLayerPredicateTemplate::new); - predicateRegistry.register(addon.key("SAMPLER"), SamplerLayerPredicateTemplate::new); - event.loadTemplate(predicateConfig); + CheckedRegistry>> paletteTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TYPE_TOKEN); + paletteTypeRegistry.register(addon.key("BLOCK"), BlockLayerPaletteTemplate::new); + CheckedRegistry> paletteRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TOKEN); + event.loadTemplate(new LayerPalettePackConfigTemplate()).getPalettes().forEach((key, palette) -> { + paletteRegistry.register(addon.key(key), new InstanceWrapper<>(palette)); + }); }) .then(event -> { - CheckedRegistry>> resolverRegistry = event.getPack().getOrCreateRegistry(LAYER_RESOLVER_TOKEN); - resolverRegistry.register(addon.key("TEST_PREDICATE"), () -> new PredicateLayerResolverTemplate(predicateConfig.getPredicates())); - resolverRegistry.register(addon.key("USE_PALETTE"), () -> new PaletteLayerResolverTemplate(paletteConfig.getPalettes())); - event.loadTemplate(resolverConfig); + CheckedRegistry>> predicateTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_PREDICATE_TYPE_TOKEN); + predicateTypeRegistry.register(addon.key("BELOW"), BelowLayerPredicateTemplate::new); + predicateTypeRegistry.register(addon.key("RANGE"), RangeLayerPredicateTemplate::new); + predicateTypeRegistry.register(addon.key("SAMPLER"), SamplerLayerPredicateTemplate::new); + CheckedRegistry> predicateRegistry = event.getPack().getOrCreateRegistry(LAYER_PREDICATE_TOKEN); + event.loadTemplate(new LayerPredicatePackConfigTemplate()).getPredicates().forEach((key, predicate) -> { + predicateRegistry.register(addon.key(key), new InstanceWrapper<>(predicate)); + }); }) .then(event -> { + CheckedRegistry>> resolverTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_RESOLVER_TYPE_TOKEN); + resolverTypeRegistry.register(addon.key("TEST_PREDICATE"), PredicateLayerResolverTemplate::new); + resolverTypeRegistry.register(addon.key("USE_PALETTE"), PaletteLayerResolverTemplate::new); + LayerResolver resolver = event.loadTemplate(new LayerResolverPackConfigTemplate()).getResolver(); + event.getPack() .getOrCreateRegistry(ChunkGeneratorProvider.class) .register(addon.key("LAYERED"), - pack -> new LayeredChunkGenerator(platform, resolverConfig.getResolver())); + pack -> new LayeredChunkGenerator(platform, resolver)); }) .failThrough(); } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/LayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java similarity index 78% rename from common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/LayerPalette.java rename to common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java index c75b0491d..f5e632165 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/LayerPalette.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.addons.chunkgenerator.layer.palette; +package com.dfsek.terra.addons.chunkgenerator.api; import com.dfsek.terra.api.world.biome.Biome; import com.dfsek.terra.api.world.chunk.generation.util.Palette; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/LayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java similarity index 70% rename from common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/LayerPredicate.java rename to common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java index 7e80604d0..bed38a3b0 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/LayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.addons.chunkgenerator.layer.predicate; +package com.dfsek.terra.addons.chunkgenerator.api; import com.dfsek.terra.api.world.biome.Biome; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/LayerResolver.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerResolver.java similarity index 53% rename from common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/LayerResolver.java rename to common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerResolver.java index ed7d1532e..def10d8ec 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/LayerResolver.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerResolver.java @@ -1,6 +1,5 @@ -package com.dfsek.terra.addons.chunkgenerator.layer.resolve; +package com.dfsek.terra.addons.chunkgenerator.api; -import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; import com.dfsek.terra.api.world.biome.Biome; public interface LayerResolver { diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/LayerPalettePackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPalettePackConfigTemplate.java similarity index 77% rename from common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/LayerPalettePackConfigTemplate.java rename to common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPalettePackConfigTemplate.java index e68a0628d..1fed5f9e7 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/LayerPalettePackConfigTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPalettePackConfigTemplate.java @@ -1,11 +1,11 @@ -package com.dfsek.terra.addons.chunkgenerator.config.palette; +package com.dfsek.terra.addons.chunkgenerator.config.pack; import com.dfsek.tectonic.api.config.template.ConfigTemplate; import com.dfsek.tectonic.api.config.template.annotations.Value; import java.util.Map; -import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; import com.dfsek.terra.api.config.meta.Meta; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/LayerPredicatePackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPredicatePackConfigTemplate.java similarity index 56% rename from common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/LayerPredicatePackConfigTemplate.java rename to common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPredicatePackConfigTemplate.java index fbddab2c0..ca7d47254 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/LayerPredicatePackConfigTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPredicatePackConfigTemplate.java @@ -1,18 +1,21 @@ -package com.dfsek.terra.addons.chunkgenerator.config.predicate; +package com.dfsek.terra.addons.chunkgenerator.config.pack; import com.dfsek.tectonic.api.config.template.ConfigTemplate; +import com.dfsek.tectonic.api.config.template.annotations.Default; import com.dfsek.tectonic.api.config.template.annotations.Value; +import java.util.LinkedHashMap; import java.util.Map; -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.api.config.meta.Meta; public class LayerPredicatePackConfigTemplate implements ConfigTemplate { @Value("generation.predicates") - private @Meta Map predicates; + @Default + private @Meta Map predicates = new LinkedHashMap<>(); public Map getPredicates() { return predicates; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/LayerResolverPackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerResolverPackConfigTemplate.java similarity index 75% rename from common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/LayerResolverPackConfigTemplate.java rename to common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerResolverPackConfigTemplate.java index 8f848a27a..71e8363af 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/LayerResolverPackConfigTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerResolverPackConfigTemplate.java @@ -1,9 +1,9 @@ -package com.dfsek.terra.addons.chunkgenerator.config.resolve; +package com.dfsek.terra.addons.chunkgenerator.config.pack; import com.dfsek.tectonic.api.config.template.ConfigTemplate; import com.dfsek.tectonic.api.config.template.annotations.Value; -import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.addons.chunkgenerator.api.LayerResolver; import com.dfsek.terra.api.config.meta.Meta; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java index f3afff5ea..d3fbfacb2 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java @@ -4,7 +4,7 @@ import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; import com.dfsek.terra.addons.chunkgenerator.layer.palette.BlockLayerPalette; -import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; import com.dfsek.terra.api.block.state.BlockState; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/BelowLayerPredicateTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/BelowLayerPredicateTemplate.java index 9b0c41917..b6ec6d6c1 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/BelowLayerPredicateTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/BelowLayerPredicateTemplate.java @@ -4,7 +4,7 @@ import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.BelowLayerPredicate; -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.api.config.meta.Meta; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/RangeLayerPredicateTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/RangeLayerPredicateTemplate.java index 309c5ba22..fec9f8a77 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/RangeLayerPredicateTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/RangeLayerPredicateTemplate.java @@ -3,7 +3,7 @@ import com.dfsek.tectonic.api.config.template.annotations.Value; import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.RangeLayerPredicate; import com.dfsek.terra.api.util.Range; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java index d47dd33ec..b784320a4 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java @@ -3,7 +3,7 @@ import com.dfsek.tectonic.api.config.template.annotations.Value; import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate; import com.dfsek.terra.api.config.meta.Meta; import com.dfsek.terra.api.noise.NoiseSampler; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java index 34955487d..53d7669d3 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java @@ -1,37 +1,21 @@ package com.dfsek.terra.addons.chunkgenerator.config.resolve; -import com.dfsek.tectonic.api.config.template.ValidatedConfigTemplate; import com.dfsek.tectonic.api.config.template.annotations.Value; import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; -import com.dfsek.tectonic.api.exception.ValidationException; - -import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; -import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerResolver; import com.dfsek.terra.addons.chunkgenerator.layer.resolve.PaletteLayerResolver; - -import java.util.Map; +import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; -public class PaletteLayerResolverTemplate implements ObjectTemplate, ValidatedConfigTemplate { - - private final Map palettes; - - public PaletteLayerResolverTemplate(Map palettes) { - this.palettes = palettes; - } +public class PaletteLayerResolverTemplate implements ObjectTemplate { @Value("palette") - private String palette; + private InstanceWrapper palette; @Override public LayerResolver get() { - return new PaletteLayerResolver(palettes.get(palette)); - } - - @Override - public boolean validate() throws ValidationException { - if(!palettes.containsKey(palette)) throw new ValidationException("The palette " + palette + " does not exist!"); - return true; + return new PaletteLayerResolver(palette.get()); } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java index 03a9c3346..b143a9c83 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PredicateLayerResolverTemplate.java @@ -1,28 +1,19 @@ package com.dfsek.terra.addons.chunkgenerator.config.resolve; -import com.dfsek.tectonic.api.config.template.ValidatedConfigTemplate; import com.dfsek.tectonic.api.config.template.annotations.Value; import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; -import com.dfsek.tectonic.api.exception.ValidationException; -import java.util.Map; - -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; -import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerResolver; import com.dfsek.terra.addons.chunkgenerator.layer.resolve.PredicateLayerResolver; +import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.api.config.meta.Meta; -public class PredicateLayerResolverTemplate implements ObjectTemplate, ValidatedConfigTemplate { - - private final Map predicates; - - public PredicateLayerResolverTemplate(Map predicates) { - this.predicates = predicates; - } +public class PredicateLayerResolverTemplate implements ObjectTemplate { @Value("if") - private @Meta String predicate; + private @Meta InstanceWrapper predicate; @Value("then") private @Meta LayerResolver trueResolver; @@ -30,15 +21,8 @@ public PredicateLayerResolverTemplate(Map predicates) { @Value("else") private @Meta LayerResolver falseResolver; - @Override public PredicateLayerResolver get() { - return new PredicateLayerResolver(predicates.get(predicate), trueResolver, falseResolver); - } - - @Override - public boolean validate() throws ValidationException { - if (!predicates.containsKey(predicate)) throw new ValidationException("The predicate " + predicate + " does not exist!"); - return true; + return new PredicateLayerResolver(predicate.get(), trueResolver, falseResolver); } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java index cb8866f2b..5104f0ca6 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java @@ -2,8 +2,8 @@ import org.jetbrains.annotations.NotNull; -import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; -import com.dfsek.terra.addons.chunkgenerator.layer.resolve.LayerResolver; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerResolver; import com.dfsek.terra.api.Platform; import com.dfsek.terra.api.block.state.BlockState; import com.dfsek.terra.api.util.Column; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java index 28001ddf5..4054609e8 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java @@ -1,5 +1,6 @@ package com.dfsek.terra.addons.chunkgenerator.layer.palette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; import com.dfsek.terra.api.block.state.BlockState; import com.dfsek.terra.api.world.biome.Biome; import com.dfsek.terra.api.world.chunk.generation.util.Palette; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java index 8ccd3d200..1ffb51939 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java @@ -1,5 +1,6 @@ package com.dfsek.terra.addons.chunkgenerator.layer.predicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.api.world.biome.Biome; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java index 36d8c7234..9e0ab8ba0 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java @@ -1,5 +1,6 @@ package com.dfsek.terra.addons.chunkgenerator.layer.predicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.api.util.Range; import com.dfsek.terra.api.world.biome.Biome; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java index 04a770757..fef96a675 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java @@ -1,5 +1,6 @@ package com.dfsek.terra.addons.chunkgenerator.layer.predicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.api.noise.NoiseSampler; import com.dfsek.terra.api.world.biome.Biome; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PaletteLayerResolver.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PaletteLayerResolver.java index 454c29139..e0780c921 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PaletteLayerResolver.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PaletteLayerResolver.java @@ -1,6 +1,7 @@ package com.dfsek.terra.addons.chunkgenerator.layer.resolve; -import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerResolver; import com.dfsek.terra.api.world.biome.Biome; public class PaletteLayerResolver implements LayerResolver { diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PredicateLayerResolver.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PredicateLayerResolver.java index fa56c42a7..b23e84652 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PredicateLayerResolver.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/resolve/PredicateLayerResolver.java @@ -1,7 +1,8 @@ package com.dfsek.terra.addons.chunkgenerator.layer.resolve; -import com.dfsek.terra.addons.chunkgenerator.layer.palette.LayerPalette; -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerResolver; import com.dfsek.terra.api.world.biome.Biome; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/util/InstanceWrapper.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/util/InstanceWrapper.java new file mode 100644 index 000000000..ebb1e6ad7 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/util/InstanceWrapper.java @@ -0,0 +1,12 @@ +package com.dfsek.terra.addons.chunkgenerator.util; + +import java.util.function.Supplier; + + +public record InstanceWrapper(T instance) implements Supplier { + + @Override + public T get() { + return instance; + } +} From 809a6422a15ddb6a4ac748cd914f311f6a9ec752 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 16 Jul 2022 16:36:45 +1000 Subject: [PATCH 004/126] Rename some keys --- .../addons/chunkgenerator/LayeredChunkGeneratorAddon.java | 4 ++-- .../config/pack/LayerPalettePackConfigTemplate.java | 2 +- .../config/resolve/PaletteLayerResolverTemplate.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index 3062d2027..eb284732c 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -83,8 +83,8 @@ public void initialize() { }) .then(event -> { CheckedRegistry>> resolverTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_RESOLVER_TYPE_TOKEN); - resolverTypeRegistry.register(addon.key("TEST_PREDICATE"), PredicateLayerResolverTemplate::new); - resolverTypeRegistry.register(addon.key("USE_PALETTE"), PaletteLayerResolverTemplate::new); + resolverTypeRegistry.register(addon.key("TEST"), PredicateLayerResolverTemplate::new); + resolverTypeRegistry.register(addon.key("LAYER"), PaletteLayerResolverTemplate::new); LayerResolver resolver = event.loadTemplate(new LayerResolverPackConfigTemplate()).getResolver(); event.getPack() diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPalettePackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPalettePackConfigTemplate.java index 1fed5f9e7..8485ec836 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPalettePackConfigTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPalettePackConfigTemplate.java @@ -11,7 +11,7 @@ public class LayerPalettePackConfigTemplate implements ConfigTemplate { - @Value("generation.palettes") + @Value("generation.layers") private @Meta Map palettes; public Map getPalettes() { diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java index 53d7669d3..de1474dbf 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/resolve/PaletteLayerResolverTemplate.java @@ -11,7 +11,7 @@ public class PaletteLayerResolverTemplate implements ObjectTemplate { - @Value("palette") + @Value("layer") private InstanceWrapper palette; @Override From 698725c921fec844c7ac31137e8bc652d91d3749 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 16 Jul 2022 17:03:28 +1000 Subject: [PATCH 005/126] Implement layer samplers --- .../LayeredChunkGeneratorAddon.java | 29 +++++++++++++++---- .../chunkgenerator/api/LayerSampler.java | 11 +++++++ .../pack/LayerSamplerPackConfigTemplate.java | 21 ++++++++++++++ .../SamplerLayerPredicateTemplate.java | 12 ++++++-- .../sampler/SimpleLayerSamplerTemplate.java | 21 ++++++++++++++ .../predicate/SamplerLayerPredicate.java | 12 ++++---- .../layer/sampler/SimpleLayerSampler.java | 25 ++++++++++++++++ 7 files changed, 117 insertions(+), 14 deletions(-) create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerSampler.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerSamplerPackConfigTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/sampler/SimpleLayerSamplerTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/sampler/SimpleLayerSampler.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index eb284732c..e766993b8 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -6,19 +6,22 @@ import java.util.function.Supplier; -import com.dfsek.terra.addons.chunkgenerator.config.palette.BlockLayerPaletteTemplate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerResolver; +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerPalettePackConfigTemplate; -import com.dfsek.terra.addons.chunkgenerator.config.predicate.BelowLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerPredicatePackConfigTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerResolverPackConfigTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerSamplerPackConfigTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.palette.BlockLayerPaletteTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.predicate.BelowLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.RangeLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.SamplerLayerPredicateTemplate; -import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerResolverPackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.resolve.PaletteLayerResolverTemplate; import com.dfsek.terra.addons.chunkgenerator.config.resolve.PredicateLayerResolverTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.sampler.SimpleLayerSamplerTemplate; import com.dfsek.terra.addons.chunkgenerator.generation.LayeredChunkGenerator; -import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; -import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; -import com.dfsek.terra.addons.chunkgenerator.api.LayerResolver; import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.addons.manifest.api.AddonInitializer; import com.dfsek.terra.api.Platform; @@ -35,6 +38,12 @@ public class LayeredChunkGeneratorAddon implements AddonInitializer { private static final Logger logger = LoggerFactory.getLogger(LayeredChunkGenerator.class); + public static final TypeKey>> LAYER_SAMPLER_TYPE_TOKEN = new TypeKey<>() { + }; + + public static final TypeKey> LAYER_SAMPLER_TOKEN = new TypeKey<>() { + }; + public static final TypeKey>> LAYER_PALETTE_TYPE_TOKEN = new TypeKey<>() { }; @@ -63,6 +72,14 @@ public void initialize() { .getHandler(FunctionalEventHandler.class) .register(addon, ConfigPackPreLoadEvent.class) .priority(1000) + .then(event -> { + CheckedRegistry>> samplerTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_SAMPLER_TYPE_TOKEN); + CheckedRegistry> samplerRegistry = event.getPack().getOrCreateRegistry(LAYER_SAMPLER_TOKEN); + samplerTypeRegistry.register(addon.key("SIMPLE"), SimpleLayerSamplerTemplate::new); + event.loadTemplate(new LayerSamplerPackConfigTemplate()).getSamplers().forEach((key, sampler) -> { + samplerRegistry.register(addon.key(key), new InstanceWrapper<>(sampler)); + }); + }) .then(event -> { CheckedRegistry>> paletteTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TYPE_TOKEN); paletteTypeRegistry.register(addon.key("BLOCK"), BlockLayerPaletteTemplate::new); diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerSampler.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerSampler.java new file mode 100644 index 000000000..d328b3b5c --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerSampler.java @@ -0,0 +1,11 @@ +package com.dfsek.terra.addons.chunkgenerator.api; + +import com.dfsek.terra.api.noise.NoiseSampler; +import com.dfsek.terra.api.world.biome.Biome; + + +public interface LayerSampler { + double sample(long seed, Biome biome, int x, int y, int z); + + NoiseSampler getSampler(); +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerSamplerPackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerSamplerPackConfigTemplate.java new file mode 100644 index 000000000..e81131400 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerSamplerPackConfigTemplate.java @@ -0,0 +1,21 @@ +package com.dfsek.terra.addons.chunkgenerator.config.pack; + +import com.dfsek.tectonic.api.config.template.ConfigTemplate; +import com.dfsek.tectonic.api.config.template.annotations.Value; + +import java.util.Map; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; +import com.dfsek.terra.api.config.meta.Meta; + + +public class LayerSamplerPackConfigTemplate implements ConfigTemplate { + + @Value("generation.samplers") + private @Meta Map samplers; + + public Map getSamplers() { + return samplers; + } + +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java index b784320a4..93265156d 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java @@ -1,21 +1,27 @@ package com.dfsek.terra.addons.chunkgenerator.config.predicate; +import com.dfsek.tectonic.api.config.template.annotations.Default; import com.dfsek.tectonic.api.config.template.annotations.Value; import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.api.config.meta.Meta; -import com.dfsek.terra.api.noise.NoiseSampler; public class SamplerLayerPredicateTemplate implements ObjectTemplate { @Value("sampler") - private @Meta NoiseSampler sampler; + private @Meta InstanceWrapper sampler; + + @Value("threshold") + @Default + private double threshold = 0; @Override public LayerPredicate get() { - return new SamplerLayerPredicate(sampler); + return new SamplerLayerPredicate(sampler.get(), threshold); } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/sampler/SimpleLayerSamplerTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/sampler/SimpleLayerSamplerTemplate.java new file mode 100644 index 000000000..46bd115d6 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/sampler/SimpleLayerSamplerTemplate.java @@ -0,0 +1,21 @@ +package com.dfsek.terra.addons.chunkgenerator.config.sampler; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; +import com.dfsek.terra.addons.chunkgenerator.layer.sampler.SimpleLayerSampler; +import com.dfsek.terra.api.config.meta.Meta; +import com.dfsek.terra.api.noise.NoiseSampler; + + +public class SimpleLayerSamplerTemplate implements ObjectTemplate { + + @Value("sampler") + private @Meta NoiseSampler sampler; + + @Override + public LayerSampler get() { + return new SimpleLayerSampler(sampler); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java index fef96a675..632205420 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java @@ -1,21 +1,23 @@ package com.dfsek.terra.addons.chunkgenerator.layer.predicate; import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; -import com.dfsek.terra.api.noise.NoiseSampler; +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; import com.dfsek.terra.api.world.biome.Biome; public class SamplerLayerPredicate implements LayerPredicate { - private final NoiseSampler sampler; + private final LayerSampler sampler; - public SamplerLayerPredicate(NoiseSampler sampler) { + private final double threshold; + + public SamplerLayerPredicate(LayerSampler sampler, double threshold) { this.sampler = sampler; + this.threshold = threshold; } - @Override public boolean test(long seed, Biome biome, int x, int y, int z) { - return sampler.noise(seed, x, y, z) > 0; + return sampler.sample(seed, biome, x, y, z) > threshold; } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/sampler/SimpleLayerSampler.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/sampler/SimpleLayerSampler.java new file mode 100644 index 000000000..71dbb96c5 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/sampler/SimpleLayerSampler.java @@ -0,0 +1,25 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.sampler; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; +import com.dfsek.terra.api.noise.NoiseSampler; +import com.dfsek.terra.api.world.biome.Biome; + + +public class SimpleLayerSampler implements LayerSampler { + + private NoiseSampler sampler; + + public SimpleLayerSampler(NoiseSampler sampler) { + this.sampler = sampler; + } + + @Override + public double sample(long seed, Biome biome, int x, int y, int z) { + return sampler.noise(seed, x, y, z); + } + + @Override + public NoiseSampler getSampler() { + return sampler; + } +} From b57b71baa76f1e4628e7423e953c04547af5e21e Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 16 Jul 2022 17:17:18 +1000 Subject: [PATCH 006/126] Replace BLOCK layer palette with PALETTE --- .../LayeredChunkGeneratorAddon.java | 4 +-- .../palette/BlockLayerPaletteTemplate.java | 20 ------------- .../palette/SimpleLayerPaletteTemplate.java | 20 +++++++++++++ .../layer/palette/BlockLayerPalette.java | 28 ------------------- .../layer/palette/SimpleLayerPalette.java | 20 +++++++++++++ 5 files changed, 42 insertions(+), 50 deletions(-) delete mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/SimpleLayerPaletteTemplate.java delete mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index e766993b8..72b865811 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -14,7 +14,7 @@ import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerPredicatePackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerResolverPackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerSamplerPackConfigTemplate; -import com.dfsek.terra.addons.chunkgenerator.config.palette.BlockLayerPaletteTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.palette.SimpleLayerPaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.BelowLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.RangeLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.SamplerLayerPredicateTemplate; @@ -82,7 +82,7 @@ public void initialize() { }) .then(event -> { CheckedRegistry>> paletteTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TYPE_TOKEN); - paletteTypeRegistry.register(addon.key("BLOCK"), BlockLayerPaletteTemplate::new); + paletteTypeRegistry.register(addon.key("PALETTE"), SimpleLayerPaletteTemplate::new); CheckedRegistry> paletteRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TOKEN); event.loadTemplate(new LayerPalettePackConfigTemplate()).getPalettes().forEach((key, palette) -> { paletteRegistry.register(addon.key(key), new InstanceWrapper<>(palette)); diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java deleted file mode 100644 index d3fbfacb2..000000000 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BlockLayerPaletteTemplate.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.dfsek.terra.addons.chunkgenerator.config.palette; - -import com.dfsek.tectonic.api.config.template.annotations.Value; -import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; - -import com.dfsek.terra.addons.chunkgenerator.layer.palette.BlockLayerPalette; -import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; -import com.dfsek.terra.api.block.state.BlockState; - - -public class BlockLayerPaletteTemplate implements ObjectTemplate { - - @Value("block") - private BlockState block; - - @Override - public BlockLayerPalette get() { - return new BlockLayerPalette(block); - } -} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/SimpleLayerPaletteTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/SimpleLayerPaletteTemplate.java new file mode 100644 index 000000000..2ee6a2a2f --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/SimpleLayerPaletteTemplate.java @@ -0,0 +1,20 @@ +package com.dfsek.terra.addons.chunkgenerator.config.palette; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.layer.palette.SimpleLayerPalette; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; + + +public class SimpleLayerPaletteTemplate implements ObjectTemplate { + + @Value("palette") + private Palette palette; + + @Override + public LayerPalette get() { + return new SimpleLayerPalette(palette); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java deleted file mode 100644 index 4054609e8..000000000 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BlockLayerPalette.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.dfsek.terra.addons.chunkgenerator.layer.palette; - -import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; -import com.dfsek.terra.api.block.state.BlockState; -import com.dfsek.terra.api.world.biome.Biome; -import com.dfsek.terra.api.world.chunk.generation.util.Palette; - - -public class BlockLayerPalette implements LayerPalette { - - private final Palette palette; - - public BlockLayerPalette(BlockState block) { - this.palette = new SingletonPalette(block); - } - - @Override - public Palette get(long seed, Biome biome, int x, int y, int z) { - return palette; - } - - private record SingletonPalette(BlockState blockState) implements Palette { - @Override - public BlockState get(int layer, double x, double y, double z, long seed) { - return blockState; - } - } -} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java new file mode 100644 index 000000000..4bfbe2133 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java @@ -0,0 +1,20 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.palette; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; + + +public class SimpleLayerPalette implements LayerPalette { + + private final Palette palette; + + public SimpleLayerPalette(Palette palette) { + this.palette = palette; + } + + @Override + public Palette get(long seed, Biome biome, int x, int y, int z) { + return palette; + } +} From edcba9707d5a5a63882c1fd9e20cda6f13db69ee Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 16 Jul 2022 18:56:30 +1000 Subject: [PATCH 007/126] Implement biome defined layer palettes --- .../LayeredChunkGeneratorAddon.java | 10 +++ .../BiomeDefinedLayerPaletteTemplate.java | 22 ++++++ .../palette/BiomeDefinedLayerPalette.java | 67 +++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomeDefinedLayerPaletteTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index 72b865811..884466636 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -14,6 +14,7 @@ import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerPredicatePackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerResolverPackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerSamplerPackConfigTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.palette.BiomeDefinedLayerPaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.palette.SimpleLayerPaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.BelowLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.RangeLayerPredicateTemplate; @@ -22,10 +23,12 @@ import com.dfsek.terra.addons.chunkgenerator.config.resolve.PredicateLayerResolverTemplate; import com.dfsek.terra.addons.chunkgenerator.config.sampler.SimpleLayerSamplerTemplate; import com.dfsek.terra.addons.chunkgenerator.generation.LayeredChunkGenerator; +import com.dfsek.terra.addons.chunkgenerator.layer.palette.BiomeDefinedLayerPalette; import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.addons.manifest.api.AddonInitializer; import com.dfsek.terra.api.Platform; import com.dfsek.terra.api.addon.BaseAddon; +import com.dfsek.terra.api.event.events.config.ConfigurationLoadEvent; import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent; import com.dfsek.terra.api.event.functional.FunctionalEventHandler; import com.dfsek.terra.api.inject.annotations.Inject; @@ -83,6 +86,7 @@ public void initialize() { .then(event -> { CheckedRegistry>> paletteTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TYPE_TOKEN); paletteTypeRegistry.register(addon.key("PALETTE"), SimpleLayerPaletteTemplate::new); + paletteTypeRegistry.register(addon.key("BIOME_DEFINED"), BiomeDefinedLayerPaletteTemplate::new); CheckedRegistry> paletteRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TOKEN); event.loadTemplate(new LayerPalettePackConfigTemplate()).getPalettes().forEach((key, palette) -> { paletteRegistry.register(addon.key(key), new InstanceWrapper<>(palette)); @@ -110,5 +114,11 @@ public void initialize() { pack -> new LayeredChunkGenerator(platform, resolver)); }) .failThrough(); + + platform.getEventManager() + .getHandler(FunctionalEventHandler.class) + .register(addon, ConfigurationLoadEvent.class) + .priority(1000) + .then(BiomeDefinedLayerPalette.injectLayerPalettes); } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomeDefinedLayerPaletteTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomeDefinedLayerPaletteTemplate.java new file mode 100644 index 000000000..133e491b5 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomeDefinedLayerPaletteTemplate.java @@ -0,0 +1,22 @@ +package com.dfsek.terra.addons.chunkgenerator.config.palette; + +import com.dfsek.tectonic.api.config.template.annotations.Default; +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.layer.palette.BiomeDefinedLayerPalette; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; + + +public class BiomeDefinedLayerPaletteTemplate implements ObjectTemplate { + + @Value("default") + @Default + private Palette defaultPalette = null; + + @Override + public LayerPalette get() { + return new BiomeDefinedLayerPalette(defaultPalette); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java new file mode 100644 index 000000000..94489dece --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java @@ -0,0 +1,67 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.palette; + +import com.dfsek.tectonic.api.config.template.dynamic.DynamicTemplate; +import com.dfsek.tectonic.api.config.template.dynamic.DynamicValue; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import com.dfsek.terra.addons.chunkgenerator.LayeredChunkGeneratorAddon; +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.api.event.events.config.ConfigurationLoadEvent; +import com.dfsek.terra.api.properties.Properties; +import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; + + +public class BiomeDefinedLayerPalette implements LayerPalette { + + private final Palette defaultPalette; + + public BiomeDefinedLayerPalette(Palette defaultPalette) { + this.defaultPalette = defaultPalette; + } + + @Override + public Palette get(long seed, Biome biome, int x, int y, int z) { + return biome.getContext().get(BiomeLayerPalettes.class).palettes().get(this); + } + + public Optional getDefaultPalette() { + return Optional.ofNullable(defaultPalette); + } + + public static Consumer injectLayerPalettes = event -> { + if(event.is(Biome.class)) { + + Map paletteFields = new HashMap<>(); + DynamicTemplate.Builder templateBuilder = DynamicTemplate.builder(); + + event.getPack().getRegistry(LayeredChunkGeneratorAddon.LAYER_PALETTE_TOKEN).forEach((registryKey, registryEntry) -> { + LayerPalette layerPalette = registryEntry.get(); + // Add template value for each BiomeDefinedLayerPalette + if (layerPalette instanceof BiomeDefinedLayerPalette biomeLayerPalette) { + String id = registryKey.getID(); + String fieldName = id + "LayerPalette"; + paletteFields.put(biomeLayerPalette, fieldName); + DynamicValue.Builder value = DynamicValue.builder("layers." + id, Palette.class); + biomeLayerPalette.getDefaultPalette().ifPresent(value::setDefault); + templateBuilder.value(fieldName, value.build()); + } + }); + + DynamicTemplate layerPaletteBiomeTemplate = event.load(templateBuilder.build()); + + Map paletteMap = paletteFields.entrySet().stream().collect( + Collectors.toMap(Entry::getKey, entry -> layerPaletteBiomeTemplate.get(entry.getValue(), Palette.class))); + event.getLoadedObject(Biome.class).getContext().put(new BiomeLayerPalettes(paletteMap)); + } + }; + + public record BiomeLayerPalettes(Map palettes) implements Properties { + } +} From 4d31fda79f44f228f5ea34abbb54269183de3ff2 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 16 Jul 2022 20:11:17 +1000 Subject: [PATCH 008/126] Implement layer palette groups --- .../LayeredChunkGeneratorAddon.java | 1 + .../chunkgenerator/api/LayerPalette.java | 65 ++++++++++++++++++- .../BiomeDefinedLayerPaletteTemplate.java | 5 +- .../config/palette/LayerPaletteTemplate.java | 21 ++++++ .../palette/SimpleLayerPaletteTemplate.java | 5 +- .../generation/LayeredChunkGenerator.java | 4 ++ .../palette/BiomeDefinedLayerPalette.java | 5 +- .../layer/palette/SimpleLayerPalette.java | 5 +- 8 files changed, 99 insertions(+), 12 deletions(-) create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/LayerPaletteTemplate.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index 884466636..aa502eb58 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -88,6 +88,7 @@ public void initialize() { paletteTypeRegistry.register(addon.key("PALETTE"), SimpleLayerPaletteTemplate::new); paletteTypeRegistry.register(addon.key("BIOME_DEFINED"), BiomeDefinedLayerPaletteTemplate::new); CheckedRegistry> paletteRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TOKEN); + event.getPack().applyLoader(LayerPalette.Group.class, new LayerPalette.Group.Loader(event.getPack())); event.loadTemplate(new LayerPalettePackConfigTemplate()).getPalettes().forEach((key, palette) -> { paletteRegistry.register(addon.key(key), new InstanceWrapper<>(palette)); }); diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java index f5e632165..c4eb14f06 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java @@ -1,10 +1,71 @@ package com.dfsek.terra.addons.chunkgenerator.api; +import com.dfsek.tectonic.api.depth.DepthTracker; +import com.dfsek.tectonic.api.exception.LoadException; +import com.dfsek.tectonic.api.loader.ConfigLoader; +import com.dfsek.tectonic.api.loader.type.TypeLoader; +import org.jetbrains.annotations.NotNull; + +import java.lang.reflect.AnnotatedType; +import java.util.HashMap; +import java.util.Map; + +import com.dfsek.terra.api.config.ConfigPack; +import com.dfsek.terra.api.properties.Properties; import com.dfsek.terra.api.world.biome.Biome; import com.dfsek.terra.api.world.chunk.generation.util.Palette; -public interface LayerPalette { + +public abstract class LayerPalette { + + private final Group group; + + private final boolean resetsGroup; + + protected LayerPalette(Group group, boolean resetsGroup) { + this.group = group; + this.resetsGroup = resetsGroup; + } + + public abstract Palette get(long seed, Biome biome, int x, int y, int z); + + public final Group getGroup() { + return group; + } + + public final boolean resetsGroup() { + return resetsGroup; + } + + public static class Group { + + public static Group NO_GROUP = new Group(); + + private Group() {} + + public static Group get(String string, ConfigPack pack) { + if (!pack.getContext().has(Holder.class)) { + pack.getContext().put(new Holder(new HashMap<>())); + } + return pack.getContext().get(Holder.class).groups.computeIfAbsent(string, s -> new Group()); + } - Palette get(long seed, Biome biome, int x, int y, int z); + private record Holder(Map groups) implements Properties {} + + public static class Loader implements TypeLoader { + private final ConfigPack pack; + + public Loader(ConfigPack pack) { + this.pack = pack; + } + + @Override + public Group load(@NotNull AnnotatedType annotatedType, @NotNull Object o, @NotNull ConfigLoader configLoader, + DepthTracker depthTracker) throws LoadException { + String groupName = (String) o; + return Group.get(groupName, pack); + } + } + } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomeDefinedLayerPaletteTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomeDefinedLayerPaletteTemplate.java index 133e491b5..f04d81ffd 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomeDefinedLayerPaletteTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomeDefinedLayerPaletteTemplate.java @@ -2,14 +2,13 @@ import com.dfsek.tectonic.api.config.template.annotations.Default; import com.dfsek.tectonic.api.config.template.annotations.Value; -import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; import com.dfsek.terra.addons.chunkgenerator.layer.palette.BiomeDefinedLayerPalette; import com.dfsek.terra.api.world.chunk.generation.util.Palette; -public class BiomeDefinedLayerPaletteTemplate implements ObjectTemplate { +public class BiomeDefinedLayerPaletteTemplate extends LayerPaletteTemplate { @Value("default") @Default @@ -17,6 +16,6 @@ public class BiomeDefinedLayerPaletteTemplate implements ObjectTemplate { + + @Value("group") + @Default + protected LayerPalette.Group group = LayerPalette.Group.NO_GROUP; + + @Value("resets-group") + @Default + protected boolean resetsGroup = false; + +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/SimpleLayerPaletteTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/SimpleLayerPaletteTemplate.java index 2ee6a2a2f..43432b43c 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/SimpleLayerPaletteTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/SimpleLayerPaletteTemplate.java @@ -1,20 +1,19 @@ package com.dfsek.terra.addons.chunkgenerator.config.palette; import com.dfsek.tectonic.api.config.template.annotations.Value; -import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; import com.dfsek.terra.addons.chunkgenerator.layer.palette.SimpleLayerPalette; import com.dfsek.terra.api.world.chunk.generation.util.Palette; -public class SimpleLayerPaletteTemplate implements ObjectTemplate { +public class SimpleLayerPaletteTemplate extends LayerPaletteTemplate { @Value("palette") private Palette palette; @Override public LayerPalette get() { - return new SimpleLayerPalette(palette); + return new SimpleLayerPalette(group, resetsGroup, palette); } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java index 5104f0ca6..2de7cfd90 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java @@ -52,6 +52,10 @@ public void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldPropertie if (previousLayerPalette == layerPalette) { paletteLevel++; + } else if (layerPalette.resetsGroup()) { + paletteLevel = 0; + } else if (previousLayerPalette != null && layerPalette.getGroup() == previousLayerPalette.getGroup()) { + paletteLevel++; } else { paletteLevel = 0; } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java index 94489dece..56f595381 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java @@ -18,11 +18,12 @@ import com.dfsek.terra.api.world.chunk.generation.util.Palette; -public class BiomeDefinedLayerPalette implements LayerPalette { +public class BiomeDefinedLayerPalette extends LayerPalette { private final Palette defaultPalette; - public BiomeDefinedLayerPalette(Palette defaultPalette) { + public BiomeDefinedLayerPalette(Group group, boolean resetsGroup, Palette defaultPalette) { + super(group, resetsGroup); this.defaultPalette = defaultPalette; } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java index 4bfbe2133..e39beacef 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java @@ -5,11 +5,12 @@ import com.dfsek.terra.api.world.chunk.generation.util.Palette; -public class SimpleLayerPalette implements LayerPalette { +public class SimpleLayerPalette extends LayerPalette { private final Palette palette; - public SimpleLayerPalette(Palette palette) { + public SimpleLayerPalette(Group group, boolean resetsGroup, Palette palette) { + super(group, resetsGroup); this.palette = palette; } From fea7d7a4fd256cf49b810db847f7e174cb6be402 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sun, 17 Jul 2022 20:35:05 +1000 Subject: [PATCH 009/126] Implement sampler operators + sampler list predicate --- .../LayeredChunkGeneratorAddon.java | 9 +++ .../SamplerLayerPredicateTemplate.java | 7 ++- .../SamplerListLayerPredicateTemplate.java | 38 ++++++++++++ .../predicate/SamplerLayerPredicate.java | 48 ++++++++++++++- .../predicate/SamplerListLayerPredicate.java | 58 +++++++++++++++++++ 5 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerListLayerPredicateTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index aa502eb58..956d85784 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -19,11 +19,14 @@ import com.dfsek.terra.addons.chunkgenerator.config.predicate.BelowLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.RangeLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.SamplerLayerPredicateTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.predicate.SamplerListLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.resolve.PaletteLayerResolverTemplate; import com.dfsek.terra.addons.chunkgenerator.config.resolve.PredicateLayerResolverTemplate; import com.dfsek.terra.addons.chunkgenerator.config.sampler.SimpleLayerSamplerTemplate; import com.dfsek.terra.addons.chunkgenerator.generation.LayeredChunkGenerator; import com.dfsek.terra.addons.chunkgenerator.layer.palette.BiomeDefinedLayerPalette; +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerListLayerPredicate.CoordinateTest; import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.addons.manifest.api.AddonInitializer; import com.dfsek.terra.api.Platform; @@ -98,6 +101,12 @@ public void initialize() { predicateTypeRegistry.register(addon.key("BELOW"), BelowLayerPredicateTemplate::new); predicateTypeRegistry.register(addon.key("RANGE"), RangeLayerPredicateTemplate::new); predicateTypeRegistry.register(addon.key("SAMPLER"), SamplerLayerPredicateTemplate::new); + predicateTypeRegistry.register(addon.key("SAMPLER_LIST"), SamplerListLayerPredicateTemplate::new); + + event.getPack().applyLoader(CoordinateTest.class, CoordinateTest.Template::new) + .applyLoader(SamplerLayerPredicate.Operator.class, + (type, o, loader, depthTracker) -> SamplerLayerPredicate.Operator.valueOf((String) o)); + CheckedRegistry> predicateRegistry = event.getPack().getOrCreateRegistry(LAYER_PREDICATE_TOKEN); event.loadTemplate(new LayerPredicatePackConfigTemplate()).getPredicates().forEach((key, predicate) -> { predicateRegistry.register(addon.key(key), new InstanceWrapper<>(predicate)); diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java index 93265156d..63a6fe4da 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java @@ -7,6 +7,7 @@ import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate.Operator; import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.api.config.meta.Meta; @@ -20,8 +21,12 @@ public class SamplerLayerPredicateTemplate implements ObjectTemplate { + + @Value("sampler") + private @Meta InstanceWrapper sampler; + + @Value("tests") + private List tests; + + @Value("default-threshold") + @Default + private double defaultThreshold = 0; + + @Value("default-operator") + @Default + private Operator defaultOperator = Operator.GreaterThan; + + @Override + public LayerPredicate get() { + return new SamplerListLayerPredicate(sampler.get(), defaultOperator, tests); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java index 632205420..27fd6d886 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java @@ -11,13 +11,57 @@ public class SamplerLayerPredicate implements LayerPredicate { private final double threshold; - public SamplerLayerPredicate(LayerSampler sampler, double threshold) { + private final Operator operator; + + public SamplerLayerPredicate(LayerSampler sampler, Operator operator, double threshold) { this.sampler = sampler; + this.operator = operator; this.threshold = threshold; } @Override public boolean test(long seed, Biome biome, int x, int y, int z) { - return sampler.sample(seed, biome, x, y, z) > threshold; + return operator.evaluate(sampler.sample(seed, biome, x, y, z), threshold); + } + + public enum Operator { + GreaterThan { + @Override + public boolean evaluate(double a, double b) { + return a > b; + } + }, + GreaterThanOrEqual { + @Override + public boolean evaluate(double a, double b) { + return a >= b; + } + }, + LessThan { + @Override + public boolean evaluate(double a, double b) { + return a < b; + } + }, + LessThanOrEqual { + @Override + public boolean evaluate(double a, double b) { + return a <= b; + } + }, + Equals { + @Override + public boolean evaluate(double a, double b) { + return a == b; + } + }, + NotEquals { + @Override + public boolean evaluate(double a, double b) { + return a != b; + } + }; + + public abstract boolean evaluate(double a, double b); } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java new file mode 100644 index 000000000..6735c3310 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java @@ -0,0 +1,58 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.predicate; + +import com.dfsek.tectonic.api.config.template.annotations.Default; +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import java.util.List; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; +import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate.Operator; +import com.dfsek.terra.api.world.biome.Biome; + + +public class SamplerListLayerPredicate implements LayerPredicate { + + private final List tests; + private final Operator operator; + private final LayerSampler sampler; + + public SamplerListLayerPredicate(LayerSampler sampler, Operator operator, List tests) { + this.sampler = sampler; + this.operator = operator; + this.tests = tests; + } + + @Override + public boolean test(long seed, Biome biome, int x, int y, int z) { + for (CoordinateTest test : tests) { + if (operator.evaluate(sampler.sample(seed, biome, x + test.x, y + test.y, z + test.z), test.threshold)) return true; + } + return false; + } + + public record CoordinateTest(int x, int y, int z, double threshold) { + + public static class Template implements ObjectTemplate { + + @Value("x") + private int x; + + @Value("y") + private int y; + + @Value("z") + private int z; + + @Value("threshold") + @Default + private double threshold = 0; + + @Override + public CoordinateTest get() { + return new CoordinateTest(x, y, z, threshold); + } + } + } +} From 0b057c5a74f6dc2c36a91718f92ec7b5372cd468 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sun, 17 Jul 2022 20:36:12 +1000 Subject: [PATCH 010/126] Add platform air layer palette --- .../LayeredChunkGeneratorAddon.java | 7 +++++- .../PlatformAirLayerPaletteTemplate.java | 22 +++++++++++++++++++ .../palette/SingletonPalette.java | 18 +++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/PlatformAirLayerPaletteTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SingletonPalette.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index 956d85784..9fc2e8530 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -15,6 +15,7 @@ import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerResolverPackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerSamplerPackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.palette.BiomeDefinedLayerPaletteTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.palette.PlatformAirLayerPaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.palette.SimpleLayerPaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.BelowLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.RangeLayerPredicateTemplate; @@ -82,6 +83,7 @@ public void initialize() { CheckedRegistry>> samplerTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_SAMPLER_TYPE_TOKEN); CheckedRegistry> samplerRegistry = event.getPack().getOrCreateRegistry(LAYER_SAMPLER_TOKEN); samplerTypeRegistry.register(addon.key("SIMPLE"), SimpleLayerSamplerTemplate::new); + event.loadTemplate(new LayerSamplerPackConfigTemplate()).getSamplers().forEach((key, sampler) -> { samplerRegistry.register(addon.key(key), new InstanceWrapper<>(sampler)); }); @@ -90,8 +92,11 @@ public void initialize() { CheckedRegistry>> paletteTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TYPE_TOKEN); paletteTypeRegistry.register(addon.key("PALETTE"), SimpleLayerPaletteTemplate::new); paletteTypeRegistry.register(addon.key("BIOME_DEFINED"), BiomeDefinedLayerPaletteTemplate::new); - CheckedRegistry> paletteRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TOKEN); + paletteTypeRegistry.register(addon.key("AIR"), () -> new PlatformAirLayerPaletteTemplate(platform)); + event.getPack().applyLoader(LayerPalette.Group.class, new LayerPalette.Group.Loader(event.getPack())); + + CheckedRegistry> paletteRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TOKEN); event.loadTemplate(new LayerPalettePackConfigTemplate()).getPalettes().forEach((key, palette) -> { paletteRegistry.register(addon.key(key), new InstanceWrapper<>(palette)); }); diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/PlatformAirLayerPaletteTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/PlatformAirLayerPaletteTemplate.java new file mode 100644 index 000000000..00e4feadf --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/PlatformAirLayerPaletteTemplate.java @@ -0,0 +1,22 @@ +package com.dfsek.terra.addons.chunkgenerator.config.palette; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.layer.palette.SimpleLayerPalette; +import com.dfsek.terra.addons.chunkgenerator.palette.SingletonPalette; +import com.dfsek.terra.api.Platform; +import com.dfsek.terra.api.block.state.BlockState; + + +public class PlatformAirLayerPaletteTemplate extends LayerPaletteTemplate { + + private BlockState air; + + public PlatformAirLayerPaletteTemplate(Platform platform) { + this.air = platform.getWorldHandle().air(); + } + + @Override + public LayerPalette get() { + return new SimpleLayerPalette(group, resetsGroup, new SingletonPalette(air)); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SingletonPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SingletonPalette.java new file mode 100644 index 000000000..fb83db0ea --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SingletonPalette.java @@ -0,0 +1,18 @@ +package com.dfsek.terra.addons.chunkgenerator.palette; + +import com.dfsek.terra.api.block.state.BlockState; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; + + +public class SingletonPalette implements Palette { + private final BlockState blockState; + + public SingletonPalette(BlockState blockState) { + this.blockState = blockState; + } + + @Override + public BlockState get(int layer, double x, double y, double z, long seed) { + return blockState; + } +} From 237b897146a64455c552076b99c6a89f0b854075 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sun, 17 Jul 2022 20:36:26 +1000 Subject: [PATCH 011/126] Rename predicates key to tests --- .../config/pack/LayerPredicatePackConfigTemplate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPredicatePackConfigTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPredicatePackConfigTemplate.java index ca7d47254..cf4bb2172 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPredicatePackConfigTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pack/LayerPredicatePackConfigTemplate.java @@ -13,7 +13,7 @@ public class LayerPredicatePackConfigTemplate implements ConfigTemplate { - @Value("generation.predicates") + @Value("generation.tests") @Default private @Meta Map predicates = new LinkedHashMap<>(); From 7baace047b8c0d1e496ecfb683231604c7fa125d Mon Sep 17 00:00:00 2001 From: Astrash Date: Mon, 18 Jul 2022 11:59:25 +1000 Subject: [PATCH 012/126] Change layer class method signatures --- .../addons/chunkgenerator/api/LayerPredicate.java | 5 +++-- .../addons/chunkgenerator/api/LayerResolver.java | 6 ++++-- .../addons/chunkgenerator/api/LayerSampler.java | 8 +++----- .../generation/LayeredChunkGenerator.java | 12 +++++------- .../layer/predicate/BelowLayerPredicate.java | 5 +++-- .../layer/predicate/RangeLayerPredicate.java | 5 +++-- .../layer/predicate/SamplerLayerPredicate.java | 7 ++++--- .../layer/predicate/SamplerListLayerPredicate.java | 7 ++++--- .../layer/resolve/PaletteLayerResolver.java | 6 ++++-- .../layer/resolve/PredicateLayerResolver.java | 7 ++++--- .../layer/sampler/SimpleLayerSampler.java | 12 ++++-------- 11 files changed, 41 insertions(+), 39 deletions(-) diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java index bed38a3b0..ce2170d34 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java @@ -1,8 +1,9 @@ package com.dfsek.terra.addons.chunkgenerator.api; -import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; +import com.dfsek.terra.api.world.info.WorldProperties; public interface LayerPredicate { - boolean test(long seed, Biome biome, int x, int y, int z); + boolean test(int x, int y, int z, WorldProperties properties, BiomeProvider provider); } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerResolver.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerResolver.java index def10d8ec..5d0efbd06 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerResolver.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerResolver.java @@ -1,7 +1,9 @@ package com.dfsek.terra.addons.chunkgenerator.api; -import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; +import com.dfsek.terra.api.world.info.WorldProperties; + public interface LayerResolver { - LayerPalette resolve(long seed, Biome biome, int x, int y, int z); + LayerPalette resolve(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider); } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerSampler.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerSampler.java index d328b3b5c..5a782494e 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerSampler.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerSampler.java @@ -1,11 +1,9 @@ package com.dfsek.terra.addons.chunkgenerator.api; -import com.dfsek.terra.api.noise.NoiseSampler; -import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; +import com.dfsek.terra.api.world.info.WorldProperties; public interface LayerSampler { - double sample(long seed, Biome biome, int x, int y, int z); - - NoiseSampler getSampler(); + double sample(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider); } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java index 2de7cfd90..c89766682 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java @@ -48,7 +48,7 @@ public void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldPropertie Biome biome = biomeColumn.get(y); - LayerPalette layerPalette = resolver.resolve(seed, biome, cx, y, cz); + LayerPalette layerPalette = resolver.resolve(cx, y, cz, world, biomeProvider); if (previousLayerPalette == layerPalette) { paletteLevel++; @@ -60,11 +60,9 @@ public void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldPropertie paletteLevel = 0; } previousLayerPalette = layerPalette; - - Palette palette = layerPalette.get(seed, biome, cx, y, cz); - chunk.setBlock(cx, y, cz, palette.get(paletteLevel, cx, y, cz, seed)); - + chunk.setBlock(cx, y, cz, layerPalette.get(seed, biome, cx, y, cz) + .get(paletteLevel, cx, y, cz, seed)); } } } @@ -77,7 +75,7 @@ public BlockState getBlock(WorldProperties world, int x, int y, int z, BiomeProv long seed = world.getSeed(); Biome biome = biomeProvider.getBiome(x, y, z, seed); int layer = 0; // Default to layer 0 for now - return resolver.resolve(seed, biome, x, y, z) + return resolver.resolve(x, y, z, world, biomeProvider) .get(seed, biome, x, y, z) .get(layer, x, y, z, seed); } @@ -86,7 +84,7 @@ public BlockState getBlock(WorldProperties world, int x, int y, int z, BiomeProv public Palette getPalette(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) { long seed = world.getSeed(); Biome biome = biomeProvider.getBiome(x, y, z, seed); - return resolver.resolve(seed, biome, x, y, z) + return resolver.resolve(x, y, z, world, biomeProvider) .get(seed, biome, x, y, z); } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java index 1ffb51939..5eb85d4f8 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java @@ -1,7 +1,8 @@ package com.dfsek.terra.addons.chunkgenerator.layer.predicate; import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; -import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; +import com.dfsek.terra.api.world.info.WorldProperties; public class BelowLayerPredicate implements LayerPredicate { @@ -13,7 +14,7 @@ public BelowLayerPredicate(int y) { } @Override - public boolean test(long seed, Biome biome, int x, int y, int z) { + public boolean test(int x, int y, int z, WorldProperties properties, BiomeProvider biomeProvider) { return y < this.y; } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java index 9e0ab8ba0..d116bb686 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java @@ -2,7 +2,8 @@ import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.api.util.Range; -import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; +import com.dfsek.terra.api.world.info.WorldProperties; public class RangeLayerPredicate implements LayerPredicate { @@ -13,7 +14,7 @@ public RangeLayerPredicate(Range range) { this.range = range; } @Override - public boolean test(long seed, Biome biome, int x, int y, int z) { + public boolean test(int x, int y, int z, WorldProperties world, BiomeProvider provider) { return range.isInRange(y); } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java index 27fd6d886..e7de52e25 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java @@ -2,7 +2,8 @@ import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; -import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; +import com.dfsek.terra.api.world.info.WorldProperties; public class SamplerLayerPredicate implements LayerPredicate { @@ -20,8 +21,8 @@ public SamplerLayerPredicate(LayerSampler sampler, Operator operator, double thr } @Override - public boolean test(long seed, Biome biome, int x, int y, int z) { - return operator.evaluate(sampler.sample(seed, biome, x, y, z), threshold); + public boolean test(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) { + return operator.evaluate(sampler.sample(x, y, z, world, biomeProvider), threshold); } public enum Operator { diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java index 6735c3310..173f79682 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java @@ -9,7 +9,8 @@ import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate.Operator; -import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; +import com.dfsek.terra.api.world.info.WorldProperties; public class SamplerListLayerPredicate implements LayerPredicate { @@ -25,9 +26,9 @@ public SamplerListLayerPredicate(LayerSampler sampler, Operator operator, List Date: Mon, 18 Jul 2022 12:00:28 +1000 Subject: [PATCH 013/126] Implement biome defined layer samplers --- .../LayeredChunkGeneratorAddon.java | 6 +- .../BiomeDefinedLayerSamplerTemplate.java | 23 ++++++ .../palette/BiomeDefinedLayerPalette.java | 2 +- .../sampler/BiomeDefinedLayerSampler.java | 75 +++++++++++++++++++ 4 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/sampler/BiomeDefinedLayerSamplerTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/sampler/BiomeDefinedLayerSampler.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index 9fc2e8530..418631c39 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -23,11 +23,13 @@ import com.dfsek.terra.addons.chunkgenerator.config.predicate.SamplerListLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.resolve.PaletteLayerResolverTemplate; import com.dfsek.terra.addons.chunkgenerator.config.resolve.PredicateLayerResolverTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.sampler.BiomeDefinedLayerSamplerTemplate; import com.dfsek.terra.addons.chunkgenerator.config.sampler.SimpleLayerSamplerTemplate; import com.dfsek.terra.addons.chunkgenerator.generation.LayeredChunkGenerator; import com.dfsek.terra.addons.chunkgenerator.layer.palette.BiomeDefinedLayerPalette; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerListLayerPredicate.CoordinateTest; +import com.dfsek.terra.addons.chunkgenerator.layer.sampler.BiomeDefinedLayerSampler; import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.addons.manifest.api.AddonInitializer; import com.dfsek.terra.api.Platform; @@ -83,6 +85,7 @@ public void initialize() { CheckedRegistry>> samplerTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_SAMPLER_TYPE_TOKEN); CheckedRegistry> samplerRegistry = event.getPack().getOrCreateRegistry(LAYER_SAMPLER_TOKEN); samplerTypeRegistry.register(addon.key("SIMPLE"), SimpleLayerSamplerTemplate::new); + samplerTypeRegistry.register(addon.key("BIOME_DEFINED"), BiomeDefinedLayerSamplerTemplate::new); event.loadTemplate(new LayerSamplerPackConfigTemplate()).getSamplers().forEach((key, sampler) -> { samplerRegistry.register(addon.key(key), new InstanceWrapper<>(sampler)); @@ -134,6 +137,7 @@ public void initialize() { .getHandler(FunctionalEventHandler.class) .register(addon, ConfigurationLoadEvent.class) .priority(1000) - .then(BiomeDefinedLayerPalette.injectLayerPalettes); + .then(BiomeDefinedLayerPalette.injectLayerPalettes) + .then(BiomeDefinedLayerSampler.injectLayerSamplers); } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/sampler/BiomeDefinedLayerSamplerTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/sampler/BiomeDefinedLayerSamplerTemplate.java new file mode 100644 index 000000000..4fb7965c3 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/sampler/BiomeDefinedLayerSamplerTemplate.java @@ -0,0 +1,23 @@ +package com.dfsek.terra.addons.chunkgenerator.config.sampler; + +import com.dfsek.tectonic.api.config.template.annotations.Default; +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; +import com.dfsek.terra.addons.chunkgenerator.layer.sampler.BiomeDefinedLayerSampler; +import com.dfsek.terra.api.config.meta.Meta; +import com.dfsek.terra.api.noise.NoiseSampler; + + +public class BiomeDefinedLayerSamplerTemplate implements ObjectTemplate { + + @Value("default") + @Default + private @Meta NoiseSampler defaultSampler = null; + + @Override + public LayerSampler get() { + return new BiomeDefinedLayerSampler(defaultSampler); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java index 56f595381..c53efea26 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java @@ -49,7 +49,7 @@ public Optional getDefaultPalette() { String id = registryKey.getID(); String fieldName = id + "LayerPalette"; paletteFields.put(biomeLayerPalette, fieldName); - DynamicValue.Builder value = DynamicValue.builder("layers." + id, Palette.class); + DynamicValue.Builder value = DynamicValue.builder("generation.layers." + id, Palette.class); biomeLayerPalette.getDefaultPalette().ifPresent(value::setDefault); templateBuilder.value(fieldName, value.build()); } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/sampler/BiomeDefinedLayerSampler.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/sampler/BiomeDefinedLayerSampler.java new file mode 100644 index 000000000..804acdf0d --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/sampler/BiomeDefinedLayerSampler.java @@ -0,0 +1,75 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.sampler; + +import com.dfsek.tectonic.api.config.template.dynamic.DynamicTemplate; +import com.dfsek.tectonic.api.config.template.dynamic.DynamicValue; + +import javax.annotation.Nullable; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import com.dfsek.terra.addons.chunkgenerator.LayeredChunkGeneratorAddon; +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; +import com.dfsek.terra.api.event.events.config.ConfigurationLoadEvent; +import com.dfsek.terra.api.noise.NoiseSampler; +import com.dfsek.terra.api.properties.Properties; +import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; +import com.dfsek.terra.api.world.info.WorldProperties; + + +public class BiomeDefinedLayerSampler implements LayerSampler { + + private final NoiseSampler defaultSampler; + + public BiomeDefinedLayerSampler(@Nullable NoiseSampler defaultSampler) { + this.defaultSampler = defaultSampler; + } + + @Override + public double sample(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) { + return biomeProvider.getBiome(x, y, z, world.getSeed()) + .getContext() + .get(BiomeLayerSamplers.class) + .samplers() + .get(this) + .noise(world.getSeed(), x, y, z); + } + + private Optional getDefaultSampler() { + return Optional.ofNullable(defaultSampler); + } + + public static Consumer injectLayerSamplers = event -> { + if(event.is(Biome.class)) { + + Map samplerFields = new HashMap<>(); + DynamicTemplate.Builder templateBuilder = DynamicTemplate.builder(); + + event.getPack().getRegistry(LayeredChunkGeneratorAddon.LAYER_SAMPLER_TOKEN).forEach((registryKey, registryEntry) -> { + LayerSampler layerSampler = registryEntry.get(); + + if (layerSampler instanceof BiomeDefinedLayerSampler biomeLayerSampler) { + String id = registryKey.getID(); + String fieldName = id + "LayerSampler"; + samplerFields.put(biomeLayerSampler, fieldName); + DynamicValue.Builder value = DynamicValue.builder("generation.samplers." + id, NoiseSampler.class); + biomeLayerSampler.getDefaultSampler().ifPresent(value::setDefault); + templateBuilder.value(fieldName, value.build()); + } + }); + + DynamicTemplate layerSamplerBiomeTemplate = event.load(templateBuilder.build()); + + Map samplerMap = samplerFields.entrySet().stream().collect( + Collectors.toMap(Entry::getKey, entry -> layerSamplerBiomeTemplate.get(entry.getValue(), NoiseSampler.class))); + event.getLoadedObject(Biome.class).getContext().put(new BiomeLayerSamplers(samplerMap)); + } + }; + + public record BiomeLayerSamplers(Map samplers) implements Properties { + } +} From 55e024dab04fb3f029de50b8f8620b41b22bed77 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 30 Jul 2022 11:51:54 +1000 Subject: [PATCH 014/126] Change layer signatures --- .../dfsek/terra/addons/chunkgenerator/api/LayerPalette.java | 5 +++-- .../terra/addons/chunkgenerator/api/LayerPredicate.java | 2 +- .../layer/palette/BiomeDefinedLayerPalette.java | 6 ++++-- .../chunkgenerator/layer/palette/SimpleLayerPalette.java | 5 +++-- .../chunkgenerator/layer/predicate/BelowLayerPredicate.java | 2 +- .../chunkgenerator/layer/predicate/RangeLayerPredicate.java | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java index c4eb14f06..bce83f62b 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPalette.java @@ -12,8 +12,9 @@ import com.dfsek.terra.api.config.ConfigPack; import com.dfsek.terra.api.properties.Properties; -import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; import com.dfsek.terra.api.world.chunk.generation.util.Palette; +import com.dfsek.terra.api.world.info.WorldProperties; public abstract class LayerPalette { @@ -27,7 +28,7 @@ protected LayerPalette(Group group, boolean resetsGroup) { this.resetsGroup = resetsGroup; } - public abstract Palette get(long seed, Biome biome, int x, int y, int z); + public abstract Palette get(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider); public final Group getGroup() { return group; diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java index ce2170d34..95c09b798 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/api/LayerPredicate.java @@ -5,5 +5,5 @@ public interface LayerPredicate { - boolean test(int x, int y, int z, WorldProperties properties, BiomeProvider provider); + boolean test(int x, int y, int z, WorldProperties worldProperties, BiomeProvider biomeProvider); } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java index c53efea26..2eb965f03 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/BiomeDefinedLayerPalette.java @@ -15,7 +15,9 @@ import com.dfsek.terra.api.event.events.config.ConfigurationLoadEvent; import com.dfsek.terra.api.properties.Properties; import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; import com.dfsek.terra.api.world.chunk.generation.util.Palette; +import com.dfsek.terra.api.world.info.WorldProperties; public class BiomeDefinedLayerPalette extends LayerPalette { @@ -28,8 +30,8 @@ public BiomeDefinedLayerPalette(Group group, boolean resetsGroup, Palette defaul } @Override - public Palette get(long seed, Biome biome, int x, int y, int z) { - return biome.getContext().get(BiomeLayerPalettes.class).palettes().get(this); + public Palette get(int x, int y, int z, WorldProperties worldProperties, BiomeProvider biomeProvider) { + return biomeProvider.getBiome(x, y, z, worldProperties.getSeed()).getContext().get(BiomeLayerPalettes.class).palettes().get(this); } public Optional getDefaultPalette() { diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java index e39beacef..ff9858230 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/SimpleLayerPalette.java @@ -1,8 +1,9 @@ package com.dfsek.terra.addons.chunkgenerator.layer.palette; import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; -import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; import com.dfsek.terra.api.world.chunk.generation.util.Palette; +import com.dfsek.terra.api.world.info.WorldProperties; public class SimpleLayerPalette extends LayerPalette { @@ -15,7 +16,7 @@ public SimpleLayerPalette(Group group, boolean resetsGroup, Palette palette) { } @Override - public Palette get(long seed, Biome biome, int x, int y, int z) { + public Palette get(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) { return palette; } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java index 5eb85d4f8..2f5f4faf3 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/BelowLayerPredicate.java @@ -14,7 +14,7 @@ public BelowLayerPredicate(int y) { } @Override - public boolean test(int x, int y, int z, WorldProperties properties, BiomeProvider biomeProvider) { + public boolean test(int x, int y, int z, WorldProperties worldProperties, BiomeProvider biomeProvider) { return y < this.y; } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java index d116bb686..c7d108a11 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/RangeLayerPredicate.java @@ -14,7 +14,7 @@ public RangeLayerPredicate(Range range) { this.range = range; } @Override - public boolean test(int x, int y, int z, WorldProperties world, BiomeProvider provider) { + public boolean test(int x, int y, int z, WorldProperties worldProperties, BiomeProvider biomeProvider) { return range.isInRange(y); } } From 50397a4a6b2c2979978446fd47f2dda26cc65406 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 30 Jul 2022 11:53:00 +1000 Subject: [PATCH 015/126] Add loaders for vector classes --- .../dfsek/terra/config/GenericLoaders.java | 8 ++++- .../config/loaders/Vector3IntLoader.java | 31 ++++++++++++++++++ .../terra/config/loaders/Vector3Loader.java | 32 +++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 common/implementation/base/src/main/java/com/dfsek/terra/config/loaders/Vector3IntLoader.java create mode 100644 common/implementation/base/src/main/java/com/dfsek/terra/config/loaders/Vector3Loader.java diff --git a/common/implementation/base/src/main/java/com/dfsek/terra/config/GenericLoaders.java b/common/implementation/base/src/main/java/com/dfsek/terra/config/GenericLoaders.java index f4f5c6cfd..964f30f09 100644 --- a/common/implementation/base/src/main/java/com/dfsek/terra/config/GenericLoaders.java +++ b/common/implementation/base/src/main/java/com/dfsek/terra/config/GenericLoaders.java @@ -31,10 +31,14 @@ import com.dfsek.terra.api.util.Range; import com.dfsek.terra.api.util.collection.MaterialSet; import com.dfsek.terra.api.util.collection.ProbabilityCollection; +import com.dfsek.terra.api.util.vector.Vector3; +import com.dfsek.terra.api.util.vector.Vector3Int; import com.dfsek.terra.config.loaders.LinkedHashMapLoader; import com.dfsek.terra.config.loaders.MaterialSetLoader; import com.dfsek.terra.config.loaders.ProbabilityCollectionLoader; import com.dfsek.terra.config.loaders.RangeLoader; +import com.dfsek.terra.config.loaders.Vector3IntLoader; +import com.dfsek.terra.config.loaders.Vector3Loader; import com.dfsek.terra.config.loaders.VersionLoader; import com.dfsek.terra.config.loaders.VersionRangeLoader; @@ -53,7 +57,9 @@ public void register(TypeRegistry registry) { .registerLoader(Version.class, new VersionLoader()) .registerLoader(MaterialSet.class, new MaterialSetLoader()) .registerLoader(VersionRange.class, new VersionRangeLoader()) - .registerLoader(LinkedHashMap.class, new LinkedHashMapLoader()); + .registerLoader(LinkedHashMap.class, new LinkedHashMapLoader()) + .registerLoader(Vector3.class, new Vector3Loader()) + .registerLoader(Vector3Int.class, new Vector3IntLoader()); if(platform != null) { registry.registerLoader(BaseAddon.class, platform.getAddons()) diff --git a/common/implementation/base/src/main/java/com/dfsek/terra/config/loaders/Vector3IntLoader.java b/common/implementation/base/src/main/java/com/dfsek/terra/config/loaders/Vector3IntLoader.java new file mode 100644 index 000000000..06d470594 --- /dev/null +++ b/common/implementation/base/src/main/java/com/dfsek/terra/config/loaders/Vector3IntLoader.java @@ -0,0 +1,31 @@ +package com.dfsek.terra.config.loaders; + +import com.dfsek.tectonic.api.depth.DepthTracker; +import com.dfsek.tectonic.api.exception.LoadException; +import com.dfsek.tectonic.api.loader.ConfigLoader; +import com.dfsek.tectonic.api.loader.type.TypeLoader; +import org.jetbrains.annotations.NotNull; + +import java.lang.reflect.AnnotatedType; +import java.util.List; +import java.util.Map; + +import com.dfsek.terra.api.util.vector.Vector3Int; + +public class Vector3IntLoader implements TypeLoader { + + @SuppressWarnings("unchecked") + @Override + public Vector3Int load(@NotNull AnnotatedType annotatedType, @NotNull Object o, @NotNull ConfigLoader configLoader, + DepthTracker depthTracker) throws LoadException { + if (o instanceof List) { + List list = (List) o; + return Vector3Int.of(list.get(0), list.get(1), list.get(2)); + } + else { + Map map = (Map) o; + return Vector3Int.of(map.get("x"), map.get("y"), map.get("z")); + } + } +} + diff --git a/common/implementation/base/src/main/java/com/dfsek/terra/config/loaders/Vector3Loader.java b/common/implementation/base/src/main/java/com/dfsek/terra/config/loaders/Vector3Loader.java new file mode 100644 index 000000000..cdfffe15a --- /dev/null +++ b/common/implementation/base/src/main/java/com/dfsek/terra/config/loaders/Vector3Loader.java @@ -0,0 +1,32 @@ +package com.dfsek.terra.config.loaders; + +import com.dfsek.tectonic.api.depth.DepthTracker; +import com.dfsek.tectonic.api.exception.LoadException; +import com.dfsek.tectonic.api.loader.ConfigLoader; +import com.dfsek.tectonic.api.loader.type.TypeLoader; +import org.jetbrains.annotations.NotNull; + +import java.lang.reflect.AnnotatedType; +import java.util.List; +import java.util.Map; + +import com.dfsek.terra.api.util.vector.Vector3; + + +public class Vector3Loader implements TypeLoader { + + @SuppressWarnings("unchecked") + @Override + public Vector3 load(@NotNull AnnotatedType annotatedType, @NotNull Object o, @NotNull ConfigLoader configLoader, + DepthTracker depthTracker) throws LoadException { + if (o instanceof List) { + List list = (List) o; + return Vector3.of(list.get(0), list.get(1), list.get(2)); + } + else { + Map map = (Map) o; + return Vector3.of(map.get("x"), map.get("y"), map.get("z")); + } + } +} + From d9bd9135de72968f7b957691f0121afd51046aac Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 30 Jul 2022 11:58:59 +1000 Subject: [PATCH 016/126] Add point sets to layered gen --- .../LayeredChunkGeneratorAddon.java | 33 ++++++++++++ .../generative/AdjacentPointSetTemplate.java | 15 ++++++ .../generative/SimplePointSetTemplate.java | 22 ++++++++ .../geometric/CubePointSetTemplate.java | 19 +++++++ .../geometric/CuboidPointSetTemplate.java | 25 ++++++++++ .../geometric/SphericalPointSetTemplate.java | 19 +++++++ .../operative/DifferencePointSetTemplate.java | 21 ++++++++ .../ExpressionFilterPointSetTemplate.java | 27 ++++++++++ .../IntersectionPointSetTemplate.java | 21 ++++++++ .../operative/UnionPointSetTemplate.java | 21 ++++++++ .../SamplerLayerPredicateTemplate.java | 4 +- .../SamplerListLayerPredicateTemplate.java | 18 +++---- .../predicate/SamplerLayerPredicate.java | 49 ++---------------- .../predicate/SamplerListLayerPredicate.java | 50 +++++-------------- .../chunkgenerator/math/BooleanOperator.java | 42 ++++++++++++++++ .../math/pointset/PointSet.java | 14 ++++++ .../pointset/generative/AdjacentPointSet.java | 20 ++++++++ .../pointset/generative/SimplePointSet.java | 22 ++++++++ .../generative/geometric/CuboidPointSet.java | 31 ++++++++++++ .../geometric/SphericalPointSet.java | 36 +++++++++++++ .../operative/DifferencePointSet.java | 29 +++++++++++ .../operative/ExpressionFilterPointSet.java | 32 ++++++++++++ .../operative/IntersectionPointSet.java | 29 +++++++++++ .../pointset/operative/UnionPointSet.java | 29 +++++++++++ platforms/fabric/build.gradle.kts | 4 +- 25 files changed, 536 insertions(+), 96 deletions(-) create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/AdjacentPointSetTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/SimplePointSetTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/CubePointSetTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/CuboidPointSetTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/SphericalPointSetTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/DifferencePointSetTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/ExpressionFilterPointSetTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/IntersectionPointSetTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/UnionPointSetTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/BooleanOperator.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/PointSet.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/AdjacentPointSet.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/SimplePointSet.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/geometric/CuboidPointSet.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/geometric/SphericalPointSet.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/DifferencePointSet.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/ExpressionFilterPointSet.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/IntersectionPointSet.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/UnionPointSet.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index 418631c39..844594577 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -17,6 +17,15 @@ import com.dfsek.terra.addons.chunkgenerator.config.palette.BiomeDefinedLayerPaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.palette.PlatformAirLayerPaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.palette.SimpleLayerPaletteTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pointset.generative.AdjacentPointSetTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pointset.generative.SimplePointSetTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pointset.generative.geometric.CubePointSetTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pointset.generative.geometric.CuboidPointSetTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pointset.generative.geometric.SphericalPointSetTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pointset.operative.DifferencePointSetTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pointset.operative.ExpressionFilterPointSetTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pointset.operative.IntersectionPointSetTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.pointset.operative.UnionPointSetTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.BelowLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.RangeLayerPredicateTemplate; import com.dfsek.terra.addons.chunkgenerator.config.predicate.SamplerLayerPredicateTemplate; @@ -30,6 +39,8 @@ import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerListLayerPredicate.CoordinateTest; import com.dfsek.terra.addons.chunkgenerator.layer.sampler.BiomeDefinedLayerSampler; +import com.dfsek.terra.addons.chunkgenerator.math.BooleanOperator; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.addons.manifest.api.AddonInitializer; import com.dfsek.terra.api.Platform; @@ -47,6 +58,9 @@ public class LayeredChunkGeneratorAddon implements AddonInitializer { private static final Logger logger = LoggerFactory.getLogger(LayeredChunkGenerator.class); + public static final TypeKey>> POINT_SET_TYPE_TOKEN = new TypeKey<>() { + }; + public static final TypeKey>> LAYER_SAMPLER_TYPE_TOKEN = new TypeKey<>() { }; @@ -81,6 +95,25 @@ public void initialize() { .getHandler(FunctionalEventHandler.class) .register(addon, ConfigPackPreLoadEvent.class) .priority(1000) + .then(event -> { + event.getPack().applyLoader(BooleanOperator.class, + (type, o, loader, depthTracker) -> BooleanOperator.valueOf((String) o)); + + CheckedRegistry>> pointSetTypeRegistry = event.getPack().getOrCreateRegistry( + POINT_SET_TYPE_TOKEN); + pointSetTypeRegistry.register(addon.key("LIST"), SimplePointSetTemplate::new); + pointSetTypeRegistry.register(addon.key("ADJACENT"), AdjacentPointSetTemplate::new); + + pointSetTypeRegistry.register(addon.key("SPHERE"), SphericalPointSetTemplate::new); + pointSetTypeRegistry.register(addon.key("CUBOID"), CuboidPointSetTemplate::new); + pointSetTypeRegistry.register(addon.key("CUBE"), CubePointSetTemplate::new); + + pointSetTypeRegistry.register(addon.key("UNION"), UnionPointSetTemplate::new); + pointSetTypeRegistry.register(addon.key("INTERSECTION"), IntersectionPointSetTemplate::new); + pointSetTypeRegistry.register(addon.key("DIFFERENCE"), DifferencePointSetTemplate::new); + + pointSetTypeRegistry.register(addon.key("EXPRESSION"), ExpressionFilterPointSetTemplate::new); + }) .then(event -> { CheckedRegistry>> samplerTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_SAMPLER_TYPE_TOKEN); CheckedRegistry> samplerRegistry = event.getPack().getOrCreateRegistry(LAYER_SAMPLER_TOKEN); diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/AdjacentPointSetTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/AdjacentPointSetTemplate.java new file mode 100644 index 000000000..8379cce2e --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/AdjacentPointSetTemplate.java @@ -0,0 +1,15 @@ +package com.dfsek.terra.addons.chunkgenerator.config.pointset.generative; + +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.generative.AdjacentPointSet; + + +public class AdjacentPointSetTemplate implements ObjectTemplate { + + @Override + public PointSet get() { + return new AdjacentPointSet(); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/SimplePointSetTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/SimplePointSetTemplate.java new file mode 100644 index 000000000..b8104cf07 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/SimplePointSetTemplate.java @@ -0,0 +1,22 @@ +package com.dfsek.terra.addons.chunkgenerator.config.pointset.generative; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import java.util.Set; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.generative.SimplePointSet; +import com.dfsek.terra.api.util.vector.Vector3Int; + + +public class SimplePointSetTemplate implements ObjectTemplate { + + @Value("points") + private Set list; + + @Override + public PointSet get() { + return new SimplePointSet(list); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/CubePointSetTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/CubePointSetTemplate.java new file mode 100644 index 000000000..340dd1985 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/CubePointSetTemplate.java @@ -0,0 +1,19 @@ +package com.dfsek.terra.addons.chunkgenerator.config.pointset.generative.geometric; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.generative.geometric.CuboidPointSet; + + +public class CubePointSetTemplate implements ObjectTemplate { + + @Value("size") + private int size; + + @Override + public PointSet get() { + return new CuboidPointSet(-size, -size, -size, size, size, size); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/CuboidPointSetTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/CuboidPointSetTemplate.java new file mode 100644 index 000000000..457548a2a --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/CuboidPointSetTemplate.java @@ -0,0 +1,25 @@ +package com.dfsek.terra.addons.chunkgenerator.config.pointset.generative.geometric; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.generative.geometric.CuboidPointSet; + + +public class CuboidPointSetTemplate implements ObjectTemplate { + + @Value("size.x") + private int xSize; + + @Value("size.y") + private int ySize; + + @Value("size.z") + private int zSize; + + @Override + public PointSet get() { + return new CuboidPointSet(-xSize, -ySize, -zSize, xSize, ySize, zSize); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/SphericalPointSetTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/SphericalPointSetTemplate.java new file mode 100644 index 000000000..b822f119f --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/generative/geometric/SphericalPointSetTemplate.java @@ -0,0 +1,19 @@ +package com.dfsek.terra.addons.chunkgenerator.config.pointset.generative.geometric; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.generative.geometric.SphericalPointSet; + + +public class SphericalPointSetTemplate implements ObjectTemplate { + + @Value("radius") + private double radius; + + @Override + public PointSet get() { + return new SphericalPointSet(radius); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/DifferencePointSetTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/DifferencePointSetTemplate.java new file mode 100644 index 000000000..5a381513e --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/DifferencePointSetTemplate.java @@ -0,0 +1,21 @@ +package com.dfsek.terra.addons.chunkgenerator.config.pointset.operative; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import java.util.List; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.operative.DifferencePointSet; + + +public class DifferencePointSetTemplate implements ObjectTemplate { + + @Value("point-sets") + private List set; + + @Override + public PointSet get() { + return new DifferencePointSet(set); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/ExpressionFilterPointSetTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/ExpressionFilterPointSetTemplate.java new file mode 100644 index 000000000..ef30b7665 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/ExpressionFilterPointSetTemplate.java @@ -0,0 +1,27 @@ +package com.dfsek.terra.addons.chunkgenerator.config.pointset.operative; + +import com.dfsek.paralithic.eval.tokenizer.ParseException; +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.operative.ExpressionFilterPointSet; + + +public class ExpressionFilterPointSetTemplate implements ObjectTemplate { + + @Value("point-set") + private PointSet set; + + @Value("expression") + private String expression; + + @Override + public PointSet get() { + try { + return new ExpressionFilterPointSet(set, expression); + } catch(ParseException e) { + throw new RuntimeException("Failed to parse expression.", e); + } + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/IntersectionPointSetTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/IntersectionPointSetTemplate.java new file mode 100644 index 000000000..d860287e6 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/IntersectionPointSetTemplate.java @@ -0,0 +1,21 @@ +package com.dfsek.terra.addons.chunkgenerator.config.pointset.operative; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import java.util.List; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.operative.IntersectionPointSet; + + +public class IntersectionPointSetTemplate implements ObjectTemplate { + + @Value("point-sets") + private List sets; + + @Override + public PointSet get() { + return new IntersectionPointSet(sets); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/UnionPointSetTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/UnionPointSetTemplate.java new file mode 100644 index 000000000..2a4ba8ac9 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/pointset/operative/UnionPointSetTemplate.java @@ -0,0 +1,21 @@ +package com.dfsek.terra.addons.chunkgenerator.config.pointset.operative; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; + +import java.util.List; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.operative.UnionPointSet; + + +public class UnionPointSetTemplate implements ObjectTemplate { + + @Value("point-sets") + private List sets; + + @Override + public PointSet get() { + return new UnionPointSet(sets); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java index 63a6fe4da..c9be75370 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java @@ -7,7 +7,7 @@ import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate; -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate.Operator; +import com.dfsek.terra.addons.chunkgenerator.math.BooleanOperator; import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.api.config.meta.Meta; @@ -23,7 +23,7 @@ public class SamplerLayerPredicateTemplate implements ObjectTemplate sampler; - @Value("tests") - private List tests; + @Value("point-set") + private PointSet points; - @Value("default-threshold") + @Value("threshold") @Default private double defaultThreshold = 0; - @Value("default-operator") + @Value("operator") @Default - private Operator defaultOperator = Operator.GreaterThan; + private BooleanOperator defaultOperator = BooleanOperator.GreaterThan; @Override public LayerPredicate get() { - return new SamplerListLayerPredicate(sampler.get(), defaultOperator, tests); + return new SamplerListLayerPredicate(sampler.get(), defaultThreshold, defaultOperator, points); } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java index e7de52e25..8143da580 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerLayerPredicate.java @@ -2,6 +2,7 @@ import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; +import com.dfsek.terra.addons.chunkgenerator.math.BooleanOperator; import com.dfsek.terra.api.world.biome.generation.BiomeProvider; import com.dfsek.terra.api.world.info.WorldProperties; @@ -12,57 +13,17 @@ public class SamplerLayerPredicate implements LayerPredicate { private final double threshold; - private final Operator operator; + private final BooleanOperator operator; - public SamplerLayerPredicate(LayerSampler sampler, Operator operator, double threshold) { + public SamplerLayerPredicate(LayerSampler sampler, BooleanOperator operator, double threshold) { this.sampler = sampler; this.operator = operator; this.threshold = threshold; } @Override - public boolean test(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) { - return operator.evaluate(sampler.sample(x, y, z, world, biomeProvider), threshold); + public boolean test(int x, int y, int z, WorldProperties worldProperties, BiomeProvider biomeProvider) { + return operator.evaluate(sampler.sample(x, y, z, worldProperties, biomeProvider), threshold); } - public enum Operator { - GreaterThan { - @Override - public boolean evaluate(double a, double b) { - return a > b; - } - }, - GreaterThanOrEqual { - @Override - public boolean evaluate(double a, double b) { - return a >= b; - } - }, - LessThan { - @Override - public boolean evaluate(double a, double b) { - return a < b; - } - }, - LessThanOrEqual { - @Override - public boolean evaluate(double a, double b) { - return a <= b; - } - }, - Equals { - @Override - public boolean evaluate(double a, double b) { - return a == b; - } - }, - NotEquals { - @Override - public boolean evaluate(double a, double b) { - return a != b; - } - }; - - public abstract boolean evaluate(double a, double b); - } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java index 173f79682..b34be1bcf 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/predicate/SamplerListLayerPredicate.java @@ -1,59 +1,33 @@ package com.dfsek.terra.addons.chunkgenerator.layer.predicate; -import com.dfsek.tectonic.api.config.template.annotations.Default; -import com.dfsek.tectonic.api.config.template.annotations.Value; -import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; - -import java.util.List; - import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate.Operator; +import com.dfsek.terra.addons.chunkgenerator.math.BooleanOperator; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.api.util.vector.Vector3Int; import com.dfsek.terra.api.world.biome.generation.BiomeProvider; import com.dfsek.terra.api.world.info.WorldProperties; public class SamplerListLayerPredicate implements LayerPredicate { - private final List tests; - private final Operator operator; + private final Vector3Int[] points; + private final BooleanOperator operator; private final LayerSampler sampler; + private final double threshold; - public SamplerListLayerPredicate(LayerSampler sampler, Operator operator, List tests) { + public SamplerListLayerPredicate(LayerSampler sampler, double threshold, BooleanOperator operator, PointSet points) { this.sampler = sampler; + this.threshold = threshold; this.operator = operator; - this.tests = tests; + this.points = points.toArray(); } @Override - public boolean test(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) { - for (CoordinateTest test : tests) { - if (operator.evaluate(sampler.sample(x + test.x, y + test.y, z + test.z, world, biomeProvider), test.threshold)) return true; + public boolean test(int x, int y, int z, WorldProperties worldProperties, BiomeProvider biomeProvider) { + for (Vector3Int point : points) { + if (operator.evaluate(sampler.sample(x + point.getX(), y + point.getY(), z + point.getZ(), worldProperties, biomeProvider), threshold)) return true; } return false; } - - public record CoordinateTest(int x, int y, int z, double threshold) { - - public static class Template implements ObjectTemplate { - - @Value("x") - private int x; - - @Value("y") - private int y; - - @Value("z") - private int z; - - @Value("threshold") - @Default - private double threshold = 0; - - @Override - public CoordinateTest get() { - return new CoordinateTest(x, y, z, threshold); - } - } - } } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/BooleanOperator.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/BooleanOperator.java new file mode 100644 index 000000000..7c013ac76 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/BooleanOperator.java @@ -0,0 +1,42 @@ +package com.dfsek.terra.addons.chunkgenerator.math; + +public enum BooleanOperator { + GreaterThan { + @Override + public boolean evaluate(double a, double b) { + return a > b; + } + }, + GreaterThanOrEqual { + @Override + public boolean evaluate(double a, double b) { + return a >= b; + } + }, + LessThan { + @Override + public boolean evaluate(double a, double b) { + return a < b; + } + }, + LessThanOrEqual { + @Override + public boolean evaluate(double a, double b) { + return a <= b; + } + }, + Equals { + @Override + public boolean evaluate(double a, double b) { + return a == b; + } + }, + NotEquals { + @Override + public boolean evaluate(double a, double b) { + return a != b; + } + }; + + public abstract boolean evaluate(double a, double b); +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/PointSet.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/PointSet.java new file mode 100644 index 000000000..16466fd6a --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/PointSet.java @@ -0,0 +1,14 @@ +package com.dfsek.terra.addons.chunkgenerator.math.pointset; + +import java.util.function.Supplier; +import java.util.stream.Stream; + +import com.dfsek.terra.api.util.vector.Vector3Int; + + +public interface PointSet extends Supplier> { + + default Vector3Int[] toArray() { + return this.get().distinct().toArray(Vector3Int[]::new); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/AdjacentPointSet.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/AdjacentPointSet.java new file mode 100644 index 000000000..e6788a455 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/AdjacentPointSet.java @@ -0,0 +1,20 @@ +package com.dfsek.terra.addons.chunkgenerator.math.pointset.generative; + +import java.util.stream.Stream; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.api.util.vector.Vector3Int; + +public class AdjacentPointSet implements PointSet { + @Override + public Stream get() { + return Stream.of( + Vector3Int.of(0, 0, -1), + Vector3Int.of(0, 0, 1), + Vector3Int.of(0, -1, 0), + Vector3Int.of(0, 1, 0), + Vector3Int.of(-1, 0, 0), + Vector3Int.of(1, 0, 0) + ); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/SimplePointSet.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/SimplePointSet.java new file mode 100644 index 000000000..e1e50bdc0 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/SimplePointSet.java @@ -0,0 +1,22 @@ +package com.dfsek.terra.addons.chunkgenerator.math.pointset.generative; + +import java.util.Set; +import java.util.stream.Stream; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.api.util.vector.Vector3Int; + + +public class SimplePointSet implements PointSet { + + private final Stream points; + + public SimplePointSet(Set points) { + this.points = points.stream(); + } + + @Override + public Stream get() { + return points; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/geometric/CuboidPointSet.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/geometric/CuboidPointSet.java new file mode 100644 index 000000000..08e8d746f --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/geometric/CuboidPointSet.java @@ -0,0 +1,31 @@ +package com.dfsek.terra.addons.chunkgenerator.math.pointset.generative.geometric; + +import java.util.HashSet; +import java.util.Set; +import java.util.stream.Stream; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.api.util.vector.Vector3Int; + + +public class CuboidPointSet implements PointSet { + + private final Stream points; + + public CuboidPointSet(int x1, int y1, int z1, int x2, int y2, int z2) { + Set points = new HashSet<>(); + for (int x = x1; x <= x2; x = x + 1) { + for (int y = y1; y <= y2; y = y + 1) { + for (int z = z1; z <= z2; z = z + 1) { + points.add(Vector3Int.of(x, y, z)); + } + } + } + this.points = points.stream(); + } + + @Override + public Stream get() { + return points; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/geometric/SphericalPointSet.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/geometric/SphericalPointSet.java new file mode 100644 index 000000000..5621fadef --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/generative/geometric/SphericalPointSet.java @@ -0,0 +1,36 @@ +package com.dfsek.terra.addons.chunkgenerator.math.pointset.generative.geometric; + +import net.jafama.FastMath; + +import java.util.stream.Stream; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.api.util.vector.Vector3Int; + + +public class SphericalPointSet implements PointSet { + + private final Stream points; + + public SphericalPointSet(double radius) { + Stream.Builder streamBuilder = Stream.builder(); + int roundedRadius = FastMath.ceilToInt(radius); + for(int x = -roundedRadius; x <= roundedRadius; x++) { + for(int y = -roundedRadius; y <= roundedRadius; y++) { + for(int z = -roundedRadius; z <= roundedRadius; z++) { + Vector3Int pos = Vector3Int.of(x, y, z); + double length = pos.toVector3().length(); + if (length == 0) continue; + if (length > radius) continue; + streamBuilder.add(pos); + } + } + } + this.points = streamBuilder.build(); + } + + @Override + public Stream get() { + return points; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/DifferencePointSet.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/DifferencePointSet.java new file mode 100644 index 000000000..ed958bf1a --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/DifferencePointSet.java @@ -0,0 +1,29 @@ +package com.dfsek.terra.addons.chunkgenerator.math.pointset.operative; + +import com.google.common.collect.Sets; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.api.util.vector.Vector3Int; + +public class DifferencePointSet implements PointSet { + + private final Stream points; + + public DifferencePointSet(List sets) { + points = sets.stream() + .map(PointSet::get) + .map(s -> s.collect(Collectors.toSet())) + .reduce(Sets::difference).orElse(Collections.emptySet()) + .stream(); + } + + @Override + public Stream get() { + return points; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/ExpressionFilterPointSet.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/ExpressionFilterPointSet.java new file mode 100644 index 000000000..8906446e9 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/ExpressionFilterPointSet.java @@ -0,0 +1,32 @@ +package com.dfsek.terra.addons.chunkgenerator.math.pointset.operative; + +import com.dfsek.paralithic.Expression; +import com.dfsek.paralithic.eval.parser.Parser; +import com.dfsek.paralithic.eval.parser.Scope; +import com.dfsek.paralithic.eval.tokenizer.ParseException; + +import java.util.stream.Stream; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.api.util.vector.Vector3Int; + + +public class ExpressionFilterPointSet implements PointSet { + + private final Stream points; + + public ExpressionFilterPointSet(PointSet set, String eq) throws ParseException { + Parser parser = new Parser(); + Scope scope = new Scope(); + scope.addInvocationVariable("x"); + scope.addInvocationVariable("y"); + scope.addInvocationVariable("z"); + Expression expression = parser.parse(eq, scope); + this.points = set.get().filter(v -> expression.evaluate(v.getX(), v.getY(), v.getZ()) == 1); + } + + @Override + public Stream get() { + return points; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/IntersectionPointSet.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/IntersectionPointSet.java new file mode 100644 index 000000000..0dbe0c498 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/IntersectionPointSet.java @@ -0,0 +1,29 @@ +package com.dfsek.terra.addons.chunkgenerator.math.pointset.operative; + +import com.google.common.collect.Sets; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.api.util.vector.Vector3Int; + +public class IntersectionPointSet implements PointSet { + + private final Stream points; + + public IntersectionPointSet(List sets) { + points = sets.stream() + .map(PointSet::get) + .map(s -> s.collect(Collectors.toSet())) + .reduce(Sets::intersection).orElse(Collections.emptySet()) + .stream(); + } + + @Override + public Stream get() { + return points; + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/UnionPointSet.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/UnionPointSet.java new file mode 100644 index 000000000..bd01c1c68 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/pointset/operative/UnionPointSet.java @@ -0,0 +1,29 @@ +package com.dfsek.terra.addons.chunkgenerator.math.pointset.operative; + +import com.google.common.collect.Sets; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.api.util.vector.Vector3Int; + +public class UnionPointSet implements PointSet { + + private final Stream points; + + public UnionPointSet(List sets) { + points = sets.stream() + .map(PointSet::get) + .map(s -> s.collect(Collectors.toSet())) + .reduce(Sets::union).orElse(Collections.emptySet()) + .stream(); + } + + @Override + public Stream get() { + return points; + } +} diff --git a/platforms/fabric/build.gradle.kts b/platforms/fabric/build.gradle.kts index 7ed3f2e75..b457594d8 100644 --- a/platforms/fabric/build.gradle.kts +++ b/platforms/fabric/build.gradle.kts @@ -52,10 +52,10 @@ loom { launches { named("client") { - property("fabric.log.level", "debug") + property("fabric.log.level", "info") } named("server") { - property("fabric.log.level", "debug") + property("fabric.log.level", "info") } } } From 596c84ab101aa3579138324ec986350d11da8450 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 30 Jul 2022 11:59:15 +1000 Subject: [PATCH 017/126] Forgot signature change in chunk generator --- .../chunkgenerator/generation/LayeredChunkGenerator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java index c89766682..ae096ca6f 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/LayeredChunkGenerator.java @@ -61,7 +61,7 @@ public void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldPropertie } previousLayerPalette = layerPalette; - chunk.setBlock(cx, y, cz, layerPalette.get(seed, biome, cx, y, cz) + chunk.setBlock(cx, y, cz, layerPalette.get(cx, y, cz, world, biomeProvider) .get(paletteLevel, cx, y, cz, seed)); } } @@ -76,7 +76,7 @@ public BlockState getBlock(WorldProperties world, int x, int y, int z, BiomeProv Biome biome = biomeProvider.getBiome(x, y, z, seed); int layer = 0; // Default to layer 0 for now return resolver.resolve(x, y, z, world, biomeProvider) - .get(seed, biome, x, y, z) + .get(x, y, z, world, biomeProvider) .get(layer, x, y, z, seed); } @@ -85,6 +85,6 @@ public Palette getPalette(int x, int y, int z, WorldProperties world, BiomeProvi long seed = world.getSeed(); Biome biome = biomeProvider.getBiome(x, y, z, seed); return resolver.resolve(x, y, z, world, biomeProvider) - .get(seed, biome, x, y, z); + .get(x, y, z, world, biomeProvider); } } From 9a171b0cdb197663e8ec84291cd96728db3c2860 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 30 Jul 2022 12:00:54 +1000 Subject: [PATCH 018/126] Implement dot product layer palette --- .../LayeredChunkGeneratorAddon.java | 32 ++++++-------- .../DotProductLayerPaletteTemplate.java | 44 +++++++++++++++++++ .../layer/palette/DotProductLayerPalette.java | 43 ++++++++++++++++++ .../palette/DoubleNavigableHolder.java | 34 ++++++++++++++ 4 files changed, 135 insertions(+), 18 deletions(-) create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/DotProductLayerPaletteTemplate.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/DotProductLayerPalette.java create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/DoubleNavigableHolder.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index 844594577..b2bf49e76 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -15,6 +15,7 @@ import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerResolverPackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.pack.LayerSamplerPackConfigTemplate; import com.dfsek.terra.addons.chunkgenerator.config.palette.BiomeDefinedLayerPaletteTemplate; +import com.dfsek.terra.addons.chunkgenerator.config.palette.DotProductLayerPaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.palette.PlatformAirLayerPaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.palette.SimpleLayerPaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.pointset.generative.AdjacentPointSetTemplate; @@ -36,8 +37,6 @@ import com.dfsek.terra.addons.chunkgenerator.config.sampler.SimpleLayerSamplerTemplate; import com.dfsek.terra.addons.chunkgenerator.generation.LayeredChunkGenerator; import com.dfsek.terra.addons.chunkgenerator.layer.palette.BiomeDefinedLayerPalette; -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate; -import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerListLayerPredicate.CoordinateTest; import com.dfsek.terra.addons.chunkgenerator.layer.sampler.BiomeDefinedLayerSampler; import com.dfsek.terra.addons.chunkgenerator.math.BooleanOperator; import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; @@ -124,11 +123,24 @@ public void initialize() { samplerRegistry.register(addon.key(key), new InstanceWrapper<>(sampler)); }); }) + .then(event -> { + CheckedRegistry>> predicateTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_PREDICATE_TYPE_TOKEN); + predicateTypeRegistry.register(addon.key("BELOW"), BelowLayerPredicateTemplate::new); + predicateTypeRegistry.register(addon.key("RANGE"), RangeLayerPredicateTemplate::new); + predicateTypeRegistry.register(addon.key("SAMPLER"), SamplerLayerPredicateTemplate::new); + predicateTypeRegistry.register(addon.key("SAMPLER_POINTS"), SamplerListLayerPredicateTemplate::new); + + CheckedRegistry> predicateRegistry = event.getPack().getOrCreateRegistry(LAYER_PREDICATE_TOKEN); + event.loadTemplate(new LayerPredicatePackConfigTemplate()).getPredicates().forEach((key, predicate) -> { + predicateRegistry.register(addon.key(key), new InstanceWrapper<>(predicate)); + }); + }) .then(event -> { CheckedRegistry>> paletteTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_PALETTE_TYPE_TOKEN); paletteTypeRegistry.register(addon.key("PALETTE"), SimpleLayerPaletteTemplate::new); paletteTypeRegistry.register(addon.key("BIOME_DEFINED"), BiomeDefinedLayerPaletteTemplate::new); paletteTypeRegistry.register(addon.key("AIR"), () -> new PlatformAirLayerPaletteTemplate(platform)); + paletteTypeRegistry.register(addon.key("SURFACE_NORMAL"), DotProductLayerPaletteTemplate::new); event.getPack().applyLoader(LayerPalette.Group.class, new LayerPalette.Group.Loader(event.getPack())); @@ -137,22 +149,6 @@ public void initialize() { paletteRegistry.register(addon.key(key), new InstanceWrapper<>(palette)); }); }) - .then(event -> { - CheckedRegistry>> predicateTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_PREDICATE_TYPE_TOKEN); - predicateTypeRegistry.register(addon.key("BELOW"), BelowLayerPredicateTemplate::new); - predicateTypeRegistry.register(addon.key("RANGE"), RangeLayerPredicateTemplate::new); - predicateTypeRegistry.register(addon.key("SAMPLER"), SamplerLayerPredicateTemplate::new); - predicateTypeRegistry.register(addon.key("SAMPLER_LIST"), SamplerListLayerPredicateTemplate::new); - - event.getPack().applyLoader(CoordinateTest.class, CoordinateTest.Template::new) - .applyLoader(SamplerLayerPredicate.Operator.class, - (type, o, loader, depthTracker) -> SamplerLayerPredicate.Operator.valueOf((String) o)); - - CheckedRegistry> predicateRegistry = event.getPack().getOrCreateRegistry(LAYER_PREDICATE_TOKEN); - event.loadTemplate(new LayerPredicatePackConfigTemplate()).getPredicates().forEach((key, predicate) -> { - predicateRegistry.register(addon.key(key), new InstanceWrapper<>(predicate)); - }); - }) .then(event -> { CheckedRegistry>> resolverTypeRegistry = event.getPack().getOrCreateRegistry(LAYER_RESOLVER_TYPE_TOKEN); resolverTypeRegistry.register(addon.key("TEST"), PredicateLayerResolverTemplate::new); diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/DotProductLayerPaletteTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/DotProductLayerPaletteTemplate.java new file mode 100644 index 000000000..6d8fed140 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/DotProductLayerPaletteTemplate.java @@ -0,0 +1,44 @@ +package com.dfsek.terra.addons.chunkgenerator.config.palette; + +import com.dfsek.tectonic.api.config.template.annotations.Default; +import com.dfsek.tectonic.api.config.template.annotations.Value; + +import java.util.HashMap; +import java.util.Map; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; +import com.dfsek.terra.addons.chunkgenerator.layer.palette.DotProductLayerPalette; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.generative.AdjacentPointSet; +import com.dfsek.terra.addons.chunkgenerator.palette.DoubleNavigableHolder; +import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.api.util.vector.Vector3; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; + + +public class DotProductLayerPaletteTemplate extends LayerPaletteTemplate { + + @Value("normal.approximation-points") + @Default + private PointSet normalApproximationPoints = new AdjacentPointSet(); + + @Value("normal.direction") + @Default + private Vector3 direction = Vector3.of(0, 1, 0); + + @Value("normal.sampler") + private InstanceWrapper sampler; + + @Value("palettes") + private Map palettes; + + @Override + public LayerPalette get() { + Map paletteMap = new HashMap<>(); + palettes.forEach((s, p) -> { + paletteMap.put(Double.parseDouble(s), p); + }); + return new DotProductLayerPalette(group, resetsGroup, normalApproximationPoints, new DoubleNavigableHolder<>(paletteMap), sampler.get(), direction); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/DotProductLayerPalette.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/DotProductLayerPalette.java new file mode 100644 index 000000000..8da5d5f7b --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/layer/palette/DotProductLayerPalette.java @@ -0,0 +1,43 @@ +package com.dfsek.terra.addons.chunkgenerator.layer.palette; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.dfsek.terra.addons.chunkgenerator.api.LayerPalette; +import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; +import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; +import com.dfsek.terra.addons.chunkgenerator.palette.DoubleNavigableHolder; +import com.dfsek.terra.api.util.vector.Vector3; +import com.dfsek.terra.api.util.vector.Vector3Int; +import com.dfsek.terra.api.world.biome.generation.BiomeProvider; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; +import com.dfsek.terra.api.world.info.WorldProperties; + + +public class DotProductLayerPalette extends LayerPalette { + + private static final Logger logger = LoggerFactory.getLogger(DotProductLayerPalette.class); + private final DoubleNavigableHolder palettes; + private final Vector3Int[] samplePoints; + private final LayerSampler sampler; + private final Vector3 direction; + + public DotProductLayerPalette(Group group, boolean resetsGroup, + PointSet points, DoubleNavigableHolder palettes, LayerSampler sampler, Vector3 direction) { + super(group, resetsGroup); + this.palettes = palettes; + this.sampler = sampler; + this.direction = direction; + this.samplePoints = points.toArray(); + } + + @Override + public Palette get(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) { + Vector3.Mutable surfaceNormalApproximation = Vector3.Mutable.of(0, 0, 0); + for(Vector3Int point : samplePoints) { + double scalar = -sampler.sample(x+point.getX(), y+point.getY(), z+point.getZ(), world, biomeProvider); + surfaceNormalApproximation.add(point.toVector3Mutable().multiply(scalar)); + } + return palettes.get(direction.dot(surfaceNormalApproximation.normalize())); + } +} diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/DoubleNavigableHolder.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/DoubleNavigableHolder.java new file mode 100644 index 000000000..2f0a9f91b --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/DoubleNavigableHolder.java @@ -0,0 +1,34 @@ +package com.dfsek.terra.addons.chunkgenerator.palette; + +import java.util.Map; +import java.util.NavigableMap; +import java.util.TreeMap; + + +public class DoubleNavigableHolder { + + private final NavigableMap map; + + public DoubleNavigableHolder(Map inputMap) { + NavigableMap map = new TreeMap<>(inputMap); + map.put(Double.MAX_VALUE, map.lastEntry().getValue()); + this.map = map; + } + + public T get(double threshold) { + return map.ceilingEntry(threshold).getValue(); + } + + enum Method { + CEILING, + FLOOR, + CLOSEST + } + + public class Single extends DoubleNavigableHolder { + + public Single(Map inputMap) { + super(inputMap); + } + } +} From c2902cc549d0b5e2b0c7dfb39318498123e00f04 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 30 Jul 2022 12:01:10 +1000 Subject: [PATCH 019/126] Add paralithic as layered gen dependency --- common/addons/chunk-generator-layered/build.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/addons/chunk-generator-layered/build.gradle.kts b/common/addons/chunk-generator-layered/build.gradle.kts index b26c61a77..4065850b0 100644 --- a/common/addons/chunk-generator-layered/build.gradle.kts +++ b/common/addons/chunk-generator-layered/build.gradle.kts @@ -2,6 +2,7 @@ version = version("0.1.0") dependencies { compileOnlyApi(project(":common:addons:manifest-addon-loader")) + api("com.dfsek", "paralithic", Versions.Libraries.paralithic) implementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama) testImplementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama) @@ -9,4 +10,5 @@ dependencies { tasks.named("shadowJar") { relocate("net.jafama", "com.dfsek.terra.addons.chunkgenerator.lib.jafama") + relocate("com.dfsek.paralithic", "com.dfsek.terra.addons.chunkgenerator.lib.paralithic") } From bd139a8edcdc5da0d030a8d51d0ae422c076c7f4 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 30 Jul 2022 12:08:21 +1000 Subject: [PATCH 020/126] BooleanOperator -> RelationalOperator --- .../LayeredChunkGeneratorAddon.java | 6 +++--- .../SamplerLayerPredicateTemplate.java | 4 ++-- .../SamplerListLayerPredicateTemplate.java | 4 ++-- .../predicate/SamplerLayerPredicate.java | 8 ++++---- .../predicate/SamplerListLayerPredicate.java | 8 ++++---- ...nOperator.java => RelationalOperator.java} | 19 +++++++++++-------- .../util/DoubleBiPredicate.java | 6 ++++++ 7 files changed, 32 insertions(+), 23 deletions(-) rename common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/math/{BooleanOperator.java => RelationalOperator.java} (52%) create mode 100644 common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/util/DoubleBiPredicate.java diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java index b2bf49e76..4a22c4024 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/LayeredChunkGeneratorAddon.java @@ -38,7 +38,7 @@ import com.dfsek.terra.addons.chunkgenerator.generation.LayeredChunkGenerator; import com.dfsek.terra.addons.chunkgenerator.layer.palette.BiomeDefinedLayerPalette; import com.dfsek.terra.addons.chunkgenerator.layer.sampler.BiomeDefinedLayerSampler; -import com.dfsek.terra.addons.chunkgenerator.math.BooleanOperator; +import com.dfsek.terra.addons.chunkgenerator.math.RelationalOperator; import com.dfsek.terra.addons.chunkgenerator.math.pointset.PointSet; import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.addons.manifest.api.AddonInitializer; @@ -95,8 +95,8 @@ public void initialize() { .register(addon, ConfigPackPreLoadEvent.class) .priority(1000) .then(event -> { - event.getPack().applyLoader(BooleanOperator.class, - (type, o, loader, depthTracker) -> BooleanOperator.valueOf((String) o)); + event.getPack().applyLoader(RelationalOperator.class, + (type, o, loader, depthTracker) -> RelationalOperator.valueOf((String) o)); CheckedRegistry>> pointSetTypeRegistry = event.getPack().getOrCreateRegistry( POINT_SET_TYPE_TOKEN); diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java index c9be75370..4477acaed 100644 --- a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/predicate/SamplerLayerPredicateTemplate.java @@ -7,7 +7,7 @@ import com.dfsek.terra.addons.chunkgenerator.api.LayerPredicate; import com.dfsek.terra.addons.chunkgenerator.api.LayerSampler; import com.dfsek.terra.addons.chunkgenerator.layer.predicate.SamplerLayerPredicate; -import com.dfsek.terra.addons.chunkgenerator.math.BooleanOperator; +import com.dfsek.terra.addons.chunkgenerator.math.RelationalOperator; import com.dfsek.terra.addons.chunkgenerator.util.InstanceWrapper; import com.dfsek.terra.api.config.meta.Meta; @@ -23,7 +23,7 @@ public class SamplerLayerPredicateTemplate implements ObjectTemplate b; } }, GreaterThanOrEqual { @Override - public boolean evaluate(double a, double b) { + public boolean test(double a, double b) { return a >= b; } }, LessThan { @Override - public boolean evaluate(double a, double b) { + public boolean test(double a, double b) { return a < b; } }, LessThanOrEqual { @Override - public boolean evaluate(double a, double b) { + public boolean test(double a, double b) { return a <= b; } }, Equals { @Override - public boolean evaluate(double a, double b) { + public boolean test(double a, double b) { return a == b; } }, NotEquals { @Override - public boolean evaluate(double a, double b) { + public boolean test(double a, double b) { return a != b; } }; - public abstract boolean evaluate(double a, double b); + public abstract boolean test(double a, double b); } diff --git a/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/util/DoubleBiPredicate.java b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/util/DoubleBiPredicate.java new file mode 100644 index 000000000..948a0fc32 --- /dev/null +++ b/common/addons/chunk-generator-layered/src/main/java/com/dfsek/terra/addons/chunkgenerator/util/DoubleBiPredicate.java @@ -0,0 +1,6 @@ +package com.dfsek.terra.addons.chunkgenerator.util; + +@FunctionalInterface +public interface DoubleBiPredicate { + boolean test(double a, double b); +} From 866d527d35de75a106e12a2fd302e7083a52ab9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Fri, 17 Nov 2023 13:11:28 -0700 Subject: [PATCH 021/126] bump version --- build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 73654719d..a8a497a85 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,8 @@ preRelease(true) -versionProjects(":common:api", version("6.4.0")) -versionProjects(":common:implementation", version("6.4.0")) -versionProjects(":platforms", version("6.4.0")) +versionProjects(":common:api", version("6.5.0")) +versionProjects(":common:implementation", version("6.5.0")) +versionProjects(":platforms", version("6.5.0")) allprojects { From e499ddebd4f76f434cc670605a88417c2a59e282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Fri, 17 Nov 2023 13:34:56 -0700 Subject: [PATCH 022/126] update condeowners --- .github/CODEOWNERS | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4afb8b9c1..732a59b1d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,19 +1,13 @@ # Global owners, automatically request review when pull request is submitted -* @dfsek @solonovamax +* @dfsek @solonovamax @duplexsystem @Astrashh @justaureus # Platforms -## dfsek wrote the majority of the platform impls -/platforms/bukkit/ @dfsek -/platforms/fabric/ @dfsek -/platforms/forge/ @dfsek -/platforms/sponge/ @dfsek -## solonovamax is working on the region generator (unless duplexsystem takes it over) -/platforms/region/ @solonovamax +/platforms/ @dfsek @solonovamax @duplexsystem @justaureus # Common -/common/ @dfsek @solonovamax +/common/ @dfsek @solonovamax @duplexsystem @Astrashh # Gradle Stuff -## Most gradle stuff was written by solonovamax -/buildSrc/ @solonovamax -*.gradle.kts @solonovamax \ No newline at end of file +/buildSrc/ @dfsek @solonovamax @duplexsystem +*.gradle.kts @dfsek @solonovamax @duplexsystem +/gradle/ @dfsek @solonovamax @duplexsystem \ No newline at end of file From 3aef977384d6d6f2d03b3ac2d33876634fe7f9a9 Mon Sep 17 00:00:00 2001 From: Astrashh Date: Sat, 25 Nov 2023 12:02:45 +1100 Subject: [PATCH 023/126] Patch version 6.4.1 (#435) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump version to 6.4.1 * fix fabric dev env * Invert exposed ore logic (#433) * Invert exposed ore logic * Bump ore addon version * Use logger in Gradle over println (#434) * Log info instead of println in gradle scripts * Missed buildSrc printlns --------- Co-authored-by: Zoë --- build.gradle.kts | 6 +-- buildSrc/src/main/kotlin/AddonConfig.kt | 4 +- .../src/main/kotlin/DistributionConfig.kt | 2 +- buildSrc/src/main/kotlin/Utils.kt | 4 +- .../terra/tectonicdoc/GenerateDocsTask.kt | 2 +- common/addons/config-ore/build.gradle.kts | 2 +- .../addons/ore/utils/VanillaOreUtils.java | 39 ++++++++----------- platforms/fabric/build.gradle.kts | 2 + platforms/merged/build.gradle.kts | 4 +- settings.gradle.kts | 2 +- 10 files changed, 31 insertions(+), 36 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 73654719d..f1156e2f7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,8 @@ preRelease(true) -versionProjects(":common:api", version("6.4.0")) -versionProjects(":common:implementation", version("6.4.0")) -versionProjects(":platforms", version("6.4.0")) +versionProjects(":common:api", version("6.4.1")) +versionProjects(":common:implementation", version("6.4.1")) +versionProjects(":platforms", version("6.4.1")) allprojects { diff --git a/buildSrc/src/main/kotlin/AddonConfig.kt b/buildSrc/src/main/kotlin/AddonConfig.kt index b4dda3bca..1880a7b0d 100644 --- a/buildSrc/src/main/kotlin/AddonConfig.kt +++ b/buildSrc/src/main/kotlin/AddonConfig.kt @@ -18,7 +18,7 @@ fun Project.addonDir(dir: File, task: Task) { matchingAddons(dir) { it.name.startsWith("Terra-") // Assume everything that starts with Terra- is a core addon. }.forEach { - println("Deleting old addon: " + it.absolutePath) + logger.info("Deleting old addon: " + it.absolutePath) it.delete() } forSubProjects(":common:addons") { @@ -29,7 +29,7 @@ fun Project.addonDir(dir: File, task: Task) { val base = "${jar.archiveBaseName.get()}-${version}" - println("Copying addon ${jar.archiveFileName.get()} to ${target.absolutePath}. Base name: $base") + logger.info("Copying addon ${jar.archiveFileName.get()} to ${target.absolutePath}. Base name: $base") jar.archiveFile.orNull?.asFile?.copyTo(target) } diff --git a/buildSrc/src/main/kotlin/DistributionConfig.kt b/buildSrc/src/main/kotlin/DistributionConfig.kt index 8c262e729..df003b078 100644 --- a/buildSrc/src/main/kotlin/DistributionConfig.kt +++ b/buildSrc/src/main/kotlin/DistributionConfig.kt @@ -53,7 +53,7 @@ fun Project.configureDistribution() { forSubProjects(":common:addons") { val jar = getJarTask() - println("Packaging addon ${jar.archiveFileName.get()} to $dest. size: ${jar.archiveFile.get().asFile.length() / 1024}KB") + logger.info("Packaging addon ${jar.archiveFileName.get()} to $dest. size: ${jar.archiveFile.get().asFile.length() / 1024}KB") val boot = if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "bootstrap/" else "" val addonPath = fs.getPath("/addons/$boot${jar.archiveFileName.get()}") diff --git a/buildSrc/src/main/kotlin/Utils.kt b/buildSrc/src/main/kotlin/Utils.kt index b775871b0..679786788 100644 --- a/buildSrc/src/main/kotlin/Utils.kt +++ b/buildSrc/src/main/kotlin/Utils.kt @@ -42,10 +42,10 @@ fun preRelease(preRelease: Boolean) { fun Project.versionProjects(project: String, version: String) { forSubProjects(project) { this.version = version - println("Setting version of $path to $version") + logger.info("Setting version of $path to $version") } project(project).version = version - println("Setting version of $project to $version") + logger.info("Setting version of $project to $version") } fun Project.version(version: String): String { diff --git a/buildSrc/src/main/kotlin/com/dfsek/terra/tectonicdoc/GenerateDocsTask.kt b/buildSrc/src/main/kotlin/com/dfsek/terra/tectonicdoc/GenerateDocsTask.kt index 30f515355..60977aee5 100644 --- a/buildSrc/src/main/kotlin/com/dfsek/terra/tectonicdoc/GenerateDocsTask.kt +++ b/buildSrc/src/main/kotlin/com/dfsek/terra/tectonicdoc/GenerateDocsTask.kt @@ -82,7 +82,7 @@ abstract class GenerateDocsTask : DefaultTask() { } template.add(keyName.toString(), description.toString().ifBlank { - println("No description provided for field " + field.name + " in class " + name) + logger.info("No description provided for field " + field.name + " in class " + name) "*No description provided.*" }) } diff --git a/common/addons/config-ore/build.gradle.kts b/common/addons/config-ore/build.gradle.kts index 469635ee6..06718492e 100644 --- a/common/addons/config-ore/build.gradle.kts +++ b/common/addons/config-ore/build.gradle.kts @@ -1,4 +1,4 @@ -version = version("1.1.0") +version = version("1.1.1") dependencies { compileOnlyApi(project(":common:addons:manifest-addon-loader")) diff --git a/common/addons/config-ore/src/main/java/com/dfsek/terra/addons/ore/utils/VanillaOreUtils.java b/common/addons/config-ore/src/main/java/com/dfsek/terra/addons/ore/utils/VanillaOreUtils.java index cfef65b57..f8ede8680 100644 --- a/common/addons/config-ore/src/main/java/com/dfsek/terra/addons/ore/utils/VanillaOreUtils.java +++ b/common/addons/config-ore/src/main/java/com/dfsek/terra/addons/ore/utils/VanillaOreUtils.java @@ -8,31 +8,24 @@ public class VanillaOreUtils { - protected static boolean shouldNotDiscard(Random random, double chance) { - if(chance <= 0.0F) { - return true; - } else if(chance >= 1.0F) { - return false; - } else { - return random.nextFloat() >= chance; - } + private static boolean shouldExpose(Random random, double exposedChance) { + if(exposedChance >= 1.0F) return true; + if(exposedChance <= 0.0F) return false; + return random.nextFloat() < exposedChance; } - public static boolean shouldPlace(MaterialSet replaceable, BlockType type, Double exposed, Random random, WritableWorld world, int x, + public static boolean shouldPlace(MaterialSet replaceable, BlockType type, Double exposedChance, Random random, WritableWorld world, + int x, int y, int z) { - if(!replaceable.contains(type)) { - return false; - } else if(shouldNotDiscard(random, exposed)) { - return true; - } else { - return !(world.getBlockState(x, y, z - 1).isAir() || - world.getBlockState(x, y, z + 1).isAir() || - world.getBlockState(x, y - 1, z).isAir() || - world.getBlockState(x, y + 1, z).isAir() || - world.getBlockState(x - 1, y, z).isAir() || - world.getBlockState(x + 1, y, z).isAir()); - } + if(!replaceable.contains(type)) return false; + if(shouldExpose(random, exposedChance)) return true; // Exposed blocks can be placed regardless of adjacency to air + // Adjacency is checked after determining not exposed rather than vice-versa, assuming block checks are more expensive + boolean adjacentAir = world.getBlockState(x, y, z - 1).isAir() || + world.getBlockState(x, y, z + 1).isAir() || + world.getBlockState(x, y - 1, z).isAir() || + world.getBlockState(x, y + 1, z).isAir() || + world.getBlockState(x - 1, y, z).isAir() || + world.getBlockState(x + 1, y, z).isAir(); + return !adjacentAir; // Exposed check did not pass earlier so only blocks not adjacent air should place } - } - diff --git a/platforms/fabric/build.gradle.kts b/platforms/fabric/build.gradle.kts index 3b977d8af..3598ae92c 100644 --- a/platforms/fabric/build.gradle.kts +++ b/platforms/fabric/build.gradle.kts @@ -29,6 +29,8 @@ dependencies { modImplementation("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud) include("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud) + + modRuntimeOnly("net.fabricmc.fabric-api", "fabric-api", Versions.Fabric.fabricAPI) } loom { diff --git a/platforms/merged/build.gradle.kts b/platforms/merged/build.gradle.kts index ec9e56f87..aab37e093 100644 --- a/platforms/merged/build.gradle.kts +++ b/platforms/merged/build.gradle.kts @@ -13,7 +13,7 @@ val dump = tasks.create("dumpDependents") { doFirst { taskSet.forEach { val resource = File(resourcesDir, it.archiveFileName.get()) - println("Including archive " + it.archiveFileName.orNull + " in directory " + resource.absolutePath) + logger.info("Including archive " + it.archiveFileName.orNull + " in directory " + resource.absolutePath) it.archiveFile.get().asFile.copyTo(resource, true) } } @@ -32,6 +32,6 @@ afterEvaluate { } tasks["dumpDependents"].dependsOn(task) taskSet.add(task) - println("Merged JAR will incorporate task ${task.name} from platform ${it.name}.") + logger.info("Merged JAR will incorporate task ${task.name} from platform ${it.name}.") } } \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 7a1cdc8a0..579176985 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,7 +5,7 @@ fun includeImmediateChildren(dir: File, type: String) { dir.walkTopDown().maxDepth(1).forEach { if (!it.isDirectory || !File(it, "build.gradle.kts").exists()) return@forEach val addonDir = it.relativeTo(file(".")).path.replace("/", ":").replace("\\", ":") - println("Including $type directory \"$addonDir\" as subproject.") + logger.info("Including $type directory \"$addonDir\" as subproject.") include(addonDir) } } From c82e015559998c44deb04ecc099bc9b6c1c90cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Mon, 27 Nov 2023 10:08:50 -0700 Subject: [PATCH 024/126] flatten array for pipeline biomes --- .../pipeline/v2/pipeline/BiomeChunkImpl.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/pipeline/BiomeChunkImpl.java b/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/pipeline/BiomeChunkImpl.java index e9fe9dbb2..6592a6cd8 100644 --- a/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/pipeline/BiomeChunkImpl.java +++ b/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/pipeline/BiomeChunkImpl.java @@ -14,7 +14,9 @@ public class BiomeChunkImpl implements BiomeChunk { private final SeededVector worldOrigin; private final int chunkOriginArrayIndex; private final int worldCoordinateScale; - private PipelineBiome[][] biomes; + private PipelineBiome[] biomes; + + private final int size; public BiomeChunkImpl(SeededVector worldOrigin, PipelineImpl pipeline) { @@ -22,14 +24,14 @@ public BiomeChunkImpl(SeededVector worldOrigin, PipelineImpl pipeline) { this.chunkOriginArrayIndex = pipeline.getChunkOriginArrayIndex(); this.worldCoordinateScale = pipeline.getResolution(); - int size = pipeline.getArraySize(); + this.size = pipeline.getArraySize(); int expanderCount = pipeline.getExpanderCount(); int expansionsApplied = 0; // Allocate working arrays - this.biomes = new PipelineBiome[size][size]; - PipelineBiome[][] lookupArray = new PipelineBiome[size][size]; + this.biomes = new PipelineBiome[size * size]; + PipelineBiome[] lookupArray = new PipelineBiome[size * size]; // A second lookup array is required such that stage application doesn't affect lookups, otherwise application may cascade // Construct working grid @@ -43,7 +45,7 @@ public BiomeChunkImpl(SeededVector worldOrigin, PipelineImpl pipeline) { for(int gridZ = 0; gridZ < gridSize; gridZ++) { int xIndex = gridOrigin + gridX * gridInterval; int zIndex = gridOrigin + gridZ * gridInterval; - biomes[xIndex][zIndex] = pipeline.getSource().get(worldOrigin.seed(), xIndexToWorldCoordinate(xIndex), + biomes[(xIndex * size) + zIndex] = pipeline.getSource().get(worldOrigin.seed(), xIndexToWorldCoordinate(xIndex), zIndexToWorldCoordinate(zIndex)); } } @@ -65,7 +67,7 @@ public BiomeChunkImpl(SeededVector worldOrigin, PipelineImpl pipeline) { // Cycle arrays, the previously populated array is swapped to be used for lookups, and the result of the stage application // overwrites the previous lookup array. This saves having to allocate a new array copy each time - PipelineBiome[][] tempArray = biomes; + PipelineBiome[] tempArray = biomes; biomes = lookupArray; lookupArray = tempArray; @@ -74,7 +76,7 @@ public BiomeChunkImpl(SeededVector worldOrigin, PipelineImpl pipeline) { for(int gridX = 0; gridX < gridSize; gridX = gridX + 1) { int xIndex = gridOrigin + gridX * gridInterval; int zIndex = gridOrigin + gridZ * gridInterval; - biomes[xIndex][zIndex] = stage.apply(new ViewPoint(this, gridInterval, gridX, gridZ, xIndex, zIndex, lookupArray)); + biomes[(xIndex * size) + zIndex] = stage.apply(new ViewPoint(this, gridInterval, gridX, gridZ, xIndex, zIndex, lookupArray, size)); } } } @@ -133,7 +135,7 @@ private static int calculateGridInterval(int totalExpansions, int expansionsAppl public PipelineBiome get(int xInChunk, int zInChunk) { int xIndex = xInChunk + chunkOriginArrayIndex; int zIndex = zInChunk + chunkOriginArrayIndex; - return biomes[xIndex][zIndex]; + return biomes[(xIndex * size) + zIndex]; } private int xIndexToWorldCoordinate(int xIndex) { @@ -159,10 +161,11 @@ public static class ViewPoint { private final int gridZ; private final int xIndex; private final int zIndex; - private final PipelineBiome[][] lookupArray; + private final PipelineBiome[] lookupArray; + private final int size; private ViewPoint(BiomeChunkImpl chunk, int gridInterval, int gridX, int gridZ, int xIndex, int zIndex, - PipelineBiome[][] lookupArray) { + PipelineBiome[] lookupArray, int size) { this.chunk = chunk; this.gridInterval = gridInterval; this.gridX = gridX; @@ -170,13 +173,14 @@ private ViewPoint(BiomeChunkImpl chunk, int gridInterval, int gridX, int gridZ, this.xIndex = xIndex; this.zIndex = zIndex; this.lookupArray = lookupArray; - this.biome = lookupArray[xIndex][zIndex]; + this.size = size; + this.biome = lookupArray[(this.xIndex * this.size) + this.zIndex]; } public PipelineBiome getRelativeBiome(int x, int z) { int lookupXIndex = this.xIndex + x * gridInterval; int lookupZIndex = this.zIndex + z * gridInterval; - return lookupArray[lookupXIndex][lookupZIndex]; + return lookupArray[(lookupXIndex * this.size) + lookupZIndex]; } public PipelineBiome getBiome() { From 734d4bfb94036caa92874ea33f21db25564cdc75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Mon, 27 Nov 2023 10:16:55 -0700 Subject: [PATCH 025/126] reformat --- .../extrusions/ReplaceExtrusion.java | 8 +-- .../biome/image/v2/ImageBiomeProvider.java | 4 +- .../pipeline/v2/pipeline/BiomeChunkImpl.java | 6 +-- .../terra/config/pack/ConfigPackImpl.java | 49 ++++++++++++------- .../bukkit/nms/v1_19_R1/NMSBiomeInfo.java | 4 +- 5 files changed, 43 insertions(+), 28 deletions(-) diff --git a/common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/extrusions/ReplaceExtrusion.java b/common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/extrusions/ReplaceExtrusion.java index daa1b12d9..26b1ec4bb 100644 --- a/common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/extrusions/ReplaceExtrusion.java +++ b/common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/extrusions/ReplaceExtrusion.java @@ -1,5 +1,9 @@ package com.dfsek.terra.addons.biome.extrusion.extrusions; +import java.util.Collection; +import java.util.function.Predicate; +import java.util.stream.Collectors; + import com.dfsek.terra.addons.biome.extrusion.api.Extrusion; import com.dfsek.terra.addons.biome.extrusion.api.ReplaceableBiome; import com.dfsek.terra.addons.biome.query.api.BiomeQueries; @@ -8,10 +12,6 @@ import com.dfsek.terra.api.util.collection.ProbabilityCollection; import com.dfsek.terra.api.world.biome.Biome; -import java.util.Collection; -import java.util.function.Predicate; -import java.util.stream.Collectors; - /** * Sets biomes at locations based on a sampler. diff --git a/common/addons/biome-provider-image-v2/src/main/java/com/dfsek/terra/addons/biome/image/v2/ImageBiomeProvider.java b/common/addons/biome-provider-image-v2/src/main/java/com/dfsek/terra/addons/biome/image/v2/ImageBiomeProvider.java index 8809410c5..073bea70e 100644 --- a/common/addons/biome-provider-image-v2/src/main/java/com/dfsek/terra/addons/biome/image/v2/ImageBiomeProvider.java +++ b/common/addons/biome-provider-image-v2/src/main/java/com/dfsek/terra/addons/biome/image/v2/ImageBiomeProvider.java @@ -7,13 +7,13 @@ package com.dfsek.terra.addons.biome.image.v2; +import java.util.Optional; + import com.dfsek.terra.addons.image.colorsampler.ColorSampler; import com.dfsek.terra.addons.image.converter.ColorConverter; import com.dfsek.terra.api.world.biome.Biome; import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import java.util.Optional; - public class ImageBiomeProvider implements BiomeProvider { private final int resolution; diff --git a/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/pipeline/BiomeChunkImpl.java b/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/pipeline/BiomeChunkImpl.java index 6592a6cd8..78b0fe806 100644 --- a/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/pipeline/BiomeChunkImpl.java +++ b/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/pipeline/BiomeChunkImpl.java @@ -14,9 +14,8 @@ public class BiomeChunkImpl implements BiomeChunk { private final SeededVector worldOrigin; private final int chunkOriginArrayIndex; private final int worldCoordinateScale; - private PipelineBiome[] biomes; - private final int size; + private PipelineBiome[] biomes; public BiomeChunkImpl(SeededVector worldOrigin, PipelineImpl pipeline) { @@ -76,7 +75,8 @@ public BiomeChunkImpl(SeededVector worldOrigin, PipelineImpl pipeline) { for(int gridX = 0; gridX < gridSize; gridX = gridX + 1) { int xIndex = gridOrigin + gridX * gridInterval; int zIndex = gridOrigin + gridZ * gridInterval; - biomes[(xIndex * size) + zIndex] = stage.apply(new ViewPoint(this, gridInterval, gridX, gridZ, xIndex, zIndex, lookupArray, size)); + biomes[(xIndex * size) + zIndex] = stage.apply( + new ViewPoint(this, gridInterval, gridX, gridZ, xIndex, zIndex, lookupArray, size)); } } } diff --git a/common/implementation/base/src/main/java/com/dfsek/terra/config/pack/ConfigPackImpl.java b/common/implementation/base/src/main/java/com/dfsek/terra/config/pack/ConfigPackImpl.java index 06b617cd8..82ec7d95b 100644 --- a/common/implementation/base/src/main/java/com/dfsek/terra/config/pack/ConfigPackImpl.java +++ b/common/implementation/base/src/main/java/com/dfsek/terra/config/pack/ConfigPackImpl.java @@ -26,6 +26,33 @@ import com.dfsek.tectonic.api.loader.ConfigLoader; import com.dfsek.tectonic.api.loader.type.TypeLoader; import com.dfsek.tectonic.yaml.YamlConfiguration; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Multimaps; +import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Supplier; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; import com.dfsek.terra.api.Platform; import com.dfsek.terra.api.addon.BaseAddon; @@ -56,28 +83,16 @@ import com.dfsek.terra.config.fileloaders.ZIPLoader; import com.dfsek.terra.config.loaders.GenericTemplateSupplierLoader; import com.dfsek.terra.config.loaders.config.BufferedImageLoader; -import com.dfsek.terra.config.preprocessor.*; +import com.dfsek.terra.config.preprocessor.MetaListLikePreprocessor; +import com.dfsek.terra.config.preprocessor.MetaMapPreprocessor; +import com.dfsek.terra.config.preprocessor.MetaNumberPreprocessor; +import com.dfsek.terra.config.preprocessor.MetaStringPreprocessor; +import com.dfsek.terra.config.preprocessor.MetaValuePreprocessor; import com.dfsek.terra.config.prototype.ProtoConfig; import com.dfsek.terra.registry.CheckedRegistryImpl; import com.dfsek.terra.registry.OpenRegistryImpl; import com.dfsek.terra.registry.ShortcutHolder; -import com.google.common.collect.ListMultimap; -import com.google.common.collect.Multimaps; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.awt.image.BufferedImage; -import java.io.*; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Supplier; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - /** * Represents a Terra configuration pack. diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInfo.java index 02e67dc8d..31024cf32 100644 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInfo.java +++ b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInfo.java @@ -1,10 +1,10 @@ package com.dfsek.terra.bukkit.nms.v1_19_R1; -import com.dfsek.terra.api.properties.Properties; - import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.biome.Biome; +import com.dfsek.terra.api.properties.Properties; + public record NMSBiomeInfo(ResourceKey biomeKey) implements Properties { } From 382069b09497aecc18e91161929c0820750102f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Mon, 27 Nov 2023 11:35:06 -0700 Subject: [PATCH 026/126] Bump Version to 6.4.2 --- build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f1156e2f7..0088d805e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,8 @@ preRelease(true) -versionProjects(":common:api", version("6.4.1")) -versionProjects(":common:implementation", version("6.4.1")) -versionProjects(":platforms", version("6.4.1")) +versionProjects(":common:api", version("6.4.2")) +versionProjects(":common:implementation", version("6.4.2")) +versionProjects(":platforms", version("6.4.2")) allprojects { From aecdcd578cdb3e6b592214a58bf8e50e14cd8aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Mon, 27 Nov 2023 13:35:48 -0700 Subject: [PATCH 027/126] initial 1.20.3 also disable forge. we're not publishing it anyway --- buildSrc/src/main/kotlin/Versions.kt | 19 ++++++++++--------- ...d.gradle.kts => build.gradle.kts.disabled} | 0 platforms/mixin-common/build.gradle.kts | 2 +- .../mod/handle/MinecraftWorldHandle.java | 12 ++++++++++++ .../mixin/access/MobSpawnerLogicAccessor.java | 4 ++-- .../entity/MobSpawnerBlockEntityMixin.java | 2 +- 6 files changed, 26 insertions(+), 13 deletions(-) rename platforms/forge/{build.gradle.kts => build.gradle.kts.disabled} (100%) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 18dbd85fe..28efbc1e6 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -20,7 +20,8 @@ object Versions { } object Fabric { - const val fabricAPI = "0.90.0+${Mod.minecraft}" + // const val fabricAPI = "0.90.0+${Mod.minecraft}" + const val fabricAPI = "0.91.1+1.20.3" } // // object Quilt { @@ -31,20 +32,20 @@ object Versions { object Mod { const val mixin = "0.12.5+mixin.0.8.5" - const val minecraft = "1.20.2" - const val yarn = "$minecraft+build.4" - const val fabricLoader = "0.14.23" + const val minecraft = "1.20.3-pre3" + const val yarn = "$minecraft+build.1" + const val fabricLoader = "0.14.25" const val architecuryLoom = "1.3.357" const val architecturyPlugin = "3.4.146" const val loomVineflower = "1.11.0" } - - object Forge { - const val forge = "${Mod.minecraft}-48.0.13" - const val burningwave = "12.63.0" - } +// +// object Forge { +// const val forge = "${Mod.minecraft}-48.0.13" +// const val burningwave = "12.63.0" +// } object Bukkit { const val paper = "1.18.2-R0.1-SNAPSHOT" diff --git a/platforms/forge/build.gradle.kts b/platforms/forge/build.gradle.kts.disabled similarity index 100% rename from platforms/forge/build.gradle.kts rename to platforms/forge/build.gradle.kts.disabled diff --git a/platforms/mixin-common/build.gradle.kts b/platforms/mixin-common/build.gradle.kts index a6b4e7231..031cd7159 100644 --- a/platforms/mixin-common/build.gradle.kts +++ b/platforms/mixin-common/build.gradle.kts @@ -24,7 +24,7 @@ dependencies { } architectury { - common("fabric", "forge") + common("fabric") minecraft = Versions.Mod.minecraft } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java index 52ea52dfa..538041417 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java @@ -23,6 +23,8 @@ import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.dfsek.terra.api.block.state.BlockState; import com.dfsek.terra.api.entity.EntityType; @@ -31,11 +33,21 @@ public class MinecraftWorldHandle implements WorldHandle { + private static final BlockState AIR = (BlockState) Blocks.AIR.getDefaultState(); + private static final Logger logger = LoggerFactory.getLogger(MinecraftWorldHandle.class); + @Override public @NotNull BlockState createBlockState(@NotNull String data) { try { + if(data.equals("minecraft:grass")) { //TODO: remove in 7.0 + data = "minecraft:short_grass"; + logger.warn( + "Translating minecraft:grass to minecraft:short_grass. In 1.20.3 minecraft:grass was renamed to minecraft:short_grass" + + ". You are advised to preform this rename in your config backs as this translation will be removed in the next major " + + "version of Terra."); + } net.minecraft.block.BlockState state = BlockArgumentParser.block(Registries.BLOCK.getReadOnlyWrapper(), data, true) .blockState(); if(state == null) throw new IllegalArgumentException("Invalid data: " + data); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/access/MobSpawnerLogicAccessor.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/access/MobSpawnerLogicAccessor.java index 5289cd427..002b5c25b 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/access/MobSpawnerLogicAccessor.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/access/MobSpawnerLogicAccessor.java @@ -17,8 +17,8 @@ package com.dfsek.terra.mod.mixin.access; -import net.minecraft.world.MobSpawnerEntry; -import net.minecraft.world.MobSpawnerLogic; +import net.minecraft.block.spawner.MobSpawnerEntry; +import net.minecraft.block.spawner.MobSpawnerLogic; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java index 1b882e5fd..8004b903f 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java @@ -21,11 +21,11 @@ import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.block.entity.MobSpawnerBlockEntity; +import net.minecraft.block.spawner.MobSpawnerLogic; import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.random.Random; -import net.minecraft.world.MobSpawnerLogic; import org.jetbrains.annotations.NotNull; import org.spongepowered.asm.mixin.Implements; import org.spongepowered.asm.mixin.Interface; From 913637b0a537ef18e3d52b58f1e2e1f690c71dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 18:29:43 -0700 Subject: [PATCH 028/126] update deps --- buildSrc/build.gradle.kts | 6 ++-- buildSrc/src/main/kotlin/DependencyConfig.kt | 10 +++--- buildSrc/src/main/kotlin/Versions.kt | 33 ++++++++++---------- platforms/fabric/build.gradle.kts | 1 - platforms/mixin-common/build.gradle.kts | 1 - platforms/mixin-lifecycle/build.gradle.kts | 1 - 6 files changed, 25 insertions(+), 27 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index eaec594a4..47b630e2f 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -17,10 +17,10 @@ repositories { dependencies { //TODO Allow pulling from Versions.kt implementation("com.github.johnrengelman", "shadow", "8.1.1") - implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.5.6") + implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.5.10") - implementation("org.ow2.asm", "asm", "9.5") - implementation("org.ow2.asm", "asm-tree", "9.5") + implementation("org.ow2.asm", "asm", "9.6") + implementation("org.ow2.asm", "asm-tree", "9.6") implementation("com.dfsek.tectonic", "common", "4.2.0") implementation("org.yaml", "snakeyaml", "2.2") } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/DependencyConfig.kt b/buildSrc/src/main/kotlin/DependencyConfig.kt index 82b3b206b..84c5e19e4 100644 --- a/buildSrc/src/main/kotlin/DependencyConfig.kt +++ b/buildSrc/src/main/kotlin/DependencyConfig.kt @@ -54,11 +54,11 @@ fun Project.configureDependencies() { } dependencies { - testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0") - testImplementation("org.junit.jupiter:junit-jupiter-engine:5.7.0") - compileOnly("org.jetbrains:annotations:23.0.0") + testImplementation("org.junit.jupiter", "junit-jupiter-api", Versions.Libraries.Internal.junit) + testImplementation("org.junit.jupiter", "junit-jupiter-engine", Versions.Libraries.Internal.junit) + compileOnly("org.jetbrains", "annotations", Versions.Libraries.Internal.jetBrainsAnnotations) - compileOnly("com.google.guava:guava:30.0-jre") - testImplementation("com.google.guava:guava:30.0-jre") + compileOnly("com.google.guava", "guava", Versions.Libraries.Internal.guava) + testImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava) } } diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 28efbc1e6..34cb058db 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -11,17 +11,18 @@ object Versions { object Internal { const val shadow = "8.1.1" - const val apacheText = "1.10.0" - const val apacheIO = "2.14.0" + const val apacheText = "1.11.0" + const val apacheIO = "2.15.1" const val guava = "32.1.3-jre" - const val asm = "9.5" + const val asm = "9.6" const val snakeYml = "2.2" + const val jetBrainsAnnotations = "24.1.0" + const val junit = "5.10.1" } } object Fabric { - // const val fabricAPI = "0.90.0+${Mod.minecraft}" - const val fabricAPI = "0.91.1+1.20.3" + const val fabricAPI = "0.91.1+${Mod.minecraft}" } // // object Quilt { @@ -32,12 +33,12 @@ object Versions { object Mod { const val mixin = "0.12.5+mixin.0.8.5" - const val minecraft = "1.20.3-pre3" + const val minecraft = "1.20.3" const val yarn = "$minecraft+build.1" - const val fabricLoader = "0.14.25" + const val fabricLoader = "0.15.0" - const val architecuryLoom = "1.3.357" - const val architecturyPlugin = "3.4.146" + const val architecuryLoom = "1.4.367" + const val architecturyPlugin = "3.4.151" const val loomVineflower = "1.11.0" } @@ -48,14 +49,14 @@ object Versions { // } object Bukkit { - const val paper = "1.18.2-R0.1-SNAPSHOT" - const val paperLib = "1.0.5" + const val paper = "1.18.2-R0.1-20220920.010157-167" + const val paperLib = "1.0.8" const val foliaLib = "0.2.5" const val minecraft = "1.20.2" - const val reflectionRemapper = "0.1.0-SNAPSHOT" - const val paperDevBundle = "1.20.2-R0.1-SNAPSHOT" - const val runPaper = "2.2.0" - const val paperWeight = "1.5.6" + const val reflectionRemapper = "0.1.0" + const val paperDevBundle = "1.20.2-R0.1-20231203.034718-121" + const val runPaper = "2.2.2" + const val paperWeight = "1.5.10" } // @@ -67,6 +68,6 @@ object Versions { // object CLI { const val nbt = "6.1" - const val logback = "1.4.11" + const val logback = "1.4.14" } } \ No newline at end of file diff --git a/platforms/fabric/build.gradle.kts b/platforms/fabric/build.gradle.kts index 3598ae92c..dba268728 100644 --- a/platforms/fabric/build.gradle.kts +++ b/platforms/fabric/build.gradle.kts @@ -3,7 +3,6 @@ import java.util.* plugins { id("dev.architectury.loom") version Versions.Mod.architecuryLoom id("architectury-plugin") version Versions.Mod.architecturyPlugin - id("io.github.juuxel.loom-vineflower") version Versions.Mod.loomVineflower } architectury { diff --git a/platforms/mixin-common/build.gradle.kts b/platforms/mixin-common/build.gradle.kts index 031cd7159..2fb92233c 100644 --- a/platforms/mixin-common/build.gradle.kts +++ b/platforms/mixin-common/build.gradle.kts @@ -1,7 +1,6 @@ plugins { id("dev.architectury.loom") version Versions.Mod.architecuryLoom id("architectury-plugin") version Versions.Mod.architecturyPlugin - id("io.github.juuxel.loom-vineflower") version Versions.Mod.loomVineflower } loom { diff --git a/platforms/mixin-lifecycle/build.gradle.kts b/platforms/mixin-lifecycle/build.gradle.kts index 490cdf687..a4e700412 100644 --- a/platforms/mixin-lifecycle/build.gradle.kts +++ b/platforms/mixin-lifecycle/build.gradle.kts @@ -1,7 +1,6 @@ plugins { id("dev.architectury.loom") version Versions.Mod.architecuryLoom id("architectury-plugin") version Versions.Mod.architecturyPlugin - id("io.github.juuxel.loom-vineflower") version Versions.Mod.loomVineflower } dependencies { From bc65015af0bf4ce59fd1475d0d0fb128a3c690db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 18:53:19 -0700 Subject: [PATCH 029/126] update gradle --- gradle/wrapper/gradle-wrapper.jar | Bin 63721 -> 43462 bytes gradle/wrapper/gradle-wrapper.properties | 3 ++- gradlew | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135c49b765f8051ef9d0a6055ff8e46073d8..d64cd4917707c1f8861d8cb53dd15194d4248596 100644 GIT binary patch literal 43462 zcma&NWl&^owk(X(xVyW%ySuwf;qI=D6|RlDJ2cR^yEKh!@I- zp9QeisK*rlxC>+~7Dk4IxIRsKBHqdR9b3+fyL=ynHmIDe&|>O*VlvO+%z5;9Z$|DJ zb4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uV8hP?p&}TPdm1I$XmG#(RzlD&B2izSj9sl%y5~4qc diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ac72c34e8..db8c3baaf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0adc8e1a5..1aa94a426 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ From 3339d08e114e477529a85abee8caac286ba3e4f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB?= Date: Tue, 5 Dec 2023 19:35:23 -0700 Subject: [PATCH 030/126] Create gradle-build.yml --- .github/workflows/gradle-build.yml | 70 ++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/gradle-build.yml diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml new file mode 100644 index 000000000..462e6dc9d --- /dev/null +++ b/.github/workflows/gradle-build.yml @@ -0,0 +1,70 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle + +name: Gradle Build + +on: [pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Gradle Wrapper Validation + uses: gradle/wrapper-validation-action@v1.1.0 + + - uses: burrunan/gradle-cache-action@v1 + name: Build PROJECT_NAME + # Extra environment variables for Gradle execution (regular GitHub Actions feature) + # Note: env must be outside of "with" + env: + VARIABLE: VALUE + with: + # Specifies arguments for Gradle execution + # If arguments is missing or empty, then Gradle is not executed + arguments: build + # arguments can be multi-line for better readability + # arguments: | + # --no-paralell + # build + # -x test + # Gradle version to use for execution: + # wrapper (default), current, rc, nightly, release-nightly, or + # versions like 6.6 (see https://services.gradle.org/versions/all) + gradle-version: wrapper + # Properties are passed as -Pname=value + properties: | + kotlin.js.compiler=ir + kotlin.parallel.tasks.in.project=true + +# - name: Build with Gradle +# uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 +# with: +# arguments: build + + # The USERNAME and TOKEN need to correspond to the credentials environment variables used in + # the publishing section of your build.gradle +# - name: Publish to GitHub Packages +# uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 +# with: +# arguments: publish +# env: +# USERNAME: ${{ github.actor }} +# TOKEN: ${{ secrets.GITHUB_TOKEN }} From 601d1747209c6c3db7f7b617e4f3143cf0d5ccf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 19:43:48 -0700 Subject: [PATCH 031/126] pin versions and remove dead lines --- .github/workflows/gradle-build.yml | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 462e6dc9d..73e2253ed 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -18,24 +18,17 @@ jobs: packages: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: java-version: '17' distribution: 'temurin' server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1.1.0 - - uses: burrunan/gradle-cache-action@v1 + - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 name: Build PROJECT_NAME - # Extra environment variables for Gradle execution (regular GitHub Actions feature) - # Note: env must be outside of "with" - env: - VARIABLE: VALUE with: # Specifies arguments for Gradle execution # If arguments is missing or empty, then Gradle is not executed @@ -52,19 +45,4 @@ jobs: # Properties are passed as -Pname=value properties: | kotlin.js.compiler=ir - kotlin.parallel.tasks.in.project=true - -# - name: Build with Gradle -# uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 -# with: -# arguments: build - - # The USERNAME and TOKEN need to correspond to the credentials environment variables used in - # the publishing section of your build.gradle -# - name: Publish to GitHub Packages -# uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 -# with: -# arguments: publish -# env: -# USERNAME: ${{ github.actor }} -# TOKEN: ${{ secrets.GITHUB_TOKEN }} + kotlin.parallel.tasks.in.project=true \ No newline at end of file From e4df8dce1d02500c35f4649ec7c7396f42137a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 19:52:12 -0700 Subject: [PATCH 032/126] proper gradle cache --- settings.gradle.kts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index 579176985..c5bed6f73 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -39,3 +39,12 @@ pluginManagement { } } } + +// settings.gradle.kts +val isCiServer = System.getenv().containsKey("CI") +// Cache build artifacts, so expensive operations do not need to be re-computed +buildCache { + local { + isEnabled = !isCiServer + } +} \ No newline at end of file From b612d1c7aa0f654cc8548e866fcdf036d24a2954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 19:52:50 -0700 Subject: [PATCH 033/126] fix name --- .github/workflows/gradle-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 73e2253ed..0e7edd345 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -28,7 +28,7 @@ jobs: settings-path: ${{ github.workspace }} # location for the settings.xml file - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 - name: Build PROJECT_NAME + name: Build Terra with: # Specifies arguments for Gradle execution # If arguments is missing or empty, then Gradle is not executed From cb9aa4f167d3f75e6df1b7ada45da7839cb84d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 19:53:05 -0700 Subject: [PATCH 034/126] fix permissions --- .github/workflows/gradle-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 0e7edd345..0a8804cbb 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -15,7 +15,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - packages: write steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 From e160cae3d80a1e57a63b274be14d4213f88e88e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 20:04:08 -0700 Subject: [PATCH 035/126] reformat --- .github/workflows/gradle-build.yml | 56 +++++++++++++++--------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 0a8804cbb..3e40fe7be 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -7,7 +7,7 @@ name: Gradle Build -on: [pull_request] +on: [ pull_request ] jobs: build: @@ -17,31 +17,31 @@ jobs: contents: read steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: Set up JDK 17 - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 - with: - java-version: '17' - distribution: 'temurin' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Set up JDK 17 + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 + with: + java-version: '17' + distribution: 'temurin' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file - - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 - name: Build Terra - with: - # Specifies arguments for Gradle execution - # If arguments is missing or empty, then Gradle is not executed - arguments: build - # arguments can be multi-line for better readability - # arguments: | - # --no-paralell - # build - # -x test - # Gradle version to use for execution: - # wrapper (default), current, rc, nightly, release-nightly, or - # versions like 6.6 (see https://services.gradle.org/versions/all) - gradle-version: wrapper - # Properties are passed as -Pname=value - properties: | - kotlin.js.compiler=ir - kotlin.parallel.tasks.in.project=true \ No newline at end of file + - uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6 + name: Build Terra + with: + # Specifies arguments for Gradle execution + # If arguments is missing or empty, then Gradle is not executed + arguments: build + # arguments can be multi-line for better readability + # arguments: | + # --no-paralell + # build + # -x test + # Gradle version to use for execution: + # wrapper (default), current, rc, nightly, release-nightly, or + # versions like 6.6 (see https://services.gradle.org/versions/all) + gradle-version: wrapper + # Properties are passed as -Pname=value + properties: | + kotlin.js.compiler=ir + kotlin.parallel.tasks.in.project=true \ No newline at end of file From e4c3affb9f562560ca90dfdb9e0d8da3a0af3e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Tue, 5 Dec 2023 20:11:00 -0700 Subject: [PATCH 036/126] pull up version range --- platforms/fabric/src/main/resources/fabric.mod.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/fabric/src/main/resources/fabric.mod.json b/platforms/fabric/src/main/resources/fabric.mod.json index bfb572710..1aeadf282 100644 --- a/platforms/fabric/src/main/resources/fabric.mod.json +++ b/platforms/fabric/src/main/resources/fabric.mod.json @@ -26,9 +26,9 @@ "terra.common.mixins.json" ], "depends": { - "fabricloader": ">=0.14.2", + "fabricloader": ">=0.15.0", "java": ">=17", - "minecraft": "1.20.x", + "minecraft": ">=1.20.3", "fabric": "*" } } \ No newline at end of file From fc0d7374e4c02c38afc07dfa23111a24414890ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Fri, 17 Nov 2023 13:22:10 -0700 Subject: [PATCH 037/126] remove old bukkit versions --- platforms/bukkit/build.gradle.kts | 5 - .../bukkit/nms/v1_18_R2/build.gradle.kts | 17 - .../bukkit/nms/v1_18_R2/AwfulBukkitHacks.java | 115 ------- .../bukkit/nms/v1_18_R2/NMSBiomeInfo.java | 10 - .../bukkit/nms/v1_18_R2/NMSBiomeInjector.java | 79 ----- .../bukkit/nms/v1_18_R2/NMSBiomeProvider.java | 49 --- .../v1_18_R2/NMSChunkGeneratorDelegate.java | 254 --------------- .../bukkit/nms/v1_18_R2/NMSInitializer.java | 15 - .../nms/v1_18_R2/NMSInjectListener.java | 53 ---- .../nms/v1_18_R2/NMSWorldProperties.java | 36 --- .../terra/bukkit/nms/v1_18_R2/Reflection.java | 38 --- .../terra/bukkit/nms/v1_18_R2/Registries.java | 30 -- .../bukkit/nms/v1_19_R1/build.gradle.kts | 17 - .../bukkit/nms/v1_19_R1/AwfulBukkitHacks.java | 116 ------- .../bukkit/nms/v1_19_R1/NMSBiomeInfo.java | 10 - .../bukkit/nms/v1_19_R1/NMSBiomeInjector.java | 79 ----- .../bukkit/nms/v1_19_R1/NMSBiomeProvider.java | 42 --- .../v1_19_R1/NMSChunkGeneratorDelegate.java | 291 ------------------ .../bukkit/nms/v1_19_R1/NMSInitializer.java | 15 - .../nms/v1_19_R1/NMSInjectListener.java | 51 --- .../nms/v1_19_R1/NMSWorldProperties.java | 36 --- .../terra/bukkit/nms/v1_19_R1/Reflection.java | 39 --- .../terra/bukkit/nms/v1_19_R1/Registries.java | 30 -- .../bukkit/nms/v1_19_R2/build.gradle.kts | 17 - .../bukkit/nms/v1_19_R2/AwfulBukkitHacks.java | 100 ------ .../bukkit/nms/v1_19_R2/NMSBiomeInfo.java | 10 - .../bukkit/nms/v1_19_R2/NMSBiomeInjector.java | 79 ----- .../bukkit/nms/v1_19_R2/NMSBiomeProvider.java | 42 --- .../v1_19_R2/NMSChunkGeneratorDelegate.java | 174 ----------- .../bukkit/nms/v1_19_R2/NMSInitializer.java | 15 - .../nms/v1_19_R2/NMSInjectListener.java | 48 --- .../nms/v1_19_R2/NMSWorldProperties.java | 36 --- .../terra/bukkit/nms/v1_19_R2/Reflection.java | 52 ---- .../bukkit/nms/v1_19_R2/RegistryFetcher.java | 24 -- .../bukkit/nms/v1_19_R3/build.gradle.kts | 17 - .../bukkit/nms/v1_19_R3/AwfulBukkitHacks.java | 101 ------ .../bukkit/nms/v1_19_R3/NMSBiomeInfo.java | 10 - .../bukkit/nms/v1_19_R3/NMSBiomeInjector.java | 78 ----- .../bukkit/nms/v1_19_R3/NMSBiomeProvider.java | 49 --- .../v1_19_R3/NMSChunkGeneratorDelegate.java | 171 ---------- .../bukkit/nms/v1_19_R3/NMSInitializer.java | 15 - .../nms/v1_19_R3/NMSInjectListener.java | 48 --- .../nms/v1_19_R3/NMSWorldProperties.java | 36 --- .../terra/bukkit/nms/v1_19_R3/Reflection.java | 52 ---- .../bukkit/nms/v1_19_R3/RegistryFetcher.java | 24 -- .../bukkit/nms/v1_20_R1/build.gradle.kts | 17 - .../bukkit/nms/v1_20_R1/AwfulBukkitHacks.java | 101 ------ .../bukkit/nms/v1_20_R1/NMSBiomeInfo.java | 10 - .../bukkit/nms/v1_20_R1/NMSBiomeInjector.java | 78 ----- .../bukkit/nms/v1_20_R1/NMSBiomeProvider.java | 49 --- .../v1_20_R1/NMSChunkGeneratorDelegate.java | 171 ---------- .../bukkit/nms/v1_20_R1/NMSInitializer.java | 15 - .../nms/v1_20_R1/NMSInjectListener.java | 48 --- .../nms/v1_20_R1/NMSWorldProperties.java | 36 --- .../terra/bukkit/nms/v1_20_R1/Reflection.java | 52 ---- .../bukkit/nms/v1_20_R1/RegistryFetcher.java | 24 -- 56 files changed, 3226 deletions(-) delete mode 100644 platforms/bukkit/nms/v1_18_R2/build.gradle.kts delete mode 100644 platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/AwfulBukkitHacks.java delete mode 100644 platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeInfo.java delete mode 100644 platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeInjector.java delete mode 100644 platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeProvider.java delete mode 100644 platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSChunkGeneratorDelegate.java delete mode 100644 platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSInitializer.java delete mode 100644 platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSInjectListener.java delete mode 100644 platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSWorldProperties.java delete mode 100644 platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/Reflection.java delete mode 100644 platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/Registries.java delete mode 100644 platforms/bukkit/nms/v1_19_R1/build.gradle.kts delete mode 100644 platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/AwfulBukkitHacks.java delete mode 100644 platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInfo.java delete mode 100644 platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInjector.java delete mode 100644 platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeProvider.java delete mode 100644 platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSChunkGeneratorDelegate.java delete mode 100644 platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSInitializer.java delete mode 100644 platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSInjectListener.java delete mode 100644 platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSWorldProperties.java delete mode 100644 platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/Reflection.java delete mode 100644 platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/Registries.java delete mode 100644 platforms/bukkit/nms/v1_19_R2/build.gradle.kts delete mode 100644 platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/AwfulBukkitHacks.java delete mode 100644 platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeInfo.java delete mode 100644 platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeInjector.java delete mode 100644 platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeProvider.java delete mode 100644 platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSChunkGeneratorDelegate.java delete mode 100644 platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSInitializer.java delete mode 100644 platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSInjectListener.java delete mode 100644 platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSWorldProperties.java delete mode 100644 platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/Reflection.java delete mode 100644 platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/RegistryFetcher.java delete mode 100644 platforms/bukkit/nms/v1_19_R3/build.gradle.kts delete mode 100644 platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/AwfulBukkitHacks.java delete mode 100644 platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeInfo.java delete mode 100644 platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeInjector.java delete mode 100644 platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeProvider.java delete mode 100644 platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSChunkGeneratorDelegate.java delete mode 100644 platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSInitializer.java delete mode 100644 platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSInjectListener.java delete mode 100644 platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSWorldProperties.java delete mode 100644 platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/Reflection.java delete mode 100644 platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/RegistryFetcher.java delete mode 100644 platforms/bukkit/nms/v1_20_R1/build.gradle.kts delete mode 100644 platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/AwfulBukkitHacks.java delete mode 100644 platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeInfo.java delete mode 100644 platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeInjector.java delete mode 100644 platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeProvider.java delete mode 100644 platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSChunkGeneratorDelegate.java delete mode 100644 platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSInitializer.java delete mode 100644 platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSInjectListener.java delete mode 100644 platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSWorldProperties.java delete mode 100644 platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/Reflection.java delete mode 100644 platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/RegistryFetcher.java diff --git a/platforms/bukkit/build.gradle.kts b/platforms/bukkit/build.gradle.kts index 89df67efc..68f981e1e 100644 --- a/platforms/bukkit/build.gradle.kts +++ b/platforms/bukkit/build.gradle.kts @@ -10,11 +10,6 @@ repositories { dependencies { shaded(project(":platforms:bukkit:common")) - shaded(project(":platforms:bukkit:nms:v1_18_R2", configuration = "reobf")) - shaded(project(":platforms:bukkit:nms:v1_19_R1", configuration = "reobf")) - shaded(project(":platforms:bukkit:nms:v1_19_R2", configuration = "reobf")) - shaded(project(":platforms:bukkit:nms:v1_19_R3", configuration = "reobf")) - shaded(project(":platforms:bukkit:nms:v1_20_R1", configuration = "reobf")) shaded(project(":platforms:bukkit:nms:v1_20_R2", configuration = "reobf")) shaded("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) } diff --git a/platforms/bukkit/nms/v1_18_R2/build.gradle.kts b/platforms/bukkit/nms/v1_18_R2/build.gradle.kts deleted file mode 100644 index e3fc99195..000000000 --- a/platforms/bukkit/nms/v1_18_R2/build.gradle.kts +++ /dev/null @@ -1,17 +0,0 @@ -apply(plugin = "io.papermc.paperweight.userdev") - -repositories { - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") -} - -dependencies { - api(project(":platforms:bukkit:common")) - paperDevBundle("1.18.2-R0.1-SNAPSHOT") - implementation("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) -} - -tasks { - assemble { - dependsOn("reobfJar") - } -} \ No newline at end of file diff --git a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/AwfulBukkitHacks.java deleted file mode 100644 index bbfae8b2c..000000000 --- a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/AwfulBukkitHacks.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_18_R2; - -import com.google.common.collect.ImmutableMap; -import com.mojang.serialization.Lifecycle; -import net.minecraft.core.Holder; -import net.minecraft.core.MappedRegistry; -import net.minecraft.core.Registry; -import net.minecraft.core.WritableRegistry; -import net.minecraft.data.BuiltinRegistries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.TagKey; -import net.minecraft.world.level.biome.Biome; -import org.bukkit.NamespacedKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.dfsek.terra.bukkit.world.BukkitPlatformBiome; -import com.dfsek.terra.registry.master.ConfigRegistry; - - -public class AwfulBukkitHacks { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSBiomeInjector.class); - private static final Map> terraBiomeMap = new HashMap<>(); - - - public static void registerBiomes(ConfigRegistry configRegistry) { - try { - LOGGER.info("Hacking biome registry..."); - WritableRegistry biomeRegistry = (WritableRegistry) Registries.biomeRegistry(); - - Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry) biomeRegistry, false); - - configRegistry.forEach(pack -> pack.getRegistry(com.dfsek.terra.api.world.biome.Biome.class).forEach((key, biome) -> { - try { - BukkitPlatformBiome platformBiome = (BukkitPlatformBiome) biome.getPlatformBiome(); - NamespacedKey vanillaBukkitKey = platformBiome.getHandle().getKey(); - ResourceLocation vanillaMinecraftKey = new ResourceLocation(vanillaBukkitKey.getNamespace(), vanillaBukkitKey.getKey()); - Biome platform = NMSBiomeInjector.createBiome( - biome, - biomeRegistry.get(vanillaMinecraftKey) // get - ); - - ResourceKey delegateKey = ResourceKey.create(Registry.BIOME_REGISTRY, new ResourceLocation("terra", - NMSBiomeInjector.createBiomeID( - pack, key))); - - BuiltinRegistries.register(BuiltinRegistries.BIOME, delegateKey, platform); - biomeRegistry.register(delegateKey, platform, Lifecycle.stable()); - platformBiome.getContext().put(new NMSBiomeInfo(delegateKey)); - - terraBiomeMap.computeIfAbsent(vanillaMinecraftKey, i -> new ArrayList<>()).add(delegateKey.location()); - - LOGGER.debug("Registered biome: " + delegateKey); - } catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { - throw new RuntimeException(e); - } - })); - - Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry) biomeRegistry, true); // freeze registry again :) - - LOGGER.info("Doing tag garbage...."); - Map, List>> collect = biomeRegistry - .getTags() // streamKeysAndEntries - .collect(HashMap::new, - (map, pair) -> - map.put(pair.getFirst(), new ArrayList<>(pair.getSecond().stream().toList())), - HashMap::putAll); - - terraBiomeMap - .forEach((vb, terraBiomes) -> - NMSBiomeInjector.getEntry(biomeRegistry, vb) - .ifPresentOrElse( - vanilla -> terraBiomes - .forEach(tb -> NMSBiomeInjector.getEntry(biomeRegistry, tb) - .ifPresentOrElse( - terra -> { - LOGGER.debug( - vanilla.unwrapKey() - .orElseThrow() - .location() + - " (vanilla for " + - terra.unwrapKey() - .orElseThrow() - .location() + - ": " + - vanilla.tags() - .toList()); - - vanilla.tags() - .forEach( - tag -> collect - .computeIfAbsent( - tag, - t -> new ArrayList<>()) - .add(terra)); - }, - () -> LOGGER.error( - "No such biome: {}", - tb))), - () -> LOGGER.error("No vanilla biome: {}", vb))); - - biomeRegistry.resetTags(); // clearTags - biomeRegistry.bindTags(ImmutableMap.copyOf(collect)); // populateTags - - } catch(SecurityException | IllegalArgumentException exception) { - throw new RuntimeException(exception); - } - } -} diff --git a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeInfo.java deleted file mode 100644 index 7e04ef178..000000000 --- a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeInfo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_18_R2; - -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.level.biome.Biome; - -import com.dfsek.terra.api.properties.Properties; - - -public record NMSBiomeInfo(ResourceKey biomeKey) implements Properties { -} diff --git a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeInjector.java deleted file mode 100644 index f56c32b5b..000000000 --- a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeInjector.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_18_R2; - -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeSpecialEffects; - -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.bukkit.config.VanillaBiomeProperties; - - -public class NMSBiomeInjector { - - public static Optional> getEntry(Registry registry, ResourceLocation identifier) { - return registry.getOptional(identifier) - .flatMap(registry::getResourceKey) - .map(registry::getOrCreateHolder); - } - - public static Biome createBiome(com.dfsek.terra.api.world.biome.Biome biome, Biome vanilla) - throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - Biome.BiomeBuilder builder = new Biome.BiomeBuilder(); // Builder - - - builder.biomeCategory(Reflection.BIOME.getBiomeCategory(vanilla)) - .precipitation(vanilla.getPrecipitation()) // getPrecipitation - .mobSpawnSettings(vanilla.getMobSettings()) - .generationSettings(vanilla.getGenerationSettings()) - .temperature(vanilla.getBaseTemperature()) - .downfall(vanilla.getDownfall()); - - - BiomeSpecialEffects.Builder effects = new BiomeSpecialEffects.Builder(); - - effects.grassColorModifier(vanilla.getSpecialEffects().getGrassColorModifier()); - - VanillaBiomeProperties vanillaBiomeProperties = biome.getContext().get(VanillaBiomeProperties.class); - - effects.fogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getFogColor(), vanilla.getFogColor())) - - .waterColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterColor(), vanilla.getWaterColor())) - - .waterFogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterFogColor(), vanilla.getWaterFogColor())) - - .skyColor(Objects.requireNonNullElse(vanillaBiomeProperties.getSkyColor(), vanilla.getSkyColor())); - - if(vanillaBiomeProperties.getFoliageColor() == null) { - vanilla.getSpecialEffects().getFoliageColorOverride().ifPresent(effects::foliageColorOverride); - } else { - effects.foliageColorOverride(vanillaBiomeProperties.getFoliageColor()); - } - - if(vanillaBiomeProperties.getGrassColor() == null) { - vanilla.getSpecialEffects().getGrassColorOverride().ifPresent(effects::grassColorOverride); - } else { - effects.grassColorOverride(vanillaBiomeProperties.getGrassColor()); - } - - vanilla.getAmbientLoop().ifPresent(effects::ambientLoopSound); - vanilla.getAmbientAdditions().ifPresent(effects::ambientAdditionsSound); - vanilla.getAmbientMood().ifPresent(effects::ambientMoodSound); - vanilla.getBackgroundMusic().ifPresent(effects::backgroundMusic); - vanilla.getAmbientParticle().ifPresent(effects::ambientParticle); - - builder.specialEffects(effects.build()); - - return builder.build(); // build() - } - - public static String createBiomeID(ConfigPack pack, com.dfsek.terra.api.registry.key.RegistryKey biomeID) { - return pack.getID() - .toLowerCase() + "/" + biomeID.getNamespace().toLowerCase(Locale.ROOT) + "/" + biomeID.getID().toLowerCase(Locale.ROOT); - } -} diff --git a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeProvider.java deleted file mode 100644 index 9fb99f13f..000000000 --- a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSBiomeProvider.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_18_R2; - -import com.mojang.serialization.Codec; -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeSource; -import net.minecraft.world.level.biome.Climate.Sampler; -import org.jetbrains.annotations.NotNull; - -import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import com.dfsek.terra.bukkit.world.BukkitPlatformBiome; - - -public class NMSBiomeProvider extends BiomeSource { - private final BiomeProvider delegate; - private final BiomeSource vanilla; - private final long seed; - private final Registry biomeRegistry = Registries.biomeRegistry(); - - public NMSBiomeProvider(BiomeProvider delegate, BiomeSource vanilla, long seed) { - super(delegate.stream() - .map(biome -> Registries.biomeRegistry() - .getOrCreateHolder(((BukkitPlatformBiome) biome.getPlatformBiome()).getContext() - .get(NMSBiomeInfo.class) - .biomeKey()))); - this.delegate = delegate; - this.vanilla = vanilla; - this.seed = seed; - } - - @Override - protected Codec codec() { - return BiomeSource.CODEC; - } - - @Override - public @NotNull BiomeSource withSeed(long seed) { - return new NMSBiomeProvider(delegate, vanilla, seed); - } - - @Override - public @NotNull Holder getNoiseBiome(int x, int y, int z, @NotNull Sampler sampler) { - return biomeRegistry.getOrCreateHolder(((BukkitPlatformBiome) delegate.getBiome(x << 2, y << 2, z << 2, seed).getPlatformBiome()) - .getContext() - .get(NMSBiomeInfo.class) - .biomeKey()); - } -} diff --git a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSChunkGeneratorDelegate.java deleted file mode 100644 index 905867b62..000000000 --- a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSChunkGeneratorDelegate.java +++ /dev/null @@ -1,254 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_18_R2; - -import com.mojang.datafixers.util.Pair; -import com.mojang.serialization.Codec; -import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Holder; -import net.minecraft.core.SectionPos; -import net.minecraft.server.level.WorldGenRegion; -import net.minecraft.world.level.ChunkPos; -import net.minecraft.world.level.LevelHeightAccessor; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.StructureFeatureManager; -import net.minecraft.world.level.WorldGenLevel; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeManager; -import net.minecraft.world.level.biome.Climate; -import net.minecraft.world.level.biome.Climate.Sampler; -import net.minecraft.world.level.chunk.ChunkAccess; -import net.minecraft.world.level.chunk.ChunkGenerator; -import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraft.world.level.levelgen.Heightmap; -import net.minecraft.world.level.levelgen.blending.Blender; -import net.minecraft.world.level.levelgen.structure.StructureSet; -import net.minecraft.world.level.levelgen.structure.placement.ConcentricRingsStructurePlacement; -import net.minecraft.world.level.levelgen.structure.placement.StructurePlacement; -import org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Random; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; -import java.util.stream.Collectors; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.api.util.MathUtil; -import com.dfsek.terra.api.util.generic.Lazy; -import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import com.dfsek.terra.api.world.info.WorldProperties; - - -public class NMSChunkGeneratorDelegate extends ChunkGenerator { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSChunkGeneratorDelegate.class); - private static final Lazy> EMPTY = Lazy.lazy(List::of); - private final NMSBiomeProvider biomeSource; - private final com.dfsek.terra.api.world.chunk.generation.ChunkGenerator delegate; - private final ChunkGenerator vanilla; - private final ConfigPack pack; - private final long seed; - private final Map>> ringPositions = new Object2ObjectArrayMap<>(); - private volatile boolean rings = false; - - public NMSChunkGeneratorDelegate(ChunkGenerator vanilla, ConfigPack pack, NMSBiomeProvider biomeProvider, long seed) { - super(Registries.structureSet(), Optional.empty(), biomeProvider, biomeProvider, seed); - this.delegate = pack.getGeneratorProvider().newInstance(pack); - this.vanilla = vanilla; - this.biomeSource = biomeProvider; - this.pack = pack; - this.seed = seed; - } - - @Override - public void applyCarvers(@NotNull WorldGenRegion chunkRegion, long seed, @NotNull BiomeManager biomeAccess, - @NotNull StructureFeatureManager structureAccessor, - @NotNull ChunkAccess chunk, GenerationStep.@NotNull Carving generationStep) { - // no-op - } - - @Override - public void applyBiomeDecoration(@NotNull WorldGenLevel world, @NotNull ChunkAccess chunk, - @NotNull StructureFeatureManager structureAccessor) { - vanilla.applyBiomeDecoration(world, chunk, structureAccessor); - } - - @Override - public int getSeaLevel() { - return vanilla.getSeaLevel(); - } - - @Override - public @NotNull CompletableFuture fillFromNoise(@NotNull Executor executor, @NotNull Blender blender, - @NotNull StructureFeatureManager structureAccessor, - @NotNull ChunkAccess chunk) { - return vanilla.fillFromNoise(executor, blender, structureAccessor, chunk); - } - - @Override - public void buildSurface(@NotNull WorldGenRegion region, @NotNull StructureFeatureManager structures, @NotNull ChunkAccess chunk) { - // no-op - } - - @Override - protected @NotNull Codec codec() { - return ChunkGenerator.CODEC; - } - - @Override - public @NotNull NoiseColumn getBaseColumn(int x, int z, LevelHeightAccessor height) { - /* - BlockState[] array = new BlockState[height.getHeight()]; - WorldProperties properties = new NMSWorldProperties(seed, height); - BiomeProvider biomeProvider = pack.getBiomeProvider().caching(properties); - for(int y = properties.getMaxHeight() - 1; y >= properties.getMinHeight(); y--) { - array[y - properties.getMinHeight()] = ((CraftBlockData) delegate.getBlock(properties, x, y, z, biomeProvider) - .getHandle()).getState(); - } - return new NoiseColumn(getMinY(), array); - */ - return vanilla.getBaseColumn(x, z, height); - } - - @Override // withSeed - public @NotNull ChunkGenerator withSeed(long seed) { - return new NMSChunkGeneratorDelegate(vanilla, pack, biomeSource, seed); - } - - @Override - public void spawnOriginalMobs(@NotNull WorldGenRegion regionlimitedworldaccess) { - vanilla.spawnOriginalMobs(regionlimitedworldaccess); - } - - @Override - public int getGenDepth() { - return vanilla.getGenDepth(); - } - - @Override - public @NotNull Sampler climateSampler() { - return Climate.empty(); - } - - @Override - public int getMinY() { - return vanilla.getMinY(); - } - - @Override - public int getBaseHeight(int x, int z, Heightmap.@NotNull Types heightmap, @NotNull LevelHeightAccessor world) { - WorldProperties properties = new NMSWorldProperties(seed, world); - int y = properties.getMaxHeight(); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - while(y >= getMinY() && !heightmap.isOpaque().test( - ((CraftBlockData) delegate.getBlock(properties, x, y - 1, z, biomeProvider).getHandle()).getState())) { - y--; - } - return y; - } - - @Nullable - @Override - public List getRingPositionsFor(@NotNull ConcentricRingsStructurePlacement concentricringsstructureplacement) { - ensureStructuresGenerated(); - return ringPositions.getOrDefault(concentricringsstructureplacement, EMPTY).value(); - } - - @Override - public synchronized void ensureStructuresGenerated() { - if(!this.rings) { - super.ensureStructuresGenerated(); - this.populateStrongholdData(); - this.rings = true; - } - } - - private void populateStrongholdData() { - LOGGER.info("Generating safe stronghold data. This may take up to a minute."); - Set> set = this.runtimeBiomeSource.possibleBiomes(); - possibleStructureSets().map(Holder::value).forEach((holder) -> { // we dont need the spigot crap because it doesnt touch concentric. - StructurePlacement structureplacement = holder.placement(); - if(structureplacement instanceof ConcentricRingsStructurePlacement concentricringsstructureplacement) { - if(holder.structures().stream().anyMatch((structureset_a1) -> structureset_a1.generatesInMatchingBiome(set::contains))) { - this.ringPositions.put(concentricringsstructureplacement, - Lazy.lazy(() -> this.generateRingPositions(holder, concentricringsstructureplacement))); - } - } - }); - } - - private List generateRingPositions(StructureSet holder, - ConcentricRingsStructurePlacement concentricringsstructureplacement) { // Spigot - if(concentricringsstructureplacement.count() == 0) { - return List.of(); - } - - List list = new ArrayList<>(); - Set> set = holder - .structures() - .stream() - .flatMap((structureset_a) -> structureset_a.structure().value().biomes().stream()) - .collect(Collectors.toSet()); - int i = concentricringsstructureplacement.distance(); - int j = concentricringsstructureplacement.count(); - int k = concentricringsstructureplacement.spread(); - Random random = new Random(); - - // Paper start - if(this.conf.strongholdSeed != null && this.structureSets.getResourceKey(holder).orElse(null) == - net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS) { - random.setSeed(this.conf.strongholdSeed); - } else { - // Paper end - random.setSeed(this.ringPlacementSeed); - } // Paper - double d0 = random.nextDouble() * 3.141592653589793D * 2.0D; - int l = 0; - int i1 = 0; - - for(int j1 = 0; j1 < j; ++j1) { - double d1 = (double) (4 * i + i * i1 * 6) + (random.nextDouble() - 0.5D) * (double) i * 2.5D; - int k1 = (int) Math.round(MathUtil.cos(d0) * d1); - int l1 = (int) Math.round(MathUtil.sin(d0) * d1); - int i2 = SectionPos.sectionToBlockCoord(k1, 8); - int j2 = SectionPos.sectionToBlockCoord(l1, 8); - - Objects.requireNonNull(set); - Pair> pair = this.biomeSource.findBiomeHorizontal(i2, 0, j2, 112, set::contains, random, - this.climateSampler()); - - if(pair != null) { - BlockPos blockposition = pair.getFirst(); - - k1 = SectionPos.blockToSectionCoord(blockposition.getX()); - l1 = SectionPos.blockToSectionCoord(blockposition.getZ()); - } - - list.add(new ChunkPos(k1, l1)); - d0 += 6.283185307179586D / (double) k; - ++l; - if(l == k) { - ++i1; - l = 0; - k += 2 * k / (i1 + 1); - k = Math.min(k, j - j1); - d0 += random.nextDouble() * 3.141592653589793D * 2.0D; - } - } - - return list; - } - - @Override - public void addDebugScreenInfo(@NotNull List arg0, @NotNull BlockPos arg1) { - - } -} diff --git a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSInitializer.java b/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSInitializer.java deleted file mode 100644 index f724b89f0..000000000 --- a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSInitializer.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_18_R2; - -import org.bukkit.Bukkit; - -import com.dfsek.terra.bukkit.PlatformImpl; -import com.dfsek.terra.bukkit.nms.Initializer; - - -public class NMSInitializer implements Initializer { - @Override - public void initialize(PlatformImpl platform) { - AwfulBukkitHacks.registerBiomes(platform.getRawConfigRegistry()); - Bukkit.getPluginManager().registerEvents(new NMSInjectListener(), platform.getPlugin()); - } -} diff --git a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSInjectListener.java b/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSInjectListener.java deleted file mode 100644 index 9e055524a..000000000 --- a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSInjectListener.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_18_R2; - -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.level.chunk.ChunkGenerator; -import org.bukkit.World; -import org.bukkit.craftbukkit.v1_18_R2.CraftWorld; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.world.WorldInitEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.locks.ReentrantLock; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.bukkit.generator.BukkitChunkGeneratorWrapper; - - -public class NMSInjectListener implements Listener { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSInjectListener.class); - private static final Set INJECTED = new HashSet<>(); - private static final ReentrantLock INJECT_LOCK = new ReentrantLock(); - - @EventHandler - public void onWorldInit(WorldInitEvent event) { - if(!INJECTED.contains(event.getWorld()) && - event.getWorld().getGenerator() instanceof BukkitChunkGeneratorWrapper bukkitChunkGeneratorWrapper) { - INJECT_LOCK.lock(); - INJECTED.add(event.getWorld()); - LOGGER.info("Preparing to take over the world: {}", event.getWorld().getName()); - CraftWorld craftWorld = (CraftWorld) event.getWorld(); - ServerLevel serverWorld = craftWorld.getHandle(); - - ConfigPack pack = bukkitChunkGeneratorWrapper.getPack(); - - ChunkGenerator vanilla = serverWorld.getChunkSource().getGenerator(); - NMSBiomeProvider provider = new NMSBiomeProvider(pack.getBiomeProvider(), vanilla.getBiomeSource(), craftWorld.getSeed()); - NMSChunkGeneratorDelegate custom = new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()); - - custom.conf = vanilla.conf; // world config from Spigot - - serverWorld.getChunkSource().chunkMap.generator = custom; - - LOGGER.info("Successfully injected into world."); - - serverWorld.getChunkSource().chunkMap.generator.ensureStructuresGenerated(); // generate stronghold data now - - INJECT_LOCK.unlock(); - } - } -} diff --git a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSWorldProperties.java b/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSWorldProperties.java deleted file mode 100644 index 875dc0330..000000000 --- a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/NMSWorldProperties.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_18_R2; - -import net.minecraft.world.level.LevelHeightAccessor; - -import com.dfsek.terra.api.world.info.WorldProperties; - - -public class NMSWorldProperties implements WorldProperties { - private final long seed; - private final LevelHeightAccessor height; - - public NMSWorldProperties(long seed, LevelHeightAccessor height) { - this.seed = seed; - this.height = height; - } - - @Override - public Object getHandle() { - return height; - } - - @Override - public long getSeed() { - return seed; - } - - @Override - public int getMaxHeight() { - return height.getMaxBuildHeight(); - } - - @Override - public int getMinHeight() { - return height.getMinBuildHeight(); - } -} diff --git a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/Reflection.java b/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/Reflection.java deleted file mode 100644 index c6e3351a1..000000000 --- a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/Reflection.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_18_R2; - -import net.minecraft.core.MappedRegistry; -import net.minecraft.world.level.biome.Biome; -import xyz.jpenilla.reflectionremapper.ReflectionRemapper; -import xyz.jpenilla.reflectionremapper.proxy.ReflectionProxyFactory; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldGetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldSetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.Proxies; - - -public class Reflection { - public static final MappedRegistryProxy MAPPED_REGISTRY; - public static final BiomeProxy BIOME; - - static { - ReflectionRemapper reflectionRemapper = ReflectionRemapper.forReobfMappingsInPaperJar(); - ReflectionProxyFactory reflectionProxyFactory = ReflectionProxyFactory.create(reflectionRemapper, - Reflection.class.getClassLoader()); - - MAPPED_REGISTRY = reflectionProxyFactory.reflectionProxy(MappedRegistryProxy.class); - BIOME = reflectionProxyFactory.reflectionProxy(BiomeProxy.class); - } - - - @Proxies(MappedRegistry.class) - public interface MappedRegistryProxy { - @FieldSetter("frozen") - void setFrozen(MappedRegistry instance, boolean frozen); - } - - - @Proxies(Biome.class) - public interface BiomeProxy { - @FieldGetter("biomeCategory") - Biome.BiomeCategory getBiomeCategory(Biome instance); - } -} diff --git a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/Registries.java b/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/Registries.java deleted file mode 100644 index 652d77cab..000000000 --- a/platforms/bukkit/nms/v1_18_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_18_R2/Registries.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_18_R2; - -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceKey; -import net.minecraft.server.dedicated.DedicatedServer; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.levelgen.structure.StructureSet; -import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_18_R2.CraftServer; - - -public class Registries { - private static Registry getRegistry(ResourceKey> key) { - CraftServer craftserver = (CraftServer) Bukkit.getServer(); - DedicatedServer dedicatedserver = craftserver.getServer(); - return dedicatedserver - .registryAccess() - .registryOrThrow( // getRegistry - key - ); - } - - public static Registry biomeRegistry() { - return getRegistry(Registry.BIOME_REGISTRY); - } - - public static Registry structureSet() { - return getRegistry(Registry.STRUCTURE_SET_REGISTRY); - } -} diff --git a/platforms/bukkit/nms/v1_19_R1/build.gradle.kts b/platforms/bukkit/nms/v1_19_R1/build.gradle.kts deleted file mode 100644 index 9b301aa70..000000000 --- a/platforms/bukkit/nms/v1_19_R1/build.gradle.kts +++ /dev/null @@ -1,17 +0,0 @@ -apply(plugin = "io.papermc.paperweight.userdev") - -repositories { - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") -} - -dependencies { - api(project(":platforms:bukkit:common")) - paperDevBundle("1.19-R0.1-SNAPSHOT") - implementation("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) -} - -tasks { - assemble { - dependsOn("reobfJar") - } -} diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/AwfulBukkitHacks.java deleted file mode 100644 index 92506d834..000000000 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/AwfulBukkitHacks.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R1; - -import com.google.common.collect.ImmutableMap; -import com.mojang.serialization.Lifecycle; -import net.minecraft.core.Holder; -import net.minecraft.core.MappedRegistry; -import net.minecraft.core.Registry; -import net.minecraft.core.WritableRegistry; -import net.minecraft.data.BuiltinRegistries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.TagKey; -import net.minecraft.world.level.biome.Biome; -import org.bukkit.NamespacedKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import com.dfsek.terra.bukkit.world.BukkitPlatformBiome; -import com.dfsek.terra.registry.master.ConfigRegistry; - - -public class AwfulBukkitHacks { - private static final Logger LOGGER = LoggerFactory.getLogger(AwfulBukkitHacks.class); - - private static final Map> terraBiomeMap = new HashMap<>(); - - public static void registerBiomes(ConfigRegistry configRegistry) { - try { - LOGGER.info("Hacking biome registry..."); - WritableRegistry biomeRegistry = (WritableRegistry) Registries.biomeRegistry(); - - Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry) biomeRegistry, false); - - configRegistry.forEach(pack -> pack.getRegistry(com.dfsek.terra.api.world.biome.Biome.class).forEach((key, biome) -> { - try { - BukkitPlatformBiome platformBiome = (BukkitPlatformBiome) biome.getPlatformBiome(); - NamespacedKey vanillaBukkitKey = platformBiome.getHandle().getKey(); - ResourceLocation vanillaMinecraftKey = new ResourceLocation(vanillaBukkitKey.getNamespace(), vanillaBukkitKey.getKey()); - Biome platform = NMSBiomeInjector.createBiome( - biome, - Objects.requireNonNull(biomeRegistry.get(vanillaMinecraftKey)) // get - ); - - ResourceKey delegateKey = ResourceKey.create(Registry.BIOME_REGISTRY, - new ResourceLocation("terra", - NMSBiomeInjector.createBiomeID(pack, key))); - - BuiltinRegistries.register(BuiltinRegistries.BIOME, delegateKey, platform); - biomeRegistry.register(delegateKey, platform, Lifecycle.stable()); - platformBiome.getContext().put(new NMSBiomeInfo(delegateKey)); - - terraBiomeMap.computeIfAbsent(vanillaMinecraftKey, i -> new ArrayList<>()).add(delegateKey.location()); - - LOGGER.debug("Registered biome: " + delegateKey); - } catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { - throw new RuntimeException(e); - } - })); - - Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry) biomeRegistry, true); // freeze registry again :) - - LOGGER.info("Doing tag garbage...."); - Map, List>> collect = biomeRegistry - .getTags() // streamKeysAndEntries - .collect(HashMap::new, - (map, pair) -> - map.put(pair.getFirst(), new ArrayList<>(pair.getSecond().stream().toList())), - HashMap::putAll); - - terraBiomeMap - .forEach((vb, terraBiomes) -> - NMSBiomeInjector.getEntry(biomeRegistry, vb) - .ifPresentOrElse( - vanilla -> terraBiomes - .forEach(tb -> NMSBiomeInjector.getEntry(biomeRegistry, tb) - .ifPresentOrElse( - terra -> { - LOGGER.debug( - vanilla.unwrapKey() - .orElseThrow() - .location() + - " (vanilla for " + - terra.unwrapKey() - .orElseThrow() - .location() + - ": " + - vanilla.tags() - .toList()); - - vanilla.tags() - .forEach( - tag -> collect - .computeIfAbsent( - tag, - t -> new ArrayList<>()) - .add(terra)); - }, - () -> LOGGER.error( - "No such biome: {}", - tb))), - () -> LOGGER.error("No vanilla biome: {}", vb))); - - biomeRegistry.resetTags(); - biomeRegistry.bindTags(ImmutableMap.copyOf(collect)); - - } catch(SecurityException | IllegalArgumentException exception) { - throw new RuntimeException(exception); - } - } -} diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInfo.java deleted file mode 100644 index 02e67dc8d..000000000 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInfo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R1; - -import com.dfsek.terra.api.properties.Properties; - -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.level.biome.Biome; - - -public record NMSBiomeInfo(ResourceKey biomeKey) implements Properties { -} diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInjector.java deleted file mode 100644 index 39a66e468..000000000 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeInjector.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R1; - -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeSpecialEffects; - -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.bukkit.config.VanillaBiomeProperties; - - -public class NMSBiomeInjector { - - public static Optional> getEntry(Registry registry, ResourceLocation identifier) { - return registry.getOptional(identifier) - .flatMap(registry::getResourceKey) - .map(registry::getOrCreateHolderOrThrow); - } - - public static Biome createBiome(com.dfsek.terra.api.world.biome.Biome biome, Biome vanilla) - throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - Biome.BiomeBuilder builder = new Biome.BiomeBuilder(); - - builder - .precipitation(vanilla.getPrecipitation()) - .downfall(vanilla.getDownfall()) - .temperature(vanilla.getBaseTemperature()) - .mobSpawnSettings(vanilla.getMobSettings()) - .generationSettings(vanilla.getGenerationSettings()); - - - BiomeSpecialEffects.Builder effects = new BiomeSpecialEffects.Builder(); - - effects.grassColorModifier(vanilla.getSpecialEffects().getGrassColorModifier()); - - VanillaBiomeProperties vanillaBiomeProperties = biome.getContext().get(VanillaBiomeProperties.class); - - effects.fogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getFogColor(), vanilla.getFogColor())) - - .waterColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterColor(), vanilla.getWaterColor())) - - .waterFogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterFogColor(), vanilla.getWaterFogColor())) - - .skyColor(Objects.requireNonNullElse(vanillaBiomeProperties.getSkyColor(), vanilla.getSkyColor())); - - if(vanillaBiomeProperties.getFoliageColor() == null) { - vanilla.getSpecialEffects().getFoliageColorOverride().ifPresent(effects::foliageColorOverride); - } else { - effects.foliageColorOverride(vanillaBiomeProperties.getFoliageColor()); - } - - if(vanillaBiomeProperties.getGrassColor() == null) { - vanilla.getSpecialEffects().getGrassColorOverride().ifPresent(effects::grassColorOverride); - } else { - // grass - effects.grassColorOverride(vanillaBiomeProperties.getGrassColor()); - } - - vanilla.getAmbientLoop().ifPresent(effects::ambientLoopSound); - vanilla.getAmbientAdditions().ifPresent(effects::ambientAdditionsSound); - vanilla.getAmbientMood().ifPresent(effects::ambientMoodSound); - vanilla.getBackgroundMusic().ifPresent(effects::backgroundMusic); - vanilla.getAmbientParticle().ifPresent(effects::ambientParticle); - - builder.specialEffects(effects.build()); - - return builder.build(); - } - - public static String createBiomeID(ConfigPack pack, com.dfsek.terra.api.registry.key.RegistryKey biomeID) { - return pack.getID() - .toLowerCase() + "/" + biomeID.getNamespace().toLowerCase(Locale.ROOT) + "/" + biomeID.getID().toLowerCase(Locale.ROOT); - } -} diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeProvider.java deleted file mode 100644 index ee7a05443..000000000 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSBiomeProvider.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R1; - -import com.mojang.serialization.Codec; -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeSource; -import net.minecraft.world.level.biome.Climate.Sampler; -import org.jetbrains.annotations.NotNull; - -import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import com.dfsek.terra.bukkit.world.BukkitPlatformBiome; - - -public class NMSBiomeProvider extends BiomeSource { - private final BiomeProvider delegate; - private final long seed; - private final Registry biomeRegistry = Registries.biomeRegistry(); - - public NMSBiomeProvider(BiomeProvider delegate, long seed) { - super(delegate.stream() - .map(biome -> Registries.biomeRegistry() - .getHolderOrThrow(((BukkitPlatformBiome) biome.getPlatformBiome()).getContext() - .get(NMSBiomeInfo.class) - .biomeKey()))); - this.delegate = delegate; - this.seed = seed; - } - - @Override - protected @NotNull Codec codec() { - return BiomeSource.CODEC; - } - - @Override - public @NotNull Holder getNoiseBiome(int x, int y, int z, @NotNull Sampler sampler) { - return biomeRegistry.getHolderOrThrow(((BukkitPlatformBiome) delegate.getBiome(x << 2, y << 2, z << 2, seed) - .getPlatformBiome()).getContext() - .get(NMSBiomeInfo.class) - .biomeKey()); - } -} diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSChunkGeneratorDelegate.java deleted file mode 100644 index 6e374ff8b..000000000 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSChunkGeneratorDelegate.java +++ /dev/null @@ -1,291 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R1; - -import com.mojang.datafixers.util.Pair; -import com.mojang.serialization.Codec; -import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Holder; -import net.minecraft.core.HolderSet; -import net.minecraft.core.SectionPos; -import net.minecraft.server.level.WorldGenRegion; -import net.minecraft.util.RandomSource; -import net.minecraft.world.level.ChunkPos; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.LevelHeightAccessor; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.StructureManager; -import net.minecraft.world.level.WorldGenLevel; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeManager; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.chunk.ChunkAccess; -import net.minecraft.world.level.chunk.ChunkGenerator; -import net.minecraft.world.level.levelgen.Beardifier; -import net.minecraft.world.level.levelgen.DensityFunction.SinglePointContext; -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; -import net.minecraft.world.level.levelgen.structure.Structure; -import net.minecraft.world.level.levelgen.structure.StructureSet; -import net.minecraft.world.level.levelgen.structure.StructureSet.StructureSelectionEntry; -import net.minecraft.world.level.levelgen.structure.placement.ConcentricRingsStructurePlacement; -import org.bukkit.craftbukkit.v1_19_R1.block.data.CraftBlockData; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; -import java.util.stream.Stream; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.api.util.MathUtil; -import com.dfsek.terra.api.util.generic.Lazy; -import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import com.dfsek.terra.api.world.info.WorldProperties; -import com.dfsek.terra.bukkit.config.PreLoadCompatibilityOptions; -import com.dfsek.terra.bukkit.world.BukkitWorldProperties; -import com.dfsek.terra.bukkit.world.block.data.BukkitBlockState; - - -public class NMSChunkGeneratorDelegate extends ChunkGenerator { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSChunkGeneratorDelegate.class); - private final com.dfsek.terra.api.world.chunk.generation.ChunkGenerator delegate; - - private final ChunkGenerator vanilla; - private final ConfigPack pack; - - private final long seed; - private final Map>> ringPositions = new Object2ObjectArrayMap<>(); - private volatile boolean rings = false; - - public NMSChunkGeneratorDelegate(ChunkGenerator vanilla, ConfigPack pack, NMSBiomeProvider biomeProvider, long seed) { - super(Registries.structureSet(), Optional.empty(), biomeProvider); - this.delegate = pack.getGeneratorProvider().newInstance(pack); - this.vanilla = vanilla; - this.pack = pack; - this.seed = seed; - } - - @Override - protected @NotNull Codec codec() { - return ChunkGenerator.CODEC; - } - - @Override - public void applyCarvers(@NotNull WorldGenRegion chunkRegion, long seed, @NotNull RandomState noiseConfig, @NotNull BiomeManager world, - @NotNull StructureManager structureAccessor, @NotNull ChunkAccess chunk, @NotNull Carving carverStep) { - // no-op - } - - @Override - public void buildSurface(@NotNull WorldGenRegion region, @NotNull StructureManager structures, @NotNull RandomState noiseConfig, - @NotNull ChunkAccess chunk) { - // no-op - } - - @Override - public void applyBiomeDecoration(@NotNull WorldGenLevel world, @NotNull ChunkAccess chunk, - @NotNull StructureManager structureAccessor) { - vanilla.applyBiomeDecoration(world, chunk, structureAccessor); - } - - @Override - public void spawnOriginalMobs(@NotNull WorldGenRegion region) { - vanilla.spawnOriginalMobs(region); - } - - @Override - public int getGenDepth() { - return vanilla.getGenDepth(); - } - - @Override - public @NotNull CompletableFuture fillFromNoise(@NotNull Executor executor, @NotNull Blender blender, - @NotNull RandomState noiseConfig, - @NotNull StructureManager structureAccessor, @NotNull ChunkAccess chunk) { - return vanilla.fillFromNoise(executor, blender, noiseConfig, structureAccessor, chunk) - .thenApply(c -> { - LevelAccessor level = Reflection.STRUCTURE_MANAGER.getLevel(structureAccessor); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - PreLoadCompatibilityOptions compatibilityOptions = pack.getContext().get(PreLoadCompatibilityOptions.class); - if(compatibilityOptions.isBeard()) { - beard(structureAccessor, chunk, new BukkitWorldProperties(level.getMinecraftWorld().getWorld()), - biomeProvider, compatibilityOptions); - } - return c; - }); - } - - private void beard(StructureManager structureAccessor, ChunkAccess chunk, WorldProperties world, BiomeProvider biomeProvider, - PreLoadCompatibilityOptions compatibilityOptions) { - Beardifier structureWeightSampler = Beardifier.forStructuresInChunk(structureAccessor, chunk.getPos()); - double threshold = compatibilityOptions.getBeardThreshold(); - double airThreshold = compatibilityOptions.getAirThreshold(); - int xi = chunk.getPos().x << 4; - int zi = chunk.getPos().z << 4; - for(int x = 0; x < 16; x++) { - for(int z = 0; z < 16; z++) { - int depth = 0; - for(int y = world.getMaxHeight(); y >= world.getMinHeight(); y--) { - double noise = structureWeightSampler.compute(new SinglePointContext(x + xi, y, z + zi)); - if(noise > threshold) { - chunk.setBlockState(new BlockPos(x, y, z), ((CraftBlockData) ((BukkitBlockState) delegate - .getPalette(x + xi, y, z + zi, world, biomeProvider) - .get(depth, x + xi, y, z + zi, world.getSeed())).getHandle()).getState(), false); - depth++; - } else if(noise < airThreshold) { - chunk.setBlockState(new BlockPos(x, y, z), Blocks.AIR.defaultBlockState(), false); - } else { - depth = 0; - } - } - } - } - } - - @Override - public int getSeaLevel() { - return vanilla.getSeaLevel(); - } - - @Override - public int getMinY() { - return vanilla.getMinY(); - } - - @Override - public int getBaseHeight(int x, int z, @NotNull Types heightmap, @NotNull LevelHeightAccessor world, @NotNull RandomState noiseConfig) { - WorldProperties properties = new NMSWorldProperties(seed, world); - int y = properties.getMaxHeight(); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - while(y >= getMinY() && !heightmap.isOpaque().test( - ((CraftBlockData) delegate.getBlock(properties, x, y - 1, z, biomeProvider).getHandle()).getState())) { - y--; - } - return y; - } - - @Override - public @NotNull NoiseColumn getBaseColumn(int x, int z, @NotNull LevelHeightAccessor world, @NotNull RandomState noiseConfig) { - /* - BlockState[] array = new BlockState[world.getHeight()]; - WorldProperties properties = new NMSWorldProperties(seed, world); - BiomeProvider biomeProvider = pack.getBiomeProvider().caching(properties); - for(int y = properties.getMaxHeight() - 1; y >= properties.getMinHeight(); y--) { - array[y - properties.getMinHeight()] = ((CraftBlockData) delegate.getBlock(properties, x, y, z, biomeProvider) - .getHandle()).getState(); - } - return new NoiseColumn(getMinY(), array); - - */ - return vanilla.getBaseColumn(x, z, world, noiseConfig); - } - - @Override - public void addDebugScreenInfo(@NotNull List text, @NotNull RandomState noiseConfig, @NotNull BlockPos pos) { - - } - - @Override - public void ensureStructuresGenerated(@NotNull RandomState noiseConfig) { - if(!this.rings) { - super.ensureStructuresGenerated(noiseConfig); - this.populateStrongholdData(noiseConfig); - this.rings = true; - } - - } - - @Override - public List getRingPositionsFor(@NotNull ConcentricRingsStructurePlacement structurePlacement, - @NotNull RandomState noiseConfig) { - ensureStructuresGenerated(noiseConfig); - return ringPositions.get(structurePlacement).value(); - } - - private void populateStrongholdData(RandomState noiseConfig) { - LOGGER.info("Generating safe stronghold data. This may take up to a minute."); - Set> set = this.biomeSource.possibleBiomes(); - possibleStructureSets().map(Holder::value).forEach((holder) -> { - boolean match = false; - for(StructureSelectionEntry structureset_a : holder.structures()) { - Structure structure = structureset_a.structure().value(); - Stream> stream = structure.biomes().stream(); - if(stream.anyMatch(set::contains)) { - match = true; - } - } - - if(match) { - if(holder.placement() instanceof ConcentricRingsStructurePlacement concentricringsstructureplacement) { - this.ringPositions.put(concentricringsstructureplacement, Lazy.lazy( - () -> this.generateRingPositions(holder, noiseConfig, concentricringsstructureplacement))); - } - } - }); - } - - private List generateRingPositions(StructureSet holder, RandomState randomstate, - ConcentricRingsStructurePlacement concentricringsstructureplacement) { // Spigot - if(concentricringsstructureplacement.count() == 0) { - return List.of(); - } - - List list = new ArrayList<>(); - int i = concentricringsstructureplacement.distance(); - int j = concentricringsstructureplacement.count(); - int k = concentricringsstructureplacement.spread(); - HolderSet holderset = concentricringsstructureplacement.preferredBiomes(); - RandomSource randomsource = RandomSource.create(); - - if(this.conf.strongholdSeed != null && this.structureSets.getResourceKey(holder).orElse(null) == - net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS) { - randomsource.setSeed(this.conf.strongholdSeed); - } else { - randomsource.setSeed(randomstate.legacyLevelSeed()); - } - double d0 = randomsource.nextDouble() * 3.141592653589793D * 2.0D; - int l = 0; - int i1 = 0; - - for(int j1 = 0; j1 < j; ++j1) { - double d1 = (double) (4 * i + i * i1 * 6) + (randomsource.nextDouble() - 0.5D) * (double) i * 2.5D; - int k1 = (int) Math.round(MathUtil.cos(d0) * d1); - int l1 = (int) Math.round(MathUtil.sin(d0) * d1); - int i2 = SectionPos.sectionToBlockCoord(k1, 8); - int j2 = SectionPos.sectionToBlockCoord(l1, 8); - - Objects.requireNonNull(holderset); - Pair> pair = this.biomeSource.findBiomeHorizontal(i2, 0, j2, 112, holderset::contains, randomsource, - randomstate.sampler()); - - if(pair != null) { - BlockPos blockposition = pair.getFirst(); - - k1 = SectionPos.blockToSectionCoord(blockposition.getX()); - l1 = SectionPos.blockToSectionCoord(blockposition.getZ()); - } - - list.add(new ChunkPos(k1, l1)); - d0 += 6.283185307179586D / (double) k; - ++l; - if(l == k) { - ++i1; - l = 0; - k += 2 * k / (i1 + 1); - k = Math.min(k, j - j1); - d0 += randomsource.nextDouble() * 3.141592653589793D * 2.0D; - } - } - - return list; - } -} diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSInitializer.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSInitializer.java deleted file mode 100644 index 82a293cd1..000000000 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSInitializer.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R1; - -import org.bukkit.Bukkit; - -import com.dfsek.terra.bukkit.PlatformImpl; -import com.dfsek.terra.bukkit.nms.Initializer; - - -public class NMSInitializer implements Initializer { - @Override - public void initialize(PlatformImpl platform) { - AwfulBukkitHacks.registerBiomes(platform.getRawConfigRegistry()); - Bukkit.getPluginManager().registerEvents(new NMSInjectListener(), platform.getPlugin()); - } -} diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSInjectListener.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSInjectListener.java deleted file mode 100644 index 0f11f700d..000000000 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSInjectListener.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R1; - -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.level.chunk.ChunkGenerator; -import org.bukkit.World; -import org.bukkit.craftbukkit.v1_19_R1.CraftWorld; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.world.WorldInitEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.locks.ReentrantLock; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.bukkit.generator.BukkitChunkGeneratorWrapper; - - -public class NMSInjectListener implements Listener { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSInjectListener.class); - private static final Set INJECTED = new HashSet<>(); - private static final ReentrantLock INJECT_LOCK = new ReentrantLock(); - - @EventHandler - public void onWorldInit(WorldInitEvent event) { - if(!INJECTED.contains(event.getWorld()) && - event.getWorld().getGenerator() instanceof BukkitChunkGeneratorWrapper bukkitChunkGeneratorWrapper) { - INJECT_LOCK.lock(); - INJECTED.add(event.getWorld()); - LOGGER.info("Preparing to take over the world: {}", event.getWorld().getName()); - CraftWorld craftWorld = (CraftWorld) event.getWorld(); - ServerLevel serverWorld = craftWorld.getHandle(); - - ConfigPack pack = bukkitChunkGeneratorWrapper.getPack(); - - ChunkGenerator vanilla = serverWorld.getChunkSource().getGenerator(); - NMSBiomeProvider provider = new NMSBiomeProvider(pack.getBiomeProvider(), craftWorld.getSeed()); - NMSChunkGeneratorDelegate custom = new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()); - - custom.conf = vanilla.conf; // world config from Spigot - - serverWorld.getChunkSource().chunkMap.generator = custom; - - LOGGER.info("Successfully injected into world."); - - INJECT_LOCK.unlock(); - } - } -} diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSWorldProperties.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSWorldProperties.java deleted file mode 100644 index 9348ca047..000000000 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/NMSWorldProperties.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R1; - -import net.minecraft.world.level.LevelHeightAccessor; - -import com.dfsek.terra.api.world.info.WorldProperties; - - -public class NMSWorldProperties implements WorldProperties { - private final long seed; - private final LevelHeightAccessor height; - - public NMSWorldProperties(long seed, LevelHeightAccessor height) { - this.seed = seed; - this.height = height; - } - - @Override - public Object getHandle() { - return height; - } - - @Override - public long getSeed() { - return seed; - } - - @Override - public int getMaxHeight() { - return height.getMaxBuildHeight(); - } - - @Override - public int getMinHeight() { - return height.getMinBuildHeight(); - } -} diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/Reflection.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/Reflection.java deleted file mode 100644 index 84263a667..000000000 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/Reflection.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R1; - -import net.minecraft.core.MappedRegistry; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.StructureManager; -import xyz.jpenilla.reflectionremapper.ReflectionRemapper; -import xyz.jpenilla.reflectionremapper.proxy.ReflectionProxyFactory; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldGetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldSetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.Proxies; - - -public class Reflection { - public static final MappedRegistryProxy MAPPED_REGISTRY; - public static final StructureManagerProxy STRUCTURE_MANAGER; - - static { - ReflectionRemapper reflectionRemapper = ReflectionRemapper.forReobfMappingsInPaperJar(); - ReflectionProxyFactory reflectionProxyFactory = ReflectionProxyFactory.create(reflectionRemapper, - Reflection.class.getClassLoader()); - - MAPPED_REGISTRY = reflectionProxyFactory.reflectionProxy(MappedRegistryProxy.class); - STRUCTURE_MANAGER = reflectionProxyFactory.reflectionProxy(StructureManagerProxy.class); - } - - - @Proxies(MappedRegistry.class) - public interface MappedRegistryProxy { - @FieldSetter("frozen") - void setFrozen(MappedRegistry instance, boolean frozen); - } - - - @Proxies(StructureManager.class) - public interface StructureManagerProxy { - @FieldGetter("level") - LevelAccessor getLevel(StructureManager instance); - } -} diff --git a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/Registries.java b/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/Registries.java deleted file mode 100644 index 1ff964106..000000000 --- a/platforms/bukkit/nms/v1_19_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R1/Registries.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R1; - -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceKey; -import net.minecraft.server.dedicated.DedicatedServer; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.levelgen.structure.StructureSet; -import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_19_R1.CraftServer; - - -public class Registries { - private static Registry getRegistry(ResourceKey> key) { - CraftServer craftserver = (CraftServer) Bukkit.getServer(); - DedicatedServer dedicatedserver = craftserver.getServer(); - return dedicatedserver - .registryAccess() - .registryOrThrow( // getRegistry - key - ); - } - - public static Registry biomeRegistry() { - return getRegistry(Registry.BIOME_REGISTRY); - } - - public static Registry structureSet() { - return getRegistry(Registry.STRUCTURE_SET_REGISTRY); - } -} diff --git a/platforms/bukkit/nms/v1_19_R2/build.gradle.kts b/platforms/bukkit/nms/v1_19_R2/build.gradle.kts deleted file mode 100644 index c6f6d8205..000000000 --- a/platforms/bukkit/nms/v1_19_R2/build.gradle.kts +++ /dev/null @@ -1,17 +0,0 @@ -apply(plugin = "io.papermc.paperweight.userdev") - -repositories { - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") -} - -dependencies { - api(project(":platforms:bukkit:common")) - paperDevBundle("1.19.3-R0.1-SNAPSHOT") - implementation("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) -} - -tasks { - assemble { - dependsOn("reobfJar") - } -} \ No newline at end of file diff --git a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/AwfulBukkitHacks.java deleted file mode 100644 index 725f2fb1a..000000000 --- a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/AwfulBukkitHacks.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R2; - -import com.google.common.collect.ImmutableMap; -import com.mojang.serialization.Lifecycle; -import net.minecraft.core.Holder; -import net.minecraft.core.Holder.Reference; -import net.minecraft.core.MappedRegistry; -import net.minecraft.core.WritableRegistry; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.TagKey; -import net.minecraft.world.level.biome.Biome; -import org.bukkit.NamespacedKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import com.dfsek.terra.bukkit.world.BukkitPlatformBiome; -import com.dfsek.terra.registry.master.ConfigRegistry; - - -public class AwfulBukkitHacks { - private static final Logger LOGGER = LoggerFactory.getLogger(AwfulBukkitHacks.class); - - private static final Map> terraBiomeMap = new HashMap<>(); - - public static void registerBiomes(ConfigRegistry configRegistry) { - try { - LOGGER.info("Hacking biome registry..."); - WritableRegistry biomeRegistry = (WritableRegistry) RegistryFetcher.biomeRegistry(); - - Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry) biomeRegistry, false); - - configRegistry.forEach(pack -> pack.getRegistry(com.dfsek.terra.api.world.biome.Biome.class).forEach((key, biome) -> { - try { - BukkitPlatformBiome platformBiome = (BukkitPlatformBiome) biome.getPlatformBiome(); - NamespacedKey vanillaBukkitKey = platformBiome.getHandle().getKey(); - ResourceLocation vanillaMinecraftKey = new ResourceLocation(vanillaBukkitKey.getNamespace(), vanillaBukkitKey.getKey()); - Biome platform = NMSBiomeInjector.createBiome(biome, Objects.requireNonNull(biomeRegistry.get(vanillaMinecraftKey))); - - ResourceKey delegateKey = ResourceKey.create( - Registries.BIOME, - new ResourceLocation("terra", NMSBiomeInjector.createBiomeID(pack, key)) - ); - - Reference holder = biomeRegistry.register(delegateKey, platform, Lifecycle.stable()); - Reflection.REFERENCE.invokeBindValue(holder, platform); // IMPORTANT: bind holder. - - platformBiome.getContext().put(new NMSBiomeInfo(delegateKey)); - - terraBiomeMap.computeIfAbsent(vanillaMinecraftKey, i -> new ArrayList<>()).add(delegateKey.location()); - - LOGGER.debug("Registered biome: " + delegateKey); - } catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { - throw new RuntimeException(e); - } - })); - - Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry) biomeRegistry, true); // freeze registry again :) - - LOGGER.info("Doing tag garbage...."); - Map, List>> collect = biomeRegistry - .getTags() // streamKeysAndEntries - .collect(HashMap::new, - (map, pair) -> - map.put(pair.getFirst(), new ArrayList<>(pair.getSecond().stream().toList())), - HashMap::putAll); - - terraBiomeMap - .forEach((vb, terraBiomes) -> - NMSBiomeInjector.getEntry(biomeRegistry, vb).ifPresentOrElse( - vanilla -> terraBiomes.forEach( - tb -> NMSBiomeInjector.getEntry(biomeRegistry, tb).ifPresentOrElse( - terra -> { - LOGGER.debug("{} (vanilla for {}): {}", - vanilla.unwrapKey().orElseThrow().location(), - terra.unwrapKey().orElseThrow().location(), - vanilla.tags().toList()); - vanilla.tags() - .forEach(tag -> collect - .computeIfAbsent(tag, t -> new ArrayList<>()) - .add(terra)); - }, - () -> LOGGER.error("No such biome: {}", tb))), - () -> LOGGER.error("No vanilla biome: {}", vb))); - - biomeRegistry.resetTags(); - biomeRegistry.bindTags(ImmutableMap.copyOf(collect)); - - } catch(SecurityException | IllegalArgumentException exception) { - throw new RuntimeException(exception); - } - } -} diff --git a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeInfo.java deleted file mode 100644 index 639c9eaed..000000000 --- a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeInfo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R2; - -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.level.biome.Biome; - -import com.dfsek.terra.api.properties.Properties; - - -public record NMSBiomeInfo(ResourceKey biomeKey) implements Properties { -} diff --git a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeInjector.java deleted file mode 100644 index 0b8c36a50..000000000 --- a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeInjector.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R2; - -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeSpecialEffects; - -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.bukkit.config.VanillaBiomeProperties; - - -public class NMSBiomeInjector { - - public static Optional> getEntry(Registry registry, ResourceLocation identifier) { - return registry.getOptional(identifier) - .flatMap(registry::getResourceKey) - .flatMap(registry::getHolder); - } - - public static Biome createBiome(com.dfsek.terra.api.world.biome.Biome biome, Biome vanilla) - throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - Biome.BiomeBuilder builder = new Biome.BiomeBuilder(); - - builder - .precipitation(vanilla.getPrecipitation()) - .downfall(vanilla.getDownfall()) - .temperature(vanilla.getBaseTemperature()) - .mobSpawnSettings(vanilla.getMobSettings()) - .generationSettings(vanilla.getGenerationSettings()); - - - BiomeSpecialEffects.Builder effects = new BiomeSpecialEffects.Builder(); - - effects.grassColorModifier(vanilla.getSpecialEffects().getGrassColorModifier()); - - VanillaBiomeProperties vanillaBiomeProperties = biome.getContext().get(VanillaBiomeProperties.class); - - effects.fogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getFogColor(), vanilla.getFogColor())) - - .waterColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterColor(), vanilla.getWaterColor())) - - .waterFogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterFogColor(), vanilla.getWaterFogColor())) - - .skyColor(Objects.requireNonNullElse(vanillaBiomeProperties.getSkyColor(), vanilla.getSkyColor())); - - if(vanillaBiomeProperties.getFoliageColor() == null) { - vanilla.getSpecialEffects().getFoliageColorOverride().ifPresent(effects::foliageColorOverride); - } else { - effects.foliageColorOverride(vanillaBiomeProperties.getFoliageColor()); - } - - if(vanillaBiomeProperties.getGrassColor() == null) { - vanilla.getSpecialEffects().getGrassColorOverride().ifPresent(effects::grassColorOverride); - } else { - // grass - effects.grassColorOverride(vanillaBiomeProperties.getGrassColor()); - } - - vanilla.getAmbientLoop().ifPresent(effects::ambientLoopSound); - vanilla.getAmbientAdditions().ifPresent(effects::ambientAdditionsSound); - vanilla.getAmbientMood().ifPresent(effects::ambientMoodSound); - vanilla.getBackgroundMusic().ifPresent(effects::backgroundMusic); - vanilla.getAmbientParticle().ifPresent(effects::ambientParticle); - - builder.specialEffects(effects.build()); - - return builder.build(); - } - - public static String createBiomeID(ConfigPack pack, com.dfsek.terra.api.registry.key.RegistryKey biomeID) { - return pack.getID() - .toLowerCase() + "/" + biomeID.getNamespace().toLowerCase(Locale.ROOT) + "/" + biomeID.getID().toLowerCase(Locale.ROOT); - } -} diff --git a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeProvider.java deleted file mode 100644 index 4e4b9f1c5..000000000 --- a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSBiomeProvider.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R2; - -import com.mojang.serialization.Codec; -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeSource; -import net.minecraft.world.level.biome.Climate.Sampler; -import org.jetbrains.annotations.NotNull; - -import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import com.dfsek.terra.bukkit.world.BukkitPlatformBiome; - - -public class NMSBiomeProvider extends BiomeSource { - private final BiomeProvider delegate; - private final long seed; - private final Registry biomeRegistry = RegistryFetcher.biomeRegistry(); - - public NMSBiomeProvider(BiomeProvider delegate, long seed) { - super(delegate.stream() - .map(biome -> RegistryFetcher.biomeRegistry() - .getHolderOrThrow(((BukkitPlatformBiome) biome.getPlatformBiome()).getContext() - .get(NMSBiomeInfo.class) - .biomeKey()))); - this.delegate = delegate; - this.seed = seed; - } - - @Override - protected @NotNull Codec codec() { - return BiomeSource.CODEC; - } - - @Override - public @NotNull Holder getNoiseBiome(int x, int y, int z, @NotNull Sampler sampler) { - return biomeRegistry.getHolderOrThrow(((BukkitPlatformBiome) delegate.getBiome(x << 2, y << 2, z << 2, seed) - .getPlatformBiome()).getContext() - .get(NMSBiomeInfo.class) - .biomeKey()); - } -} diff --git a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSChunkGeneratorDelegate.java deleted file mode 100644 index 9059326ca..000000000 --- a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSChunkGeneratorDelegate.java +++ /dev/null @@ -1,174 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R2; - -import com.mojang.serialization.Codec; -import net.minecraft.core.BlockPos; -import net.minecraft.server.level.WorldGenRegion; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.LevelHeightAccessor; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.StructureManager; -import net.minecraft.world.level.WorldGenLevel; -import net.minecraft.world.level.biome.BiomeManager; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.chunk.ChunkAccess; -import net.minecraft.world.level.chunk.ChunkGenerator; -import net.minecraft.world.level.levelgen.Beardifier; -import net.minecraft.world.level.levelgen.DensityFunction.SinglePointContext; -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; -import org.bukkit.craftbukkit.v1_19_R2.block.data.CraftBlockData; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import com.dfsek.terra.api.world.info.WorldProperties; -import com.dfsek.terra.bukkit.config.PreLoadCompatibilityOptions; -import com.dfsek.terra.bukkit.world.BukkitWorldProperties; -import com.dfsek.terra.bukkit.world.block.data.BukkitBlockState; - - -public class NMSChunkGeneratorDelegate extends ChunkGenerator { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSChunkGeneratorDelegate.class); - private final com.dfsek.terra.api.world.chunk.generation.ChunkGenerator delegate; - - private final ChunkGenerator vanilla; - private final ConfigPack pack; - - private final long seed; - - public NMSChunkGeneratorDelegate(ChunkGenerator vanilla, ConfigPack pack, NMSBiomeProvider biomeProvider, long seed) { - super(biomeProvider); - this.delegate = pack.getGeneratorProvider().newInstance(pack); - this.vanilla = vanilla; - this.pack = pack; - this.seed = seed; - } - - @Override - protected @NotNull Codec codec() { - return ChunkGenerator.CODEC; - } - - @Override - public void applyCarvers(@NotNull WorldGenRegion chunkRegion, long seed, @NotNull RandomState noiseConfig, @NotNull BiomeManager world, - @NotNull StructureManager structureAccessor, @NotNull ChunkAccess chunk, @NotNull Carving carverStep) { - // no-op - } - - @Override - public void buildSurface(@NotNull WorldGenRegion region, @NotNull StructureManager structures, @NotNull RandomState noiseConfig, - @NotNull ChunkAccess chunk) { - // no-op - } - - @Override - public void applyBiomeDecoration(@NotNull WorldGenLevel world, @NotNull ChunkAccess chunk, - @NotNull StructureManager structureAccessor) { - vanilla.applyBiomeDecoration(world, chunk, structureAccessor); - } - - @Override - public void spawnOriginalMobs(@NotNull WorldGenRegion region) { - vanilla.spawnOriginalMobs(region); - } - - @Override - public int getGenDepth() { - return vanilla.getGenDepth(); - } - - @Override - public @NotNull CompletableFuture fillFromNoise(@NotNull Executor executor, @NotNull Blender blender, - @NotNull RandomState noiseConfig, - @NotNull StructureManager structureAccessor, @NotNull ChunkAccess chunk) { - return vanilla.fillFromNoise(executor, blender, noiseConfig, structureAccessor, chunk) - .thenApply(c -> { - LevelAccessor level = Reflection.STRUCTURE_MANAGER.getLevel(structureAccessor); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - PreLoadCompatibilityOptions compatibilityOptions = pack.getContext().get(PreLoadCompatibilityOptions.class); - if(compatibilityOptions.isBeard()) { - beard(structureAccessor, chunk, new BukkitWorldProperties(level.getMinecraftWorld().getWorld()), - biomeProvider, compatibilityOptions); - } - return c; - }); - } - - private void beard(StructureManager structureAccessor, ChunkAccess chunk, WorldProperties world, BiomeProvider biomeProvider, - PreLoadCompatibilityOptions compatibilityOptions) { - Beardifier structureWeightSampler = Beardifier.forStructuresInChunk(structureAccessor, chunk.getPos()); - double threshold = compatibilityOptions.getBeardThreshold(); - double airThreshold = compatibilityOptions.getAirThreshold(); - int xi = chunk.getPos().x << 4; - int zi = chunk.getPos().z << 4; - for(int x = 0; x < 16; x++) { - for(int z = 0; z < 16; z++) { - int depth = 0; - for(int y = world.getMaxHeight(); y >= world.getMinHeight(); y--) { - double noise = structureWeightSampler.compute(new SinglePointContext(x + xi, y, z + zi)); - if(noise > threshold) { - chunk.setBlockState(new BlockPos(x, y, z), ((CraftBlockData) ((BukkitBlockState) delegate - .getPalette(x + xi, y, z + zi, world, biomeProvider) - .get(depth, x + xi, y, z + zi, world.getSeed())).getHandle()).getState(), false); - depth++; - } else if(noise < airThreshold) { - chunk.setBlockState(new BlockPos(x, y, z), Blocks.AIR.defaultBlockState(), false); - } else { - depth = 0; - } - } - } - } - } - - @Override - public int getSeaLevel() { - return vanilla.getSeaLevel(); - } - - @Override - public int getMinY() { - return vanilla.getMinY(); - } - - @Override - public int getBaseHeight(int x, int z, @NotNull Types heightmap, @NotNull LevelHeightAccessor world, @NotNull RandomState noiseConfig) { - WorldProperties properties = new NMSWorldProperties(seed, world); - int y = properties.getMaxHeight(); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - while(y >= getMinY() && !heightmap.isOpaque().test( - ((CraftBlockData) delegate.getBlock(properties, x, y - 1, z, biomeProvider).getHandle()).getState())) { - y--; - } - return y; - } - - @Override - public @NotNull NoiseColumn getBaseColumn(int x, int z, @NotNull LevelHeightAccessor world, @NotNull RandomState noiseConfig) { - /* - BlockState[] array = new BlockState[world.getHeight()]; - WorldProperties properties = new NMSWorldProperties(seed, world); - BiomeProvider biomeProvider = pack.getBiomeProvider().caching(properties); - for(int y = properties.getMaxHeight() - 1; y >= properties.getMinHeight(); y--) { - array[y - properties.getMinHeight()] = ((CraftBlockData) delegate.getBlock(properties, x, y, z, biomeProvider) - .getHandle()).getState(); - } - return new NoiseColumn(getMinY(), array); - - */ - return vanilla.getBaseColumn(x, z, world, noiseConfig); - } - - @Override - public void addDebugScreenInfo(@NotNull List text, @NotNull RandomState noiseConfig, @NotNull BlockPos pos) { - - } -} diff --git a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSInitializer.java b/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSInitializer.java deleted file mode 100644 index 05814cfd4..000000000 --- a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSInitializer.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R2; - -import org.bukkit.Bukkit; - -import com.dfsek.terra.bukkit.PlatformImpl; -import com.dfsek.terra.bukkit.nms.Initializer; - - -public class NMSInitializer implements Initializer { - @Override - public void initialize(PlatformImpl platform) { - AwfulBukkitHacks.registerBiomes(platform.getRawConfigRegistry()); - Bukkit.getPluginManager().registerEvents(new NMSInjectListener(), platform.getPlugin()); - } -} diff --git a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSInjectListener.java b/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSInjectListener.java deleted file mode 100644 index 6ce184da0..000000000 --- a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSInjectListener.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R2; - -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.level.chunk.ChunkGenerator; -import org.bukkit.World; -import org.bukkit.craftbukkit.v1_19_R2.CraftWorld; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.world.WorldInitEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.locks.ReentrantLock; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.bukkit.generator.BukkitChunkGeneratorWrapper; - - -public class NMSInjectListener implements Listener { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSInjectListener.class); - private static final Set INJECTED = new HashSet<>(); - private static final ReentrantLock INJECT_LOCK = new ReentrantLock(); - - @EventHandler - public void onWorldInit(WorldInitEvent event) { - if(!INJECTED.contains(event.getWorld()) && - event.getWorld().getGenerator() instanceof BukkitChunkGeneratorWrapper bukkitChunkGeneratorWrapper) { - INJECT_LOCK.lock(); - INJECTED.add(event.getWorld()); - LOGGER.info("Preparing to take over the world: {}", event.getWorld().getName()); - CraftWorld craftWorld = (CraftWorld) event.getWorld(); - ServerLevel serverWorld = craftWorld.getHandle(); - - ConfigPack pack = bukkitChunkGeneratorWrapper.getPack(); - - ChunkGenerator vanilla = serverWorld.getChunkSource().getGenerator(); - NMSBiomeProvider provider = new NMSBiomeProvider(pack.getBiomeProvider(), craftWorld.getSeed()); - - serverWorld.getChunkSource().chunkMap.generator = new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()); - - LOGGER.info("Successfully injected into world."); - - INJECT_LOCK.unlock(); - } - } -} diff --git a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSWorldProperties.java b/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSWorldProperties.java deleted file mode 100644 index 9e1989451..000000000 --- a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/NMSWorldProperties.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R2; - -import net.minecraft.world.level.LevelHeightAccessor; - -import com.dfsek.terra.api.world.info.WorldProperties; - - -public class NMSWorldProperties implements WorldProperties { - private final long seed; - private final LevelHeightAccessor height; - - public NMSWorldProperties(long seed, LevelHeightAccessor height) { - this.seed = seed; - this.height = height; - } - - @Override - public Object getHandle() { - return height; - } - - @Override - public long getSeed() { - return seed; - } - - @Override - public int getMaxHeight() { - return height.getMaxBuildHeight(); - } - - @Override - public int getMinHeight() { - return height.getMinBuildHeight(); - } -} diff --git a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/Reflection.java b/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/Reflection.java deleted file mode 100644 index d0f933258..000000000 --- a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/Reflection.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R2; - -import net.minecraft.core.Holder; -import net.minecraft.core.Holder.Reference; -import net.minecraft.core.MappedRegistry; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.StructureManager; -import xyz.jpenilla.reflectionremapper.ReflectionRemapper; -import xyz.jpenilla.reflectionremapper.proxy.ReflectionProxyFactory; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldGetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldSetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.MethodName; -import xyz.jpenilla.reflectionremapper.proxy.annotation.Proxies; - - -public class Reflection { - public static final MappedRegistryProxy MAPPED_REGISTRY; - public static final StructureManagerProxy STRUCTURE_MANAGER; - - public static final ReferenceProxy REFERENCE; - - static { - ReflectionRemapper reflectionRemapper = ReflectionRemapper.forReobfMappingsInPaperJar(); - ReflectionProxyFactory reflectionProxyFactory = ReflectionProxyFactory.create(reflectionRemapper, - Reflection.class.getClassLoader()); - - MAPPED_REGISTRY = reflectionProxyFactory.reflectionProxy(MappedRegistryProxy.class); - STRUCTURE_MANAGER = reflectionProxyFactory.reflectionProxy(StructureManagerProxy.class); - REFERENCE = reflectionProxyFactory.reflectionProxy(ReferenceProxy.class); - } - - - @Proxies(MappedRegistry.class) - public interface MappedRegistryProxy { - @FieldSetter("frozen") - void setFrozen(MappedRegistry instance, boolean frozen); - } - - - @Proxies(StructureManager.class) - public interface StructureManagerProxy { - @FieldGetter("level") - LevelAccessor getLevel(StructureManager instance); - } - - - @Proxies(Holder.Reference.class) - public interface ReferenceProxy { - @MethodName("bindValue") - void invokeBindValue(Reference instance, T value); - } -} diff --git a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/RegistryFetcher.java b/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/RegistryFetcher.java deleted file mode 100644 index ed353eafc..000000000 --- a/platforms/bukkit/nms/v1_19_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R2/RegistryFetcher.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R2; - -import net.minecraft.core.Registry; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.server.dedicated.DedicatedServer; -import net.minecraft.world.level.biome.Biome; -import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_19_R2.CraftServer; - - -public class RegistryFetcher { - private static Registry getRegistry(ResourceKey> key) { - CraftServer craftserver = (CraftServer) Bukkit.getServer(); - DedicatedServer dedicatedserver = craftserver.getServer(); - return dedicatedserver - .registryAccess() - .registryOrThrow(key); - } - - public static Registry biomeRegistry() { - return getRegistry(Registries.BIOME); - } -} diff --git a/platforms/bukkit/nms/v1_19_R3/build.gradle.kts b/platforms/bukkit/nms/v1_19_R3/build.gradle.kts deleted file mode 100644 index 4b2ad7d63..000000000 --- a/platforms/bukkit/nms/v1_19_R3/build.gradle.kts +++ /dev/null @@ -1,17 +0,0 @@ -apply(plugin = "io.papermc.paperweight.userdev") - -repositories { - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") -} - -dependencies { - api(project(":platforms:bukkit:common")) - paperDevBundle("1.19.4-R0.1-SNAPSHOT") - implementation("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) -} - -tasks { - assemble { - dependsOn("reobfJar") - } -} \ No newline at end of file diff --git a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/AwfulBukkitHacks.java deleted file mode 100644 index b2ac9d28b..000000000 --- a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/AwfulBukkitHacks.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R3; - -import com.google.common.collect.ImmutableMap; -import com.mojang.serialization.Lifecycle; -import net.minecraft.core.Holder; -import net.minecraft.core.Holder.Reference; -import net.minecraft.core.MappedRegistry; -import net.minecraft.core.WritableRegistry; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.TagKey; -import net.minecraft.world.level.biome.Biome; -import org.bukkit.NamespacedKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import com.dfsek.terra.bukkit.world.BukkitPlatformBiome; -import com.dfsek.terra.registry.master.ConfigRegistry; - - -public class AwfulBukkitHacks { - private static final Logger LOGGER = LoggerFactory.getLogger(AwfulBukkitHacks.class); - - private static final Map> terraBiomeMap = new HashMap<>(); - - public static void registerBiomes(ConfigRegistry configRegistry) { - try { - LOGGER.info("Hacking biome registry..."); - WritableRegistry biomeRegistry = (WritableRegistry) RegistryFetcher.biomeRegistry(); - - Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry) biomeRegistry, false); - - configRegistry.forEach(pack -> pack.getRegistry(com.dfsek.terra.api.world.biome.Biome.class).forEach((key, biome) -> { - try { - BukkitPlatformBiome platformBiome = (BukkitPlatformBiome) biome.getPlatformBiome(); - NamespacedKey vanillaBukkitKey = platformBiome.getHandle().getKey(); - ResourceLocation vanillaMinecraftKey = new ResourceLocation(vanillaBukkitKey.getNamespace(), vanillaBukkitKey.getKey()); - Biome platform = NMSBiomeInjector.createBiome(biome, Objects.requireNonNull(biomeRegistry.get(vanillaMinecraftKey))); - - ResourceKey delegateKey = ResourceKey.create( - Registries.BIOME, - new ResourceLocation("terra", NMSBiomeInjector.createBiomeID(pack, key)) - ); - - Reference holder = biomeRegistry.register(delegateKey, platform, Lifecycle.stable()); - Reflection.REFERENCE.invokeBindValue(holder, platform); // IMPORTANT: bind holder. - - platformBiome.getContext().put(new NMSBiomeInfo(delegateKey)); - - terraBiomeMap.computeIfAbsent(vanillaMinecraftKey, i -> new ArrayList<>()).add(delegateKey.location()); - - LOGGER.debug("Registered biome: " + delegateKey); - } catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { - throw new RuntimeException(e); - } - })); - - Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry) biomeRegistry, true); // freeze registry again :) - - LOGGER.info("Doing tag garbage...."); - Map, List>> collect = biomeRegistry - .getTags() // streamKeysAndEntries - .collect(HashMap::new, - (map, pair) -> - map.put(pair.getFirst(), new ArrayList<>(pair.getSecond().stream().toList())), - HashMap::putAll); - - terraBiomeMap - .forEach((vb, terraBiomes) -> - NMSBiomeInjector.getEntry(biomeRegistry, vb).ifPresentOrElse( - vanilla -> terraBiomes.forEach( - tb -> NMSBiomeInjector.getEntry(biomeRegistry, tb).ifPresentOrElse( - terra -> { - LOGGER.debug("{} (vanilla for {}): {}", - vanilla.unwrapKey().orElseThrow().location(), - terra.unwrapKey().orElseThrow().location(), - vanilla.tags().toList()); - vanilla.tags() - .forEach(tag -> collect - .computeIfAbsent(tag, t -> new ArrayList<>()) - .add(terra)); - }, - () -> LOGGER.error("No such biome: {}", tb))), - () -> LOGGER.error("No vanilla biome: {}", vb))); - - biomeRegistry.resetTags(); - biomeRegistry.bindTags(ImmutableMap.copyOf(collect)); - - } catch(SecurityException | IllegalArgumentException exception) { - throw new RuntimeException(exception); - } - } -} - diff --git a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeInfo.java deleted file mode 100644 index 816d96068..000000000 --- a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeInfo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R3; - -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.level.biome.Biome; - -import com.dfsek.terra.api.properties.Properties; - - -public record NMSBiomeInfo(ResourceKey biomeKey) implements Properties { -} diff --git a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeInjector.java deleted file mode 100644 index 733fd38f4..000000000 --- a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeInjector.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R3; - -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeSpecialEffects; - -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.bukkit.config.VanillaBiomeProperties; - - -public class NMSBiomeInjector { - - public static Optional> getEntry(Registry registry, ResourceLocation identifier) { - return registry.getOptional(identifier) - .flatMap(registry::getResourceKey) - .flatMap(registry::getHolder); - } - - public static Biome createBiome(com.dfsek.terra.api.world.biome.Biome biome, Biome vanilla) - throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - Biome.BiomeBuilder builder = new Biome.BiomeBuilder(); - - builder - .downfall(vanilla.climateSettings.downfall()) - .temperature(vanilla.getBaseTemperature()) - .mobSpawnSettings(vanilla.getMobSettings()) - .generationSettings(vanilla.getGenerationSettings()); - - - BiomeSpecialEffects.Builder effects = new BiomeSpecialEffects.Builder(); - - effects.grassColorModifier(vanilla.getSpecialEffects().getGrassColorModifier()); - - VanillaBiomeProperties vanillaBiomeProperties = biome.getContext().get(VanillaBiomeProperties.class); - - effects.fogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getFogColor(), vanilla.getFogColor())) - - .waterColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterColor(), vanilla.getWaterColor())) - - .waterFogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterFogColor(), vanilla.getWaterFogColor())) - - .skyColor(Objects.requireNonNullElse(vanillaBiomeProperties.getSkyColor(), vanilla.getSkyColor())); - - if(vanillaBiomeProperties.getFoliageColor() == null) { - vanilla.getSpecialEffects().getFoliageColorOverride().ifPresent(effects::foliageColorOverride); - } else { - effects.foliageColorOverride(vanillaBiomeProperties.getFoliageColor()); - } - - if(vanillaBiomeProperties.getGrassColor() == null) { - vanilla.getSpecialEffects().getGrassColorOverride().ifPresent(effects::grassColorOverride); - } else { - // grass - effects.grassColorOverride(vanillaBiomeProperties.getGrassColor()); - } - - vanilla.getAmbientLoop().ifPresent(effects::ambientLoopSound); - vanilla.getAmbientAdditions().ifPresent(effects::ambientAdditionsSound); - vanilla.getAmbientMood().ifPresent(effects::ambientMoodSound); - vanilla.getBackgroundMusic().ifPresent(effects::backgroundMusic); - vanilla.getAmbientParticle().ifPresent(effects::ambientParticle); - - builder.specialEffects(effects.build()); - - return builder.build(); - } - - public static String createBiomeID(ConfigPack pack, com.dfsek.terra.api.registry.key.RegistryKey biomeID) { - return pack.getID() - .toLowerCase() + "/" + biomeID.getNamespace().toLowerCase(Locale.ROOT) + "/" + biomeID.getID().toLowerCase(Locale.ROOT); - } -} diff --git a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeProvider.java deleted file mode 100644 index ed5ea1589..000000000 --- a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSBiomeProvider.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R3; - -import com.mojang.serialization.Codec; -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeSource; -import net.minecraft.world.level.biome.Climate.Sampler; -import org.jetbrains.annotations.NotNull; - -import java.util.stream.Stream; - -import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import com.dfsek.terra.bukkit.world.BukkitPlatformBiome; - - -public class NMSBiomeProvider extends BiomeSource { - private final BiomeProvider delegate; - private final long seed; - private final Registry biomeRegistry = RegistryFetcher.biomeRegistry(); - - public NMSBiomeProvider(BiomeProvider delegate, long seed) { - super(); - this.delegate = delegate; - this.seed = seed; - } - - @Override - protected Stream> collectPossibleBiomes() { - return delegate.stream() - .map(biome -> RegistryFetcher.biomeRegistry() - .getHolderOrThrow(((BukkitPlatformBiome) biome.getPlatformBiome()).getContext() - .get(NMSBiomeInfo.class) - .biomeKey())); - } - - @Override - protected @NotNull Codec codec() { - return BiomeSource.CODEC; - } - - @Override - public @NotNull Holder getNoiseBiome(int x, int y, int z, @NotNull Sampler sampler) { - return biomeRegistry.getHolderOrThrow(((BukkitPlatformBiome) delegate.getBiome(x << 2, y << 2, z << 2, seed) - .getPlatformBiome()).getContext() - .get(NMSBiomeInfo.class) - .biomeKey()); - } -} diff --git a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSChunkGeneratorDelegate.java deleted file mode 100644 index c697bd0c1..000000000 --- a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSChunkGeneratorDelegate.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R3; - -import com.mojang.serialization.Codec; -import net.minecraft.core.BlockPos; -import net.minecraft.server.level.WorldGenRegion; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.LevelHeightAccessor; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.StructureManager; -import net.minecraft.world.level.WorldGenLevel; -import net.minecraft.world.level.biome.BiomeManager; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.chunk.ChunkAccess; -import net.minecraft.world.level.chunk.ChunkGenerator; -import net.minecraft.world.level.levelgen.Beardifier; -import net.minecraft.world.level.levelgen.DensityFunction.SinglePointContext; -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; -import org.bukkit.craftbukkit.v1_19_R3.block.data.CraftBlockData; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import com.dfsek.terra.api.world.info.WorldProperties; -import com.dfsek.terra.bukkit.config.PreLoadCompatibilityOptions; -import com.dfsek.terra.bukkit.world.BukkitWorldProperties; -import com.dfsek.terra.bukkit.world.block.data.BukkitBlockState; - - -public class NMSChunkGeneratorDelegate extends ChunkGenerator { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSChunkGeneratorDelegate.class); - private final com.dfsek.terra.api.world.chunk.generation.ChunkGenerator delegate; - - private final ChunkGenerator vanilla; - private final ConfigPack pack; - - private final long seed; - - public NMSChunkGeneratorDelegate(ChunkGenerator vanilla, ConfigPack pack, NMSBiomeProvider biomeProvider, long seed) { - super(biomeProvider); - this.delegate = pack.getGeneratorProvider().newInstance(pack); - this.vanilla = vanilla; - this.pack = pack; - this.seed = seed; - } - - @Override - protected @NotNull Codec codec() { - return ChunkGenerator.CODEC; - } - - @Override - public void applyCarvers(@NotNull WorldGenRegion chunkRegion, long seed, @NotNull RandomState noiseConfig, @NotNull BiomeManager world, - @NotNull StructureManager structureAccessor, @NotNull ChunkAccess chunk, @NotNull Carving carverStep) { - // no-op - } - - @Override - public void buildSurface(@NotNull WorldGenRegion region, @NotNull StructureManager structures, @NotNull RandomState noiseConfig, - @NotNull ChunkAccess chunk) { - // no-op - } - - @Override - public void applyBiomeDecoration(@NotNull WorldGenLevel world, @NotNull ChunkAccess chunk, - @NotNull StructureManager structureAccessor) { - vanilla.applyBiomeDecoration(world, chunk, structureAccessor); - } - - @Override - public void spawnOriginalMobs(@NotNull WorldGenRegion region) { - vanilla.spawnOriginalMobs(region); - } - - @Override - public int getGenDepth() { - return vanilla.getGenDepth(); - } - - @Override - public @NotNull CompletableFuture fillFromNoise(@NotNull Executor executor, @NotNull Blender blender, - @NotNull RandomState noiseConfig, - @NotNull StructureManager structureAccessor, @NotNull ChunkAccess chunk) { - return vanilla.fillFromNoise(executor, blender, noiseConfig, structureAccessor, chunk) - .thenApply(c -> { - LevelAccessor level = Reflection.STRUCTURE_MANAGER.getLevel(structureAccessor); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - PreLoadCompatibilityOptions compatibilityOptions = pack.getContext().get(PreLoadCompatibilityOptions.class); - if(compatibilityOptions.isBeard()) { - beard(structureAccessor, chunk, new BukkitWorldProperties(level.getMinecraftWorld().getWorld()), - biomeProvider, compatibilityOptions); - } - return c; - }); - } - - private void beard(StructureManager structureAccessor, ChunkAccess chunk, WorldProperties world, BiomeProvider biomeProvider, - PreLoadCompatibilityOptions compatibilityOptions) { - Beardifier structureWeightSampler = Beardifier.forStructuresInChunk(structureAccessor, chunk.getPos()); - double threshold = compatibilityOptions.getBeardThreshold(); - double airThreshold = compatibilityOptions.getAirThreshold(); - int xi = chunk.getPos().x << 4; - int zi = chunk.getPos().z << 4; - for(int x = 0; x < 16; x++) { - for(int z = 0; z < 16; z++) { - int depth = 0; - for(int y = world.getMaxHeight(); y >= world.getMinHeight(); y--) { - double noise = structureWeightSampler.compute(new SinglePointContext(x + xi, y, z + zi)); - if(noise > threshold) { - chunk.setBlockState(new BlockPos(x, y, z), ((CraftBlockData) ((BukkitBlockState) delegate - .getPalette(x + xi, y, z + zi, world, biomeProvider) - .get(depth, x + xi, y, z + zi, world.getSeed())).getHandle()).getState(), false); - depth++; - } else if(noise < airThreshold) { - chunk.setBlockState(new BlockPos(x, y, z), Blocks.AIR.defaultBlockState(), false); - } else { - depth = 0; - } - } - } - } - } - - @Override - public int getSeaLevel() { - return vanilla.getSeaLevel(); - } - - @Override - public int getMinY() { - return vanilla.getMinY(); - } - - @Override - public int getBaseHeight(int x, int z, @NotNull Types heightmap, @NotNull LevelHeightAccessor world, @NotNull RandomState noiseConfig) { - WorldProperties properties = new NMSWorldProperties(seed, world); - int y = properties.getMaxHeight(); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - while(y >= getMinY() && !heightmap.isOpaque().test( - ((CraftBlockData) delegate.getBlock(properties, x, y - 1, z, biomeProvider).getHandle()).getState())) { - y--; - } - return y; - } - - @Override - public @NotNull NoiseColumn getBaseColumn(int x, int z, @NotNull LevelHeightAccessor world, @NotNull RandomState noiseConfig) { - BlockState[] array = new BlockState[world.getHeight()]; - WorldProperties properties = new NMSWorldProperties(seed, world); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - for(int y = properties.getMaxHeight() - 1; y >= properties.getMinHeight(); y--) { - array[y - properties.getMinHeight()] = ((CraftBlockData) delegate.getBlock(properties, x, y, z, biomeProvider) - .getHandle()).getState(); - } - return new NoiseColumn(getMinY(), array); - } - - @Override - public void addDebugScreenInfo(@NotNull List text, @NotNull RandomState noiseConfig, @NotNull BlockPos pos) { - - } -} diff --git a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSInitializer.java b/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSInitializer.java deleted file mode 100644 index 99797e8ab..000000000 --- a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSInitializer.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R3; - -import org.bukkit.Bukkit; - -import com.dfsek.terra.bukkit.PlatformImpl; -import com.dfsek.terra.bukkit.nms.Initializer; - - -public class NMSInitializer implements Initializer { - @Override - public void initialize(PlatformImpl platform) { - AwfulBukkitHacks.registerBiomes(platform.getRawConfigRegistry()); - Bukkit.getPluginManager().registerEvents(new NMSInjectListener(), platform.getPlugin()); - } -} diff --git a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSInjectListener.java b/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSInjectListener.java deleted file mode 100644 index 78da74f65..000000000 --- a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSInjectListener.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R3; - -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.level.chunk.ChunkGenerator; -import org.bukkit.World; -import org.bukkit.craftbukkit.v1_19_R3.CraftWorld; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.world.WorldInitEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.locks.ReentrantLock; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.bukkit.generator.BukkitChunkGeneratorWrapper; - - -public class NMSInjectListener implements Listener { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSInjectListener.class); - private static final Set INJECTED = new HashSet<>(); - private static final ReentrantLock INJECT_LOCK = new ReentrantLock(); - - @EventHandler - public void onWorldInit(WorldInitEvent event) { - if(!INJECTED.contains(event.getWorld()) && - event.getWorld().getGenerator() instanceof BukkitChunkGeneratorWrapper bukkitChunkGeneratorWrapper) { - INJECT_LOCK.lock(); - INJECTED.add(event.getWorld()); - LOGGER.info("Preparing to take over the world: {}", event.getWorld().getName()); - CraftWorld craftWorld = (CraftWorld) event.getWorld(); - ServerLevel serverWorld = craftWorld.getHandle(); - - ConfigPack pack = bukkitChunkGeneratorWrapper.getPack(); - - ChunkGenerator vanilla = serverWorld.getChunkSource().getGenerator(); - NMSBiomeProvider provider = new NMSBiomeProvider(pack.getBiomeProvider(), craftWorld.getSeed()); - - serverWorld.getChunkSource().chunkMap.generator = new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()); - - LOGGER.info("Successfully injected into world."); - - INJECT_LOCK.unlock(); - } - } -} diff --git a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSWorldProperties.java b/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSWorldProperties.java deleted file mode 100644 index 2cda90452..000000000 --- a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/NMSWorldProperties.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R3; - -import net.minecraft.world.level.LevelHeightAccessor; - -import com.dfsek.terra.api.world.info.WorldProperties; - - -public class NMSWorldProperties implements WorldProperties { - private final long seed; - private final LevelHeightAccessor height; - - public NMSWorldProperties(long seed, LevelHeightAccessor height) { - this.seed = seed; - this.height = height; - } - - @Override - public Object getHandle() { - return height; - } - - @Override - public long getSeed() { - return seed; - } - - @Override - public int getMaxHeight() { - return height.getMaxBuildHeight(); - } - - @Override - public int getMinHeight() { - return height.getMinBuildHeight(); - } -} diff --git a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/Reflection.java b/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/Reflection.java deleted file mode 100644 index 43d362ee6..000000000 --- a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/Reflection.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R3; - -import net.minecraft.core.Holder; -import net.minecraft.core.Holder.Reference; -import net.minecraft.core.MappedRegistry; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.StructureManager; -import xyz.jpenilla.reflectionremapper.ReflectionRemapper; -import xyz.jpenilla.reflectionremapper.proxy.ReflectionProxyFactory; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldGetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldSetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.MethodName; -import xyz.jpenilla.reflectionremapper.proxy.annotation.Proxies; - - -public class Reflection { - public static final MappedRegistryProxy MAPPED_REGISTRY; - public static final StructureManagerProxy STRUCTURE_MANAGER; - - public static final ReferenceProxy REFERENCE; - - static { - ReflectionRemapper reflectionRemapper = ReflectionRemapper.forReobfMappingsInPaperJar(); - ReflectionProxyFactory reflectionProxyFactory = ReflectionProxyFactory.create(reflectionRemapper, - Reflection.class.getClassLoader()); - - MAPPED_REGISTRY = reflectionProxyFactory.reflectionProxy(MappedRegistryProxy.class); - STRUCTURE_MANAGER = reflectionProxyFactory.reflectionProxy(StructureManagerProxy.class); - REFERENCE = reflectionProxyFactory.reflectionProxy(ReferenceProxy.class); - } - - - @Proxies(MappedRegistry.class) - public interface MappedRegistryProxy { - @FieldSetter("frozen") - void setFrozen(MappedRegistry instance, boolean frozen); - } - - - @Proxies(StructureManager.class) - public interface StructureManagerProxy { - @FieldGetter("level") - LevelAccessor getLevel(StructureManager instance); - } - - - @Proxies(Holder.Reference.class) - public interface ReferenceProxy { - @MethodName("bindValue") - void invokeBindValue(Reference instance, T value); - } -} diff --git a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/RegistryFetcher.java b/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/RegistryFetcher.java deleted file mode 100644 index e033491bb..000000000 --- a/platforms/bukkit/nms/v1_19_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_19_R3/RegistryFetcher.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_19_R3; - -import net.minecraft.core.Registry; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.server.dedicated.DedicatedServer; -import net.minecraft.world.level.biome.Biome; -import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_19_R3.CraftServer; - - -public class RegistryFetcher { - private static Registry getRegistry(ResourceKey> key) { - CraftServer craftserver = (CraftServer) Bukkit.getServer(); - DedicatedServer dedicatedserver = craftserver.getServer(); - return dedicatedserver - .registryAccess() - .registryOrThrow(key); - } - - public static Registry biomeRegistry() { - return getRegistry(Registries.BIOME); - } -} diff --git a/platforms/bukkit/nms/v1_20_R1/build.gradle.kts b/platforms/bukkit/nms/v1_20_R1/build.gradle.kts deleted file mode 100644 index c3c0d9809..000000000 --- a/platforms/bukkit/nms/v1_20_R1/build.gradle.kts +++ /dev/null @@ -1,17 +0,0 @@ -apply(plugin = "io.papermc.paperweight.userdev") - -repositories { - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") -} - -dependencies { - api(project(":platforms:bukkit:common")) - paperDevBundle("1.20.1-R0.1-SNAPSHOT") - implementation("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) -} - -tasks { - assemble { - dependsOn("reobfJar") - } -} \ No newline at end of file diff --git a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/AwfulBukkitHacks.java deleted file mode 100644 index 7994a0074..000000000 --- a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/AwfulBukkitHacks.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R1; - -import com.google.common.collect.ImmutableMap; -import com.mojang.serialization.Lifecycle; -import net.minecraft.core.Holder; -import net.minecraft.core.Holder.Reference; -import net.minecraft.core.MappedRegistry; -import net.minecraft.core.WritableRegistry; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.tags.TagKey; -import net.minecraft.world.level.biome.Biome; -import org.bukkit.NamespacedKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import com.dfsek.terra.bukkit.world.BukkitPlatformBiome; -import com.dfsek.terra.registry.master.ConfigRegistry; - - -public class AwfulBukkitHacks { - private static final Logger LOGGER = LoggerFactory.getLogger(AwfulBukkitHacks.class); - - private static final Map> terraBiomeMap = new HashMap<>(); - - public static void registerBiomes(ConfigRegistry configRegistry) { - try { - LOGGER.info("Hacking biome registry..."); - WritableRegistry biomeRegistry = (WritableRegistry) RegistryFetcher.biomeRegistry(); - - Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry) biomeRegistry, false); - - configRegistry.forEach(pack -> pack.getRegistry(com.dfsek.terra.api.world.biome.Biome.class).forEach((key, biome) -> { - try { - BukkitPlatformBiome platformBiome = (BukkitPlatformBiome) biome.getPlatformBiome(); - NamespacedKey vanillaBukkitKey = platformBiome.getHandle().getKey(); - ResourceLocation vanillaMinecraftKey = new ResourceLocation(vanillaBukkitKey.getNamespace(), vanillaBukkitKey.getKey()); - Biome platform = NMSBiomeInjector.createBiome(biome, Objects.requireNonNull(biomeRegistry.get(vanillaMinecraftKey))); - - ResourceKey delegateKey = ResourceKey.create( - Registries.BIOME, - new ResourceLocation("terra", NMSBiomeInjector.createBiomeID(pack, key)) - ); - - Reference holder = biomeRegistry.register(delegateKey, platform, Lifecycle.stable()); - Reflection.REFERENCE.invokeBindValue(holder, platform); // IMPORTANT: bind holder. - - platformBiome.getContext().put(new NMSBiomeInfo(delegateKey)); - - terraBiomeMap.computeIfAbsent(vanillaMinecraftKey, i -> new ArrayList<>()).add(delegateKey.location()); - - LOGGER.debug("Registered biome: " + delegateKey); - } catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { - throw new RuntimeException(e); - } - })); - - Reflection.MAPPED_REGISTRY.setFrozen((MappedRegistry) biomeRegistry, true); // freeze registry again :) - - LOGGER.info("Doing tag garbage...."); - Map, List>> collect = biomeRegistry - .getTags() // streamKeysAndEntries - .collect(HashMap::new, - (map, pair) -> - map.put(pair.getFirst(), new ArrayList<>(pair.getSecond().stream().toList())), - HashMap::putAll); - - terraBiomeMap - .forEach((vb, terraBiomes) -> - NMSBiomeInjector.getEntry(biomeRegistry, vb).ifPresentOrElse( - vanilla -> terraBiomes.forEach( - tb -> NMSBiomeInjector.getEntry(biomeRegistry, tb).ifPresentOrElse( - terra -> { - LOGGER.debug("{} (vanilla for {}): {}", - vanilla.unwrapKey().orElseThrow().location(), - terra.unwrapKey().orElseThrow().location(), - vanilla.tags().toList()); - vanilla.tags() - .forEach(tag -> collect - .computeIfAbsent(tag, t -> new ArrayList<>()) - .add(terra)); - }, - () -> LOGGER.error("No such biome: {}", tb))), - () -> LOGGER.error("No vanilla biome: {}", vb))); - - biomeRegistry.resetTags(); - biomeRegistry.bindTags(ImmutableMap.copyOf(collect)); - - } catch(SecurityException | IllegalArgumentException exception) { - throw new RuntimeException(exception); - } - } -} - diff --git a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeInfo.java deleted file mode 100644 index 7d8203ce3..000000000 --- a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeInfo.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R1; - -import net.minecraft.resources.ResourceKey; -import net.minecraft.world.level.biome.Biome; - -import com.dfsek.terra.api.properties.Properties; - - -public record NMSBiomeInfo(ResourceKey biomeKey) implements Properties { -} diff --git a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeInjector.java deleted file mode 100644 index 8c13d05b1..000000000 --- a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeInjector.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R1; - -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeSpecialEffects; - -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.bukkit.config.VanillaBiomeProperties; - - -public class NMSBiomeInjector { - - public static Optional> getEntry(Registry registry, ResourceLocation identifier) { - return registry.getOptional(identifier) - .flatMap(registry::getResourceKey) - .flatMap(registry::getHolder); - } - - public static Biome createBiome(com.dfsek.terra.api.world.biome.Biome biome, Biome vanilla) - throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - Biome.BiomeBuilder builder = new Biome.BiomeBuilder(); - - builder - .downfall(vanilla.climateSettings.downfall()) - .temperature(vanilla.getBaseTemperature()) - .mobSpawnSettings(vanilla.getMobSettings()) - .generationSettings(vanilla.getGenerationSettings()); - - - BiomeSpecialEffects.Builder effects = new BiomeSpecialEffects.Builder(); - - effects.grassColorModifier(vanilla.getSpecialEffects().getGrassColorModifier()); - - VanillaBiomeProperties vanillaBiomeProperties = biome.getContext().get(VanillaBiomeProperties.class); - - effects.fogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getFogColor(), vanilla.getFogColor())) - - .waterColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterColor(), vanilla.getWaterColor())) - - .waterFogColor(Objects.requireNonNullElse(vanillaBiomeProperties.getWaterFogColor(), vanilla.getWaterFogColor())) - - .skyColor(Objects.requireNonNullElse(vanillaBiomeProperties.getSkyColor(), vanilla.getSkyColor())); - - if(vanillaBiomeProperties.getFoliageColor() == null) { - vanilla.getSpecialEffects().getFoliageColorOverride().ifPresent(effects::foliageColorOverride); - } else { - effects.foliageColorOverride(vanillaBiomeProperties.getFoliageColor()); - } - - if(vanillaBiomeProperties.getGrassColor() == null) { - vanilla.getSpecialEffects().getGrassColorOverride().ifPresent(effects::grassColorOverride); - } else { - // grass - effects.grassColorOverride(vanillaBiomeProperties.getGrassColor()); - } - - vanilla.getAmbientLoop().ifPresent(effects::ambientLoopSound); - vanilla.getAmbientAdditions().ifPresent(effects::ambientAdditionsSound); - vanilla.getAmbientMood().ifPresent(effects::ambientMoodSound); - vanilla.getBackgroundMusic().ifPresent(effects::backgroundMusic); - vanilla.getAmbientParticle().ifPresent(effects::ambientParticle); - - builder.specialEffects(effects.build()); - - return builder.build(); - } - - public static String createBiomeID(ConfigPack pack, com.dfsek.terra.api.registry.key.RegistryKey biomeID) { - return pack.getID() - .toLowerCase() + "/" + biomeID.getNamespace().toLowerCase(Locale.ROOT) + "/" + biomeID.getID().toLowerCase(Locale.ROOT); - } -} diff --git a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeProvider.java deleted file mode 100644 index 48f048318..000000000 --- a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSBiomeProvider.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R1; - -import com.mojang.serialization.Codec; -import net.minecraft.core.Holder; -import net.minecraft.core.Registry; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.biome.BiomeSource; -import net.minecraft.world.level.biome.Climate.Sampler; -import org.jetbrains.annotations.NotNull; - -import java.util.stream.Stream; - -import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import com.dfsek.terra.bukkit.world.BukkitPlatformBiome; - - -public class NMSBiomeProvider extends BiomeSource { - private final BiomeProvider delegate; - private final long seed; - private final Registry biomeRegistry = RegistryFetcher.biomeRegistry(); - - public NMSBiomeProvider(BiomeProvider delegate, long seed) { - super(); - this.delegate = delegate; - this.seed = seed; - } - - @Override - protected Stream> collectPossibleBiomes() { - return delegate.stream() - .map(biome -> RegistryFetcher.biomeRegistry() - .getHolderOrThrow(((BukkitPlatformBiome) biome.getPlatformBiome()).getContext() - .get(NMSBiomeInfo.class) - .biomeKey())); - } - - @Override - protected @NotNull Codec codec() { - return BiomeSource.CODEC; - } - - @Override - public @NotNull Holder getNoiseBiome(int x, int y, int z, @NotNull Sampler sampler) { - return biomeRegistry.getHolderOrThrow(((BukkitPlatformBiome) delegate.getBiome(x << 2, y << 2, z << 2, seed) - .getPlatformBiome()).getContext() - .get(NMSBiomeInfo.class) - .biomeKey()); - } -} diff --git a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSChunkGeneratorDelegate.java deleted file mode 100644 index 565d0cbc4..000000000 --- a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSChunkGeneratorDelegate.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R1; - -import com.mojang.serialization.Codec; -import net.minecraft.core.BlockPos; -import net.minecraft.server.level.WorldGenRegion; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.LevelHeightAccessor; -import net.minecraft.world.level.NoiseColumn; -import net.minecraft.world.level.StructureManager; -import net.minecraft.world.level.WorldGenLevel; -import net.minecraft.world.level.biome.BiomeManager; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.chunk.ChunkAccess; -import net.minecraft.world.level.chunk.ChunkGenerator; -import net.minecraft.world.level.levelgen.Beardifier; -import net.minecraft.world.level.levelgen.DensityFunction.SinglePointContext; -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; -import org.bukkit.craftbukkit.v1_20_R1.block.data.CraftBlockData; -import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.api.world.biome.generation.BiomeProvider; -import com.dfsek.terra.api.world.info.WorldProperties; -import com.dfsek.terra.bukkit.config.PreLoadCompatibilityOptions; -import com.dfsek.terra.bukkit.world.BukkitWorldProperties; -import com.dfsek.terra.bukkit.world.block.data.BukkitBlockState; - - -public class NMSChunkGeneratorDelegate extends ChunkGenerator { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSChunkGeneratorDelegate.class); - private final com.dfsek.terra.api.world.chunk.generation.ChunkGenerator delegate; - - private final ChunkGenerator vanilla; - private final ConfigPack pack; - - private final long seed; - - public NMSChunkGeneratorDelegate(ChunkGenerator vanilla, ConfigPack pack, NMSBiomeProvider biomeProvider, long seed) { - super(biomeProvider); - this.delegate = pack.getGeneratorProvider().newInstance(pack); - this.vanilla = vanilla; - this.pack = pack; - this.seed = seed; - } - - @Override - protected @NotNull Codec codec() { - return ChunkGenerator.CODEC; - } - - @Override - public void applyCarvers(@NotNull WorldGenRegion chunkRegion, long seed, @NotNull RandomState noiseConfig, @NotNull BiomeManager world, - @NotNull StructureManager structureAccessor, @NotNull ChunkAccess chunk, @NotNull Carving carverStep) { - // no-op - } - - @Override - public void buildSurface(@NotNull WorldGenRegion region, @NotNull StructureManager structures, @NotNull RandomState noiseConfig, - @NotNull ChunkAccess chunk) { - // no-op - } - - @Override - public void applyBiomeDecoration(@NotNull WorldGenLevel world, @NotNull ChunkAccess chunk, - @NotNull StructureManager structureAccessor) { - vanilla.applyBiomeDecoration(world, chunk, structureAccessor); - } - - @Override - public void spawnOriginalMobs(@NotNull WorldGenRegion region) { - vanilla.spawnOriginalMobs(region); - } - - @Override - public int getGenDepth() { - return vanilla.getGenDepth(); - } - - @Override - public @NotNull CompletableFuture fillFromNoise(@NotNull Executor executor, @NotNull Blender blender, - @NotNull RandomState noiseConfig, - @NotNull StructureManager structureAccessor, @NotNull ChunkAccess chunk) { - return vanilla.fillFromNoise(executor, blender, noiseConfig, structureAccessor, chunk) - .thenApply(c -> { - LevelAccessor level = Reflection.STRUCTURE_MANAGER.getLevel(structureAccessor); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - PreLoadCompatibilityOptions compatibilityOptions = pack.getContext().get(PreLoadCompatibilityOptions.class); - if(compatibilityOptions.isBeard()) { - beard(structureAccessor, chunk, new BukkitWorldProperties(level.getMinecraftWorld().getWorld()), - biomeProvider, compatibilityOptions); - } - return c; - }); - } - - private void beard(StructureManager structureAccessor, ChunkAccess chunk, WorldProperties world, BiomeProvider biomeProvider, - PreLoadCompatibilityOptions compatibilityOptions) { - Beardifier structureWeightSampler = Beardifier.forStructuresInChunk(structureAccessor, chunk.getPos()); - double threshold = compatibilityOptions.getBeardThreshold(); - double airThreshold = compatibilityOptions.getAirThreshold(); - int xi = chunk.getPos().x << 4; - int zi = chunk.getPos().z << 4; - for(int x = 0; x < 16; x++) { - for(int z = 0; z < 16; z++) { - int depth = 0; - for(int y = world.getMaxHeight(); y >= world.getMinHeight(); y--) { - double noise = structureWeightSampler.compute(new SinglePointContext(x + xi, y, z + zi)); - if(noise > threshold) { - chunk.setBlockState(new BlockPos(x, y, z), ((CraftBlockData) ((BukkitBlockState) delegate - .getPalette(x + xi, y, z + zi, world, biomeProvider) - .get(depth, x + xi, y, z + zi, world.getSeed())).getHandle()).getState(), false); - depth++; - } else if(noise < airThreshold) { - chunk.setBlockState(new BlockPos(x, y, z), Blocks.AIR.defaultBlockState(), false); - } else { - depth = 0; - } - } - } - } - } - - @Override - public int getSeaLevel() { - return vanilla.getSeaLevel(); - } - - @Override - public int getMinY() { - return vanilla.getMinY(); - } - - @Override - public int getBaseHeight(int x, int z, @NotNull Types heightmap, @NotNull LevelHeightAccessor world, @NotNull RandomState noiseConfig) { - WorldProperties properties = new NMSWorldProperties(seed, world); - int y = properties.getMaxHeight(); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - while(y >= getMinY() && !heightmap.isOpaque().test( - ((CraftBlockData) delegate.getBlock(properties, x, y - 1, z, biomeProvider).getHandle()).getState())) { - y--; - } - return y; - } - - @Override - public @NotNull NoiseColumn getBaseColumn(int x, int z, @NotNull LevelHeightAccessor world, @NotNull RandomState noiseConfig) { - BlockState[] array = new BlockState[world.getHeight()]; - WorldProperties properties = new NMSWorldProperties(seed, world); - BiomeProvider biomeProvider = pack.getBiomeProvider(); - for(int y = properties.getMaxHeight() - 1; y >= properties.getMinHeight(); y--) { - array[y - properties.getMinHeight()] = ((CraftBlockData) delegate.getBlock(properties, x, y, z, biomeProvider) - .getHandle()).getState(); - } - return new NoiseColumn(getMinY(), array); - } - - @Override - public void addDebugScreenInfo(@NotNull List text, @NotNull RandomState noiseConfig, @NotNull BlockPos pos) { - - } -} diff --git a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSInitializer.java b/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSInitializer.java deleted file mode 100644 index 6fb689ee7..000000000 --- a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSInitializer.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R1; - -import org.bukkit.Bukkit; - -import com.dfsek.terra.bukkit.PlatformImpl; -import com.dfsek.terra.bukkit.nms.Initializer; - - -public class NMSInitializer implements Initializer { - @Override - public void initialize(PlatformImpl platform) { - AwfulBukkitHacks.registerBiomes(platform.getRawConfigRegistry()); - Bukkit.getPluginManager().registerEvents(new NMSInjectListener(), platform.getPlugin()); - } -} diff --git a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSInjectListener.java b/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSInjectListener.java deleted file mode 100644 index 3f7c9e060..000000000 --- a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSInjectListener.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R1; - -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.level.chunk.ChunkGenerator; -import org.bukkit.World; -import org.bukkit.craftbukkit.v1_20_R1.CraftWorld; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.world.WorldInitEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.locks.ReentrantLock; - -import com.dfsek.terra.api.config.ConfigPack; -import com.dfsek.terra.bukkit.generator.BukkitChunkGeneratorWrapper; - - -public class NMSInjectListener implements Listener { - private static final Logger LOGGER = LoggerFactory.getLogger(NMSInjectListener.class); - private static final Set INJECTED = new HashSet<>(); - private static final ReentrantLock INJECT_LOCK = new ReentrantLock(); - - @EventHandler - public void onWorldInit(WorldInitEvent event) { - if(!INJECTED.contains(event.getWorld()) && - event.getWorld().getGenerator() instanceof BukkitChunkGeneratorWrapper bukkitChunkGeneratorWrapper) { - INJECT_LOCK.lock(); - INJECTED.add(event.getWorld()); - LOGGER.info("Preparing to take over the world: {}", event.getWorld().getName()); - CraftWorld craftWorld = (CraftWorld) event.getWorld(); - ServerLevel serverWorld = craftWorld.getHandle(); - - ConfigPack pack = bukkitChunkGeneratorWrapper.getPack(); - - ChunkGenerator vanilla = serverWorld.getChunkSource().getGenerator(); - NMSBiomeProvider provider = new NMSBiomeProvider(pack.getBiomeProvider(), craftWorld.getSeed()); - - serverWorld.getChunkSource().chunkMap.generator = new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()); - - LOGGER.info("Successfully injected into world."); - - INJECT_LOCK.unlock(); - } - } -} diff --git a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSWorldProperties.java b/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSWorldProperties.java deleted file mode 100644 index 48effeb5f..000000000 --- a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/NMSWorldProperties.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R1; - -import net.minecraft.world.level.LevelHeightAccessor; - -import com.dfsek.terra.api.world.info.WorldProperties; - - -public class NMSWorldProperties implements WorldProperties { - private final long seed; - private final LevelHeightAccessor height; - - public NMSWorldProperties(long seed, LevelHeightAccessor height) { - this.seed = seed; - this.height = height; - } - - @Override - public Object getHandle() { - return height; - } - - @Override - public long getSeed() { - return seed; - } - - @Override - public int getMaxHeight() { - return height.getMaxBuildHeight(); - } - - @Override - public int getMinHeight() { - return height.getMinBuildHeight(); - } -} diff --git a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/Reflection.java b/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/Reflection.java deleted file mode 100644 index a11dd1b15..000000000 --- a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/Reflection.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R1; - -import net.minecraft.core.Holder; -import net.minecraft.core.Holder.Reference; -import net.minecraft.core.MappedRegistry; -import net.minecraft.world.level.LevelAccessor; -import net.minecraft.world.level.StructureManager; -import xyz.jpenilla.reflectionremapper.ReflectionRemapper; -import xyz.jpenilla.reflectionremapper.proxy.ReflectionProxyFactory; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldGetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldSetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.MethodName; -import xyz.jpenilla.reflectionremapper.proxy.annotation.Proxies; - - -public class Reflection { - public static final MappedRegistryProxy MAPPED_REGISTRY; - public static final StructureManagerProxy STRUCTURE_MANAGER; - - public static final ReferenceProxy REFERENCE; - - static { - ReflectionRemapper reflectionRemapper = ReflectionRemapper.forReobfMappingsInPaperJar(); - ReflectionProxyFactory reflectionProxyFactory = ReflectionProxyFactory.create(reflectionRemapper, - Reflection.class.getClassLoader()); - - MAPPED_REGISTRY = reflectionProxyFactory.reflectionProxy(MappedRegistryProxy.class); - STRUCTURE_MANAGER = reflectionProxyFactory.reflectionProxy(StructureManagerProxy.class); - REFERENCE = reflectionProxyFactory.reflectionProxy(ReferenceProxy.class); - } - - - @Proxies(MappedRegistry.class) - public interface MappedRegistryProxy { - @FieldSetter("frozen") - void setFrozen(MappedRegistry instance, boolean frozen); - } - - - @Proxies(StructureManager.class) - public interface StructureManagerProxy { - @FieldGetter("level") - LevelAccessor getLevel(StructureManager instance); - } - - - @Proxies(Holder.Reference.class) - public interface ReferenceProxy { - @MethodName("bindValue") - void invokeBindValue(Reference instance, T value); - } -} diff --git a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/RegistryFetcher.java b/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/RegistryFetcher.java deleted file mode 100644 index c7d77462d..000000000 --- a/platforms/bukkit/nms/v1_20_R1/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R1/RegistryFetcher.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R1; - -import net.minecraft.core.Registry; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.server.dedicated.DedicatedServer; -import net.minecraft.world.level.biome.Biome; -import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_20_R1.CraftServer; - - -public class RegistryFetcher { - private static Registry getRegistry(ResourceKey> key) { - CraftServer craftserver = (CraftServer) Bukkit.getServer(); - DedicatedServer dedicatedserver = craftserver.getServer(); - return dedicatedserver - .registryAccess() - .registryOrThrow(key); - } - - public static Registry biomeRegistry() { - return getRegistry(Registries.BIOME); - } -} From 5048bc8edeefc8c56c96224fead389d544457ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Wed, 6 Dec 2023 10:52:31 -0700 Subject: [PATCH 038/126] Remove folialib --- buildSrc/src/main/kotlin/Versions.kt | 6 +++--- platforms/bukkit/build.gradle.kts | 1 - platforms/bukkit/common/build.gradle.kts | 4 +--- .../com/dfsek/terra/bukkit/PlatformImpl.java | 4 ++-- .../dfsek/terra/bukkit/TerraBukkitPlugin.java | 18 +++++++++++++----- .../com/dfsek/terra/bukkit/util/PaperUtil.java | 6 ++++-- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 34cb058db..85ad3361b 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -49,12 +49,12 @@ object Versions { // } object Bukkit { - const val paper = "1.18.2-R0.1-20220920.010157-167" + const val paperBuild = "1.20.2-R0.1-20231203.034718" + const val paper = "$paperBuild-122" const val paperLib = "1.0.8" - const val foliaLib = "0.2.5" const val minecraft = "1.20.2" const val reflectionRemapper = "0.1.0" - const val paperDevBundle = "1.20.2-R0.1-20231203.034718-121" + const val paperDevBundle = "$paperBuild-121" const val runPaper = "2.2.2" const val paperWeight = "1.5.10" } diff --git a/platforms/bukkit/build.gradle.kts b/platforms/bukkit/build.gradle.kts index 68f981e1e..cdbc60d00 100644 --- a/platforms/bukkit/build.gradle.kts +++ b/platforms/bukkit/build.gradle.kts @@ -17,7 +17,6 @@ dependencies { tasks { shadowJar { relocate("io.papermc.lib", "com.dfsek.terra.lib.paperlib") - relocate("com.tcoded.folialib", "com.dfsek.terra.lib.folialib") relocate("com.google.common", "com.dfsek.terra.lib.google.common") relocate("org.apache.logging.slf4j", "com.dfsek.terra.lib.slf4j-over-log4j") exclude("org/slf4j/**") diff --git a/platforms/bukkit/common/build.gradle.kts b/platforms/bukkit/common/build.gradle.kts index 1324e038d..f47415da4 100644 --- a/platforms/bukkit/common/build.gradle.kts +++ b/platforms/bukkit/common/build.gradle.kts @@ -8,9 +8,7 @@ dependencies { compileOnly("io.papermc.paper", "paper-api", Versions.Bukkit.paper) shadedApi("io.papermc", "paperlib", Versions.Bukkit.paperLib) - // TODO: 2023-11-08 When we drop support for 1.18 and 1.19, we can remove FoliaLib and instead use `RegionScheduler`, - // AsyncScheduler, or GlobalRegionScheduler. - shadedApi("com.tcoded", "FoliaLib", Versions.Bukkit.foliaLib) + shadedApi("com.google.guava", "guava", Versions.Libraries.Internal.guava) shadedApi("cloud.commandframework", "cloud-paper", Versions.Libraries.cloud) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/PlatformImpl.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/PlatformImpl.java index 0ef6164d8..45a82c5cb 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/PlatformImpl.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/PlatformImpl.java @@ -84,8 +84,8 @@ public boolean reload() { } @Override - public void runPossiblyUnsafeTask(@NotNull Runnable task) { - plugin.getFoliaLib().getImpl().runAsync(task); + public void runPossiblyUnsafeTask(@NotNull Runnable runnable) { + plugin.getGlobalRegionScheduler().run(plugin, task -> runnable.run()); } @Override diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java index dd910d48c..8c362e908 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java @@ -21,7 +21,8 @@ import cloud.commandframework.bukkit.CloudBukkitCapabilities; import cloud.commandframework.execution.CommandExecutionCoordinator; import cloud.commandframework.paper.PaperCommandManager; -import com.tcoded.folialib.FoliaLib; +import io.papermc.paper.threadedregions.scheduler.AsyncScheduler; +import io.papermc.paper.threadedregions.scheduler.GlobalRegionScheduler; import org.bukkit.Bukkit; import org.bukkit.generator.ChunkGenerator; import org.bukkit.plugin.java.JavaPlugin; @@ -32,6 +33,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.concurrent.TimeUnit; import com.dfsek.terra.api.command.CommandSender; import com.dfsek.terra.api.config.ConfigPack; @@ -51,7 +53,9 @@ public class TerraBukkitPlugin extends JavaPlugin { private final PlatformImpl platform = new PlatformImpl(this); private final Map generatorMap = new HashMap<>(); - private final FoliaLib foliaLib = new FoliaLib(this); + private AsyncScheduler asyncScheduler = this.getServer().getAsyncScheduler(); + + private GlobalRegionScheduler globalRegionScheduler = this.getServer().getGlobalRegionScheduler(); @Override public void onEnable() { @@ -159,7 +163,7 @@ private boolean doVersionCheck() { """.strip()); }; runnable.run(); - foliaLib.getImpl().runLaterAsync(runnable, 200L); + asyncScheduler.runDelayed(this, task -> runnable.run(), 200L, TimeUnit.SECONDS); // Bukkit.shutdown(); // we're not *that* evil Bukkit.getPluginManager().disablePlugin(this); return false; @@ -187,7 +191,11 @@ ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id) { }), platform.getRawConfigRegistry().getByID(id).orElseThrow(), platform.getWorldHandle().air()); } - public FoliaLib getFoliaLib() { - return foliaLib; + public AsyncScheduler getAsyncScheduler() { + return asyncScheduler; + } + + public GlobalRegionScheduler getGlobalRegionScheduler() { + return globalRegionScheduler; } } diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/PaperUtil.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/PaperUtil.java index 2cde19b1f..c687fb000 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/PaperUtil.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/PaperUtil.java @@ -19,6 +19,8 @@ import io.papermc.lib.PaperLib; +import java.util.concurrent.TimeUnit; + import com.dfsek.terra.bukkit.TerraBukkitPlugin; import static io.papermc.lib.PaperLib.suggestPaper; @@ -26,10 +28,10 @@ public final class PaperUtil { public static void checkPaper(TerraBukkitPlugin plugin) { - plugin.getFoliaLib().getImpl().runLaterAsync(() -> { + plugin.getAsyncScheduler().runDelayed(plugin, task -> { if(!PaperLib.isPaper()) { suggestPaper(plugin); } - }, 100L); + }, 100L, TimeUnit.SECONDS); } } From 80c52870f53ae84b01b9e8514482801ae6a004fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Wed, 6 Dec 2023 12:00:03 -0700 Subject: [PATCH 039/126] add additional spigot warning --- .../main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java index 8c362e908..68d3e01ac 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java @@ -120,6 +120,9 @@ private boolean doVersionCheck() { if(!VersionUtil.getSpigotVersionInfo().isSpigot()) logger.error("YOU ARE RUNNING A CRAFTBUKKIT OR BUKKIT SERVER. PLEASE UPGRADE TO PAPER."); + if(!VersionUtil.getSpigotVersionInfo().isPaper()) + logger.error("YOU ARE RUNNING A SPIGOT SERVER. PLEASE UPGRADE TO PAPER."); + if(VersionUtil.getSpigotVersionInfo().isMohist()) { if(System.getProperty("IKnowMohistCausesLotsOfIssuesButIWillUseItAnyways") == null) { Runnable runnable = () -> { // scary big block of text From db8df9741f693e161709b289e2e1bd7a2b4f12e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Wed, 6 Dec 2023 22:22:18 -0700 Subject: [PATCH 040/126] bukkit 1.20.3 --- buildSrc/src/main/kotlin/Versions.kt | 6 +++--- platforms/bukkit/build.gradle.kts | 2 +- .../bukkit/nms/{v1_20_R2 => v1_20_R3}/build.gradle.kts | 0 .../dfsek/terra/bukkit/nms/v1_20_R3}/AwfulBukkitHacks.java | 2 +- .../com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSBiomeInfo.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R3}/NMSBiomeInjector.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R3}/NMSBiomeProvider.java | 2 +- .../bukkit/nms/v1_20_R3}/NMSChunkGeneratorDelegate.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R3}/NMSInitializer.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R3}/NMSInjectListener.java | 2 +- .../terra/bukkit/nms/v1_20_R3}/NMSWorldProperties.java | 2 +- .../com/dfsek/terra/bukkit/nms/v1_20_R3}/Reflection.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R3}/RegistryFetcher.java | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) rename platforms/bukkit/nms/{v1_20_R2 => v1_20_R3}/build.gradle.kts (100%) rename platforms/bukkit/nms/{v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/AwfulBukkitHacks.java (99%) rename platforms/bukkit/nms/{v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSBiomeInfo.java (83%) rename platforms/bukkit/nms/{v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSBiomeInjector.java (98%) rename platforms/bukkit/nms/{v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSBiomeProvider.java (97%) rename platforms/bukkit/nms/{v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSChunkGeneratorDelegate.java (99%) rename platforms/bukkit/nms/{v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSInitializer.java (90%) rename platforms/bukkit/nms/{v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSInjectListener.java (97%) rename platforms/bukkit/nms/{v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSWorldProperties.java (94%) rename platforms/bukkit/nms/{v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/Reflection.java (97%) rename platforms/bukkit/nms/{v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/RegistryFetcher.java (94%) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 85ad3361b..a24b1638f 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -49,12 +49,12 @@ object Versions { // } object Bukkit { - const val paperBuild = "1.20.2-R0.1-20231203.034718" - const val paper = "$paperBuild-122" + const val paperBuild = "1.20.3-R0.1-20231207.043048-3" + const val paper = paperBuild const val paperLib = "1.0.8" const val minecraft = "1.20.2" const val reflectionRemapper = "0.1.0" - const val paperDevBundle = "$paperBuild-121" + const val paperDevBundle = paperBuild const val runPaper = "2.2.2" const val paperWeight = "1.5.10" } diff --git a/platforms/bukkit/build.gradle.kts b/platforms/bukkit/build.gradle.kts index cdbc60d00..6f75b0133 100644 --- a/platforms/bukkit/build.gradle.kts +++ b/platforms/bukkit/build.gradle.kts @@ -10,7 +10,7 @@ repositories { dependencies { shaded(project(":platforms:bukkit:common")) - shaded(project(":platforms:bukkit:nms:v1_20_R2", configuration = "reobf")) + shaded(project(":platforms:bukkit:nms:v1_20_R3", configuration = "reobf")) shaded("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) } diff --git a/platforms/bukkit/nms/v1_20_R2/build.gradle.kts b/platforms/bukkit/nms/v1_20_R3/build.gradle.kts similarity index 100% rename from platforms/bukkit/nms/v1_20_R2/build.gradle.kts rename to platforms/bukkit/nms/v1_20_R3/build.gradle.kts diff --git a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java similarity index 99% rename from platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/AwfulBukkitHacks.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java index 8023ae452..fa2cc9907 100644 --- a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/AwfulBukkitHacks.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R2; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import com.google.common.collect.ImmutableMap; import com.mojang.serialization.Lifecycle; diff --git a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java similarity index 83% rename from platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSBiomeInfo.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java index fd415fb20..f47d21c56 100644 --- a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSBiomeInfo.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R2; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.biome.Biome; diff --git a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java similarity index 98% rename from platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSBiomeInjector.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java index b798ba4b8..e75b6fc0a 100644 --- a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSBiomeInjector.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R2; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.core.Holder; import net.minecraft.core.Registry; diff --git a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSBiomeProvider.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java index 1521a3582..875a77fb5 100644 --- a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSBiomeProvider.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R2; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import com.mojang.serialization.Codec; import net.minecraft.core.Holder; diff --git a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java similarity index 99% rename from platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSChunkGeneratorDelegate.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java index 8ecc904ac..922974e87 100644 --- a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSChunkGeneratorDelegate.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R2; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import com.mojang.serialization.Codec; import net.minecraft.core.BlockPos; diff --git a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSInitializer.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java similarity index 90% rename from platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSInitializer.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java index 89cf3b878..084c5c30a 100644 --- a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSInitializer.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R2; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import org.bukkit.Bukkit; diff --git a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSInjectListener.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSInjectListener.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java index ace83ddc7..bcbad11e0 100644 --- a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSInjectListener.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R2; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.chunk.ChunkGenerator; diff --git a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSWorldProperties.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java similarity index 94% rename from platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSWorldProperties.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java index 441a1847d..60f6cee46 100644 --- a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/NMSWorldProperties.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R2; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.world.level.LevelHeightAccessor; diff --git a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/Reflection.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/Reflection.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java index da7b5c01d..32243da54 100644 --- a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/Reflection.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R2; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.core.Holder; import net.minecraft.core.Holder.Reference; diff --git a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/RegistryFetcher.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java similarity index 94% rename from platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/RegistryFetcher.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java index 52bec1b1b..6e3822531 100644 --- a/platforms/bukkit/nms/v1_20_R2/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R2/RegistryFetcher.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R2; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.core.Registry; import net.minecraft.core.registries.Registries; From 4e5b066b916631a3858fda28cf846ae4211fdec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Wed, 6 Dec 2023 22:24:55 -0700 Subject: [PATCH 041/126] add bukkit grass workaround --- .../terra/bukkit/handles/BukkitWorldHandle.java | 12 ++++++++++++ .../bukkit/common/src/main/resources/plugin.yml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java index d28798518..700819232 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java @@ -29,16 +29,28 @@ import com.dfsek.terra.bukkit.world.block.data.BukkitBlockState; import com.dfsek.terra.bukkit.world.entity.BukkitEntityType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class BukkitWorldHandle implements WorldHandle { private final BlockState air; + private static final Logger logger = LoggerFactory.getLogger(BukkitWorldHandle.class); + public BukkitWorldHandle() { this.air = BukkitBlockState.newInstance(Material.AIR.createBlockData()); } @Override public synchronized @NotNull BlockState createBlockState(@NotNull String data) { + if(data.equals("minecraft:grass")) { //TODO: remove in 7.0 + data = "minecraft:short_grass"; + logger.warn( + "Translating minecraft:grass to minecraft:short_grass. In 1.20.3 minecraft:grass was renamed to minecraft:short_grass" + + ". You are advised to preform this rename in your config backs as this translation will be removed in the next major " + + "version of Terra."); + } org.bukkit.block.data.BlockData bukkitData = Bukkit.createBlockData( data); // somehow bukkit managed to make this not thread safe! :) return BukkitBlockState.newInstance(bukkitData); diff --git a/platforms/bukkit/common/src/main/resources/plugin.yml b/platforms/bukkit/common/src/main/resources/plugin.yml index d4bfd5534..4db59a81e 100644 --- a/platforms/bukkit/common/src/main/resources/plugin.yml +++ b/platforms/bukkit/common/src/main/resources/plugin.yml @@ -4,6 +4,6 @@ version: "@VERSION@" load: "STARTUP" author: dfsek website: "@WIKI@" -api-version: "1.13" +api-version: "1.20.3" description: "@DESCRIPTION@" folia-supported: true From 46ca45cb1d5e3a60bd95f6830a5ac76243ef3396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Wed, 6 Dec 2023 22:25:53 -0700 Subject: [PATCH 042/126] fix bukkit build --- .../terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java | 2 +- .../com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java | 2 +- .../com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java index 922974e87..4338dc140 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java @@ -19,7 +19,7 @@ import net.minecraft.world.level.levelgen.Heightmap.Types; import net.minecraft.world.level.levelgen.RandomState; import net.minecraft.world.level.levelgen.blending.Blender; -import org.bukkit.craftbukkit.v1_20_R2.block.data.CraftBlockData; +import org.bukkit.craftbukkit.v1_20_R3.block.data.CraftBlockData; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java index bcbad11e0..a81e93a3f 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java @@ -3,7 +3,7 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.chunk.ChunkGenerator; import org.bukkit.World; -import org.bukkit.craftbukkit.v1_20_R2.CraftWorld; +import org.bukkit.craftbukkit.v1_20_R3.CraftWorld; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.world.WorldInitEvent; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java index 6e3822531..6dbbecbc7 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java @@ -6,7 +6,7 @@ import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.world.level.biome.Biome; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_20_R2.CraftServer; +import org.bukkit.craftbukkit.v1_20_R3.CraftServer; public class RegistryFetcher { From 11b03eb93d9bcb7f21eb9b63d21491832acf8b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Wed, 6 Dec 2023 22:26:55 -0700 Subject: [PATCH 043/126] actually bump bukkit version --- buildSrc/src/main/kotlin/Versions.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index a24b1638f..79b5d43dd 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -49,10 +49,10 @@ object Versions { // } object Bukkit { - const val paperBuild = "1.20.3-R0.1-20231207.043048-3" + const val minecraft = "1.20.3" + const val paperBuild = "$minecraft-R0.1-20231207.043048-3" const val paper = paperBuild const val paperLib = "1.0.8" - const val minecraft = "1.20.2" const val reflectionRemapper = "0.1.0" const val paperDevBundle = paperBuild const val runPaper = "2.2.2" From 0ba0d472e6b69df93fad7ce74a1e01d2f5d869bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Wed, 6 Dec 2023 22:47:35 -0700 Subject: [PATCH 044/126] seems arch loom auto uses vineflower now --- buildSrc/src/main/kotlin/Versions.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 79b5d43dd..7b711fc86 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -39,9 +39,7 @@ object Versions { const val architecuryLoom = "1.4.367" const val architecturyPlugin = "3.4.151" - - const val loomVineflower = "1.11.0" - } + } // // object Forge { // const val forge = "${Mod.minecraft}-48.0.13" From 554887ab54e15bd2c27c9befe3f1639a9df8d170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Thu, 7 Dec 2023 11:27:06 -0700 Subject: [PATCH 045/126] build fabric against 1.20.4 --- buildSrc/src/main/kotlin/Versions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 7b711fc86..083da4119 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -33,7 +33,7 @@ object Versions { object Mod { const val mixin = "0.12.5+mixin.0.8.5" - const val minecraft = "1.20.3" + const val minecraft = "1.20.4" const val yarn = "$minecraft+build.1" const val fabricLoader = "0.15.0" From 80438141382fd8838cc2e99a1e89c77cd8cf1c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Thu, 7 Dec 2023 11:29:19 -0700 Subject: [PATCH 046/126] pull up version range of fabric --- platforms/fabric/src/main/resources/fabric.mod.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/fabric/src/main/resources/fabric.mod.json b/platforms/fabric/src/main/resources/fabric.mod.json index 1aeadf282..46a2c12ac 100644 --- a/platforms/fabric/src/main/resources/fabric.mod.json +++ b/platforms/fabric/src/main/resources/fabric.mod.json @@ -28,7 +28,7 @@ "depends": { "fabricloader": ">=0.15.0", "java": ">=17", - "minecraft": ">=1.20.3", + "minecraft": ">=1.20.4", "fabric": "*" } } \ No newline at end of file From d88e4f1f9bd1ca264f4cbb5f305344600d0954c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Fri, 8 Dec 2023 19:57:05 -0700 Subject: [PATCH 047/126] fix stupid error thank you caffeine mc peeps --- .../terra/block/entity/MobSpawnerBlockEntityMixin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java index 8004b903f..bf85dd159 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java @@ -50,7 +50,7 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS public abstract MobSpawnerLogic getLogic(); @Shadow - public abstract void setEntityType(net.minecraft.entity.EntityType entityType, Random random); + public abstract void method_46408(net.minecraft.entity.EntityType entityType, Random random); public EntityType terra$getSpawnedType() { return (EntityType) Registries.ENTITY_TYPE.get( @@ -58,7 +58,7 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS } public void terra$setSpawnedType(@NotNull EntityType creatureType) { - setEntityType((net.minecraft.entity.EntityType) creatureType, world.getRandom()); + method_46408((net.minecraft.entity.EntityType) creatureType, world.getRandom()); } public int terra$getDelay() { From 017876475e94d8d33992b2e98e7d0cc41897a8f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Fri, 8 Dec 2023 22:11:48 -0700 Subject: [PATCH 048/126] Add Vale config to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 63dda4360..f30f23988 100644 --- a/.gitignore +++ b/.gitignore @@ -249,3 +249,5 @@ nbdist/ platforms/**/run/** +#Vale Config File +platforms/mixin-common/src/main/.vale.ini From 8af299d09cc66a8ce9ed8753a52be03d7bcc8aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Fri, 8 Dec 2023 22:31:04 -0700 Subject: [PATCH 049/126] fix path of vale ignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f30f23988..8a964f70b 100644 --- a/.gitignore +++ b/.gitignore @@ -250,4 +250,4 @@ nbdist/ platforms/**/run/** #Vale Config File -platforms/mixin-common/src/main/.vale.ini +**/.vale.ini From 3142c2a4f0c5451afa12a01816b0ba767a487b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Fri, 8 Dec 2023 22:57:01 -0700 Subject: [PATCH 050/126] update paper to 1.20.4 --- buildSrc/src/main/kotlin/Versions.kt | 4 ++-- platforms/bukkit/build.gradle.kts | 2 +- platforms/bukkit/common/src/main/resources/plugin.yml | 2 +- platforms/bukkit/nms/{v1_20_R3 => v1_20_R4}/build.gradle.kts | 0 .../dfsek/terra/bukkit/nms/v1_20_R4}/AwfulBukkitHacks.java | 2 +- .../com/dfsek/terra/bukkit/nms/v1_20_R4}/NMSBiomeInfo.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R4}/NMSBiomeInjector.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R4}/NMSBiomeProvider.java | 2 +- .../terra/bukkit/nms/v1_20_R4}/NMSChunkGeneratorDelegate.java | 2 +- .../com/dfsek/terra/bukkit/nms/v1_20_R4}/NMSInitializer.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R4}/NMSInjectListener.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R4}/NMSWorldProperties.java | 2 +- .../java/com/dfsek/terra/bukkit/nms/v1_20_R4}/Reflection.java | 2 +- .../com/dfsek/terra/bukkit/nms/v1_20_R4}/RegistryFetcher.java | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) rename platforms/bukkit/nms/{v1_20_R3 => v1_20_R4}/build.gradle.kts (100%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4}/AwfulBukkitHacks.java (99%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4}/NMSBiomeInfo.java (83%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4}/NMSBiomeInjector.java (98%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4}/NMSBiomeProvider.java (97%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4}/NMSChunkGeneratorDelegate.java (99%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4}/NMSInitializer.java (90%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4}/NMSInjectListener.java (97%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4}/NMSWorldProperties.java (94%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4}/Reflection.java (97%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4}/RegistryFetcher.java (94%) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 083da4119..78249fec3 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -47,8 +47,8 @@ object Versions { // } object Bukkit { - const val minecraft = "1.20.3" - const val paperBuild = "$minecraft-R0.1-20231207.043048-3" + const val minecraft = "1.20.4" + const val paperBuild = "$minecraft-R0.1-20231207.202833-1" const val paper = paperBuild const val paperLib = "1.0.8" const val reflectionRemapper = "0.1.0" diff --git a/platforms/bukkit/build.gradle.kts b/platforms/bukkit/build.gradle.kts index 6f75b0133..45621ad9a 100644 --- a/platforms/bukkit/build.gradle.kts +++ b/platforms/bukkit/build.gradle.kts @@ -10,7 +10,7 @@ repositories { dependencies { shaded(project(":platforms:bukkit:common")) - shaded(project(":platforms:bukkit:nms:v1_20_R3", configuration = "reobf")) + shaded(project(":platforms:bukkit:nms:v1_20_R4", configuration = "reobf")) shaded("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) } diff --git a/platforms/bukkit/common/src/main/resources/plugin.yml b/platforms/bukkit/common/src/main/resources/plugin.yml index 4db59a81e..8e9b471fa 100644 --- a/platforms/bukkit/common/src/main/resources/plugin.yml +++ b/platforms/bukkit/common/src/main/resources/plugin.yml @@ -4,6 +4,6 @@ version: "@VERSION@" load: "STARTUP" author: dfsek website: "@WIKI@" -api-version: "1.20.3" +api-version: "1.20.4" description: "@DESCRIPTION@" folia-supported: true diff --git a/platforms/bukkit/nms/v1_20_R3/build.gradle.kts b/platforms/bukkit/nms/v1_20_R4/build.gradle.kts similarity index 100% rename from platforms/bukkit/nms/v1_20_R3/build.gradle.kts rename to platforms/bukkit/nms/v1_20_R4/build.gradle.kts diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/AwfulBukkitHacks.java similarity index 99% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java rename to platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/AwfulBukkitHacks.java index fa2cc9907..04dc78db4 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java +++ b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/AwfulBukkitHacks.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R4; import com.google.common.collect.ImmutableMap; import com.mojang.serialization.Lifecycle; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInfo.java similarity index 83% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java rename to platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInfo.java index f47d21c56..5f8854d77 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java +++ b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInfo.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R4; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.biome.Biome; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInjector.java similarity index 98% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java rename to platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInjector.java index e75b6fc0a..ed6f560ae 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java +++ b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInjector.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R4; import net.minecraft.core.Holder; import net.minecraft.core.Registry; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeProvider.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java rename to platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeProvider.java index 875a77fb5..5faeab1cb 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java +++ b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeProvider.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R4; import com.mojang.serialization.Codec; import net.minecraft.core.Holder; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSChunkGeneratorDelegate.java similarity index 99% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java rename to platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSChunkGeneratorDelegate.java index 4338dc140..f0c6e98e8 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java +++ b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSChunkGeneratorDelegate.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R4; import com.mojang.serialization.Codec; import net.minecraft.core.BlockPos; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInitializer.java similarity index 90% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java rename to platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInitializer.java index 084c5c30a..8ca4a59d0 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java +++ b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInitializer.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R4; import org.bukkit.Bukkit; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInjectListener.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java rename to platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInjectListener.java index a81e93a3f..8fa489968 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java +++ b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInjectListener.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R4; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.chunk.ChunkGenerator; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSWorldProperties.java similarity index 94% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java rename to platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSWorldProperties.java index 60f6cee46..03e84d7d4 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java +++ b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSWorldProperties.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R4; import net.minecraft.world.level.LevelHeightAccessor; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/Reflection.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java rename to platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/Reflection.java index 32243da54..2889527e4 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java +++ b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/Reflection.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R4; import net.minecraft.core.Holder; import net.minecraft.core.Holder.Reference; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/RegistryFetcher.java similarity index 94% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java rename to platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/RegistryFetcher.java index 6dbbecbc7..8f73a7db7 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java +++ b/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/RegistryFetcher.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R4; import net.minecraft.core.Registry; import net.minecraft.core.registries.Registries; From f9c9789016484bf11f985750ce6510273bbc6c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sat, 9 Dec 2023 01:16:38 -0700 Subject: [PATCH 051/126] remove unused maven repo --- buildSrc/src/main/kotlin/DependencyConfig.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/DependencyConfig.kt b/buildSrc/src/main/kotlin/DependencyConfig.kt index 84c5e19e4..58bde514c 100644 --- a/buildSrc/src/main/kotlin/DependencyConfig.kt +++ b/buildSrc/src/main/kotlin/DependencyConfig.kt @@ -48,9 +48,6 @@ fun Project.configureDependencies() { maven("https://jitpack.io") { name = "JitPack" } - maven("https://nexuslite.gcnt.net/repos/other/") { - name = "GCNT" - } } dependencies { From 687ad5db59bbea75b6e39a4413f8be875d1aa471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sat, 9 Dec 2023 14:58:23 -0700 Subject: [PATCH 052/126] Final dep update confirmed working on paper and fabric --- buildSrc/build.gradle.kts | 4 ++-- buildSrc/src/main/kotlin/Versions.kt | 12 +++++++----- common/api/build.gradle.kts | 2 +- platforms/bukkit/build.gradle.kts | 2 +- .../bukkit/common/src/main/resources/plugin.yml | 2 +- .../nms/{v1_20_R4 => v1_20_R3}/build.gradle.kts | 0 .../terra/bukkit/nms/v1_20_R3}/AwfulBukkitHacks.java | 2 +- .../terra/bukkit/nms/v1_20_R3}/NMSBiomeInfo.java | 2 +- .../terra/bukkit/nms/v1_20_R3}/NMSBiomeInjector.java | 2 +- .../terra/bukkit/nms/v1_20_R3}/NMSBiomeProvider.java | 2 +- .../nms/v1_20_R3}/NMSChunkGeneratorDelegate.java | 2 +- .../terra/bukkit/nms/v1_20_R3}/NMSInitializer.java | 2 +- .../bukkit/nms/v1_20_R3}/NMSInjectListener.java | 2 +- .../bukkit/nms/v1_20_R3}/NMSWorldProperties.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R3}/Reflection.java | 2 +- .../terra/bukkit/nms/v1_20_R3}/RegistryFetcher.java | 2 +- platforms/fabric/src/main/resources/fabric.mod.json | 2 +- 17 files changed, 23 insertions(+), 21 deletions(-) rename platforms/bukkit/nms/{v1_20_R4 => v1_20_R3}/build.gradle.kts (100%) rename platforms/bukkit/nms/{v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/AwfulBukkitHacks.java (99%) rename platforms/bukkit/nms/{v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSBiomeInfo.java (83%) rename platforms/bukkit/nms/{v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSBiomeInjector.java (98%) rename platforms/bukkit/nms/{v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSBiomeProvider.java (97%) rename platforms/bukkit/nms/{v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSChunkGeneratorDelegate.java (99%) rename platforms/bukkit/nms/{v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSInitializer.java (90%) rename platforms/bukkit/nms/{v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSInjectListener.java (97%) rename platforms/bukkit/nms/{v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/NMSWorldProperties.java (94%) rename platforms/bukkit/nms/{v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/Reflection.java (97%) rename platforms/bukkit/nms/{v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4 => v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3}/RegistryFetcher.java (94%) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 47b630e2f..3bdfddef0 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -17,10 +17,10 @@ repositories { dependencies { //TODO Allow pulling from Versions.kt implementation("com.github.johnrengelman", "shadow", "8.1.1") - implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.5.10") + implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.5.11") implementation("org.ow2.asm", "asm", "9.6") implementation("org.ow2.asm", "asm-tree", "9.6") - implementation("com.dfsek.tectonic", "common", "4.2.0") + implementation("com.dfsek.tectonic", "common", "4.2.1") implementation("org.yaml", "snakeyaml", "2.2") } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 78249fec3..8dc1151f5 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -6,6 +6,8 @@ object Versions { const val cloud = "1.8.4" + const val caffeine = "3.1.8" + const val slf4j = "2.0.9" const val log4j_slf4j_impl = "2.20.0" @@ -22,7 +24,7 @@ object Versions { } object Fabric { - const val fabricAPI = "0.91.1+${Mod.minecraft}" + const val fabricAPI = "0.91.2+${Mod.minecraft}" } // // object Quilt { @@ -35,9 +37,9 @@ object Versions { const val minecraft = "1.20.4" const val yarn = "$minecraft+build.1" - const val fabricLoader = "0.15.0" + const val fabricLoader = "0.15.1" - const val architecuryLoom = "1.4.367" + const val architecuryLoom = "1.4.369" const val architecturyPlugin = "3.4.151" } // @@ -48,13 +50,13 @@ object Versions { object Bukkit { const val minecraft = "1.20.4" - const val paperBuild = "$minecraft-R0.1-20231207.202833-1" + const val paperBuild = "$minecraft-R0.1-20231209.173338-2" const val paper = paperBuild const val paperLib = "1.0.8" const val reflectionRemapper = "0.1.0" const val paperDevBundle = paperBuild const val runPaper = "2.2.2" - const val paperWeight = "1.5.10" + const val paperWeight = "1.5.11" } // diff --git a/common/api/build.gradle.kts b/common/api/build.gradle.kts index 68a2f0d75..4f88c83e3 100644 --- a/common/api/build.gradle.kts +++ b/common/api/build.gradle.kts @@ -6,6 +6,6 @@ dependencies { api("com.dfsek.tectonic", "common", Versions.Libraries.tectonic) - api("com.github.ben-manes.caffeine:caffeine:3.1.0") + api("com.github.ben-manes.caffeine", "caffeine", Versions.Libraries.caffeine) } \ No newline at end of file diff --git a/platforms/bukkit/build.gradle.kts b/platforms/bukkit/build.gradle.kts index 45621ad9a..6f75b0133 100644 --- a/platforms/bukkit/build.gradle.kts +++ b/platforms/bukkit/build.gradle.kts @@ -10,7 +10,7 @@ repositories { dependencies { shaded(project(":platforms:bukkit:common")) - shaded(project(":platforms:bukkit:nms:v1_20_R4", configuration = "reobf")) + shaded(project(":platforms:bukkit:nms:v1_20_R3", configuration = "reobf")) shaded("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) } diff --git a/platforms/bukkit/common/src/main/resources/plugin.yml b/platforms/bukkit/common/src/main/resources/plugin.yml index 8e9b471fa..e965d7dee 100644 --- a/platforms/bukkit/common/src/main/resources/plugin.yml +++ b/platforms/bukkit/common/src/main/resources/plugin.yml @@ -4,6 +4,6 @@ version: "@VERSION@" load: "STARTUP" author: dfsek website: "@WIKI@" -api-version: "1.20.4" +api-version: "1.20" description: "@DESCRIPTION@" folia-supported: true diff --git a/platforms/bukkit/nms/v1_20_R4/build.gradle.kts b/platforms/bukkit/nms/v1_20_R3/build.gradle.kts similarity index 100% rename from platforms/bukkit/nms/v1_20_R4/build.gradle.kts rename to platforms/bukkit/nms/v1_20_R3/build.gradle.kts diff --git a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java similarity index 99% rename from platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/AwfulBukkitHacks.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java index 04dc78db4..fa2cc9907 100644 --- a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/AwfulBukkitHacks.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R4; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import com.google.common.collect.ImmutableMap; import com.mojang.serialization.Lifecycle; diff --git a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java similarity index 83% rename from platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInfo.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java index 5f8854d77..f47d21c56 100644 --- a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInfo.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R4; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.biome.Biome; diff --git a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java similarity index 98% rename from platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInjector.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java index ed6f560ae..e75b6fc0a 100644 --- a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeInjector.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R4; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.core.Holder; import net.minecraft.core.Registry; diff --git a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeProvider.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java index 5faeab1cb..875a77fb5 100644 --- a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSBiomeProvider.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R4; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import com.mojang.serialization.Codec; import net.minecraft.core.Holder; diff --git a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java similarity index 99% rename from platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSChunkGeneratorDelegate.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java index f0c6e98e8..4338dc140 100644 --- a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSChunkGeneratorDelegate.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R4; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import com.mojang.serialization.Codec; import net.minecraft.core.BlockPos; diff --git a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInitializer.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java similarity index 90% rename from platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInitializer.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java index 8ca4a59d0..084c5c30a 100644 --- a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInitializer.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R4; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import org.bukkit.Bukkit; diff --git a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInjectListener.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInjectListener.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java index 8fa489968..a81e93a3f 100644 --- a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSInjectListener.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R4; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.chunk.ChunkGenerator; diff --git a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSWorldProperties.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java similarity index 94% rename from platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSWorldProperties.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java index 03e84d7d4..60f6cee46 100644 --- a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/NMSWorldProperties.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R4; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.world.level.LevelHeightAccessor; diff --git a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/Reflection.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/Reflection.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java index 2889527e4..32243da54 100644 --- a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/Reflection.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R4; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.core.Holder; import net.minecraft.core.Holder.Reference; diff --git a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/RegistryFetcher.java b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java similarity index 94% rename from platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/RegistryFetcher.java rename to platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java index 8f73a7db7..6dbbecbc7 100644 --- a/platforms/bukkit/nms/v1_20_R4/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R4/RegistryFetcher.java +++ b/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R4; +package com.dfsek.terra.bukkit.nms.v1_20_R3; import net.minecraft.core.Registry; import net.minecraft.core.registries.Registries; diff --git a/platforms/fabric/src/main/resources/fabric.mod.json b/platforms/fabric/src/main/resources/fabric.mod.json index 46a2c12ac..8b67c7b54 100644 --- a/platforms/fabric/src/main/resources/fabric.mod.json +++ b/platforms/fabric/src/main/resources/fabric.mod.json @@ -26,7 +26,7 @@ "terra.common.mixins.json" ], "depends": { - "fabricloader": ">=0.15.0", + "fabricloader": ">=0.15.1", "java": ">=17", "minecraft": ">=1.20.4", "fabric": "*" From 1e55074cface27a32c79aed82e1515f7cde24595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sun, 10 Dec 2023 15:46:00 -0700 Subject: [PATCH 053/126] Enforce NMS bindings --- .../dfsek/terra/bukkit/TerraBukkitPlugin.java | 7 +++-- .../dfsek/terra/bukkit/nms/Initializer.java | 30 +++++++++++++------ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java index 68d3e01ac..bfb89b3cd 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java @@ -63,6 +63,11 @@ public void onEnable() { return; } + if(!Initializer.init(platform)) { + Bukkit.getPluginManager().disablePlugin(this); + return; + } + platform.getEventManager().callEvent(new PlatformInitializationEvent()); @@ -84,8 +89,6 @@ public void onEnable() { Bukkit.getPluginManager().registerEvents(new CommonListener(), this); // Register master event listener PaperUtil.checkPaper(this); - - Initializer.init(platform); } @NotNull diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java index d2ae2f04b..b53c7fd7a 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java @@ -1,6 +1,7 @@ package com.dfsek.terra.bukkit.nms; import org.bukkit.Bukkit; +import org.bukkit.plugin.Plugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -11,7 +12,7 @@ public interface Initializer { String NMS = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]; String TERRA_PACKAGE = Initializer.class.getPackageName(); - static void init(PlatformImpl platform) { + static boolean init(PlatformImpl platform) { Logger logger = LoggerFactory.getLogger(Initializer.class); try { Class initializerClass = Class.forName(TERRA_PACKAGE + "." + NMS + ".NMSInitializer"); @@ -24,16 +25,27 @@ static void init(PlatformImpl platform) { } catch(ClassNotFoundException e) { logger.error("NMS bindings for version {} do not exist. Support for this version is limited.", NMS); logger.error("This is usually due to running Terra on an unsupported Minecraft version."); - logger.error(""); - logger.error(""); - for(int i = 0; i < 20; i++) { - logger.error("PROCEEDING WITH AN EXISTING TERRA WORLD WILL RESULT IN CORRUPTION!!!"); + String bypassKey = "IKnowThereAreNoNMSBindingsFor" + NMS + "ButIWillProceedAnyway"; + if(System.getProperty(bypassKey) == null) { + logger.error("Because of this **TERRA HAS BEEN DISABLED**."); + logger.error("Do not come ask us why it is not working."); + logger.error("If you wish to proceed anyways, you can add the JVM System Property \"{}\" to enable the plugin.", bypassKey); + return false; + } else { + logger.error(""); + logger.error(""); + for(int i = 0; i < 20; i++) { + logger.error("PROCEEDING WITH AN EXISTING TERRA WORLD WILL RESULT IN CORRUPTION!!!"); + } + logger.error(""); + logger.error(""); + logger.error("NMS bindings for version {} do not exist. Support for this version is limited.", NMS); + logger.error("This is usually due to running Terra on an unsupported Minecraft version."); + logger.error("We will not give you any support for issues that may arise."); + logger.error("Since you enabled the \"{}\" flag, we won't disable Terra. But be warned.", bypassKey); } - logger.error(""); - logger.error(""); - logger.error("NMS bindings for version {} do not exist. Support for this version is limited.", NMS); - logger.error("This is usually due to running Terra on an unsupported Minecraft version."); } + return true; } void initialize(PlatformImpl plugin); From 0ad7ee4f9f91d4b517a55e63d22026fc5bb60594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sun, 10 Dec 2023 16:57:27 -0700 Subject: [PATCH 054/126] fix CME --- .../addons/terrascript/script/functions/BlockFunction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/script/functions/BlockFunction.java b/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/script/functions/BlockFunction.java index c4518b47c..28de64481 100644 --- a/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/script/functions/BlockFunction.java +++ b/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/script/functions/BlockFunction.java @@ -10,8 +10,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import com.dfsek.terra.addons.terrascript.parser.lang.ImplementationArguments; import com.dfsek.terra.addons.terrascript.parser.lang.Returnable; @@ -32,7 +32,7 @@ public class BlockFunction implements Function { protected final Returnable x, y, z; protected final Returnable blockData; protected final Platform platform; - private final Map data = new HashMap<>(); + private final Map data = new ConcurrentHashMap<>(); private final Returnable overwrite; private final Returnable physics; private final Position position; From f408faaa80c7aa3def0efbaf27a9e2baf86f1af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sun, 10 Dec 2023 17:07:18 -0700 Subject: [PATCH 055/126] reformat --- buildSrc/src/main/kotlin/Versions.kt | 2 +- .../java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java | 8 ++++---- .../com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java | 8 +++----- .../main/java/com/dfsek/terra/bukkit/nms/Initializer.java | 1 - 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 8dc1151f5..16590cef2 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -41,7 +41,7 @@ object Versions { const val architecuryLoom = "1.4.369" const val architecturyPlugin = "3.4.151" - } + } // // object Forge { // const val forge = "${Mod.minecraft}-48.0.13" diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java index bfb89b3cd..8540f64e5 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java @@ -63,10 +63,10 @@ public void onEnable() { return; } - if(!Initializer.init(platform)) { - Bukkit.getPluginManager().disablePlugin(this); - return; - } + if(!Initializer.init(platform)) { + Bukkit.getPluginManager().disablePlugin(this); + return; + } platform.getEventManager().callEvent(new PlatformInitializationEvent()); diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java index 700819232..d49841a7b 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java @@ -20,6 +20,8 @@ import org.bukkit.Bukkit; import org.bukkit.Material; import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Locale; @@ -29,14 +31,10 @@ import com.dfsek.terra.bukkit.world.block.data.BukkitBlockState; import com.dfsek.terra.bukkit.world.entity.BukkitEntityType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class BukkitWorldHandle implements WorldHandle { - private final BlockState air; - private static final Logger logger = LoggerFactory.getLogger(BukkitWorldHandle.class); + private final BlockState air; public BukkitWorldHandle() { this.air = BukkitBlockState.newInstance(Material.AIR.createBlockData()); diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java index b53c7fd7a..413250d57 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java @@ -1,7 +1,6 @@ package com.dfsek.terra.bukkit.nms; import org.bukkit.Bukkit; -import org.bukkit.plugin.Plugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; From 22c46f2f80333a1a5b43a248296c3f13c3b56beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sun, 10 Dec 2023 17:45:52 -0700 Subject: [PATCH 056/126] Pin OWConfig Version --- buildSrc/src/main/kotlin/DistributionConfig.kt | 2 +- buildSrc/src/main/kotlin/Versions.kt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/DistributionConfig.kt b/buildSrc/src/main/kotlin/DistributionConfig.kt index df003b078..80e59104e 100644 --- a/buildSrc/src/main/kotlin/DistributionConfig.kt +++ b/buildSrc/src/main/kotlin/DistributionConfig.kt @@ -27,7 +27,7 @@ fun Project.configureDistribution() { group = "terra" doFirst { file("${buildDir}/resources/main/packs/").deleteRecursively() - val defaultPackUrl = URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/latest/default.zip") + val defaultPackUrl = URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/" + Versions.Terra.overworldConfig + "/default.zip") downloadPack(defaultPackUrl, project) } } diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 16590cef2..a150ac3b2 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,4 +1,8 @@ object Versions { + object Terra { + const val overworldConfig = "v1.3.4" + } + object Libraries { const val tectonic = "4.2.1" const val paralithic = "0.7.1" From fc764a0fb3552752e6f3ec6f533f6e7890c45291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sun, 10 Dec 2023 18:40:43 -0700 Subject: [PATCH 057/126] fix issues with spawners and entity parsing --- .../com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java | 7 +++++++ .../com/dfsek/terra/mod/handle/MinecraftWorldHandle.java | 8 ++++++++ .../terra/block/entity/MobSpawnerBlockEntityMixin.java | 8 +++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java index d49841a7b..1d8744bcf 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java @@ -61,6 +61,13 @@ public BukkitWorldHandle() { @Override public @NotNull EntityType getEntity(@NotNull String id) { + if (!id.contains(":")) { //TODO: remove in 7.0 + String newid = "minecraft:" + id.toLowerCase();; + logger.warn( + "Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" + + ". You are advised to preform this rename in your config backs as this translation will be removed in the next major " + + "version of Terra."); + } if(!id.startsWith("minecraft:")) throw new IllegalArgumentException("Invalid entity identifier " + id); String entityID = id.toUpperCase(Locale.ROOT).substring(10); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java index 538041417..4dfa940ac 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java @@ -64,6 +64,14 @@ public class MinecraftWorldHandle implements WorldHandle { @Override public @NotNull EntityType getEntity(@NotNull String id) { + if (!id.contains(":")) { //TODO: remove in 7.0 + String newid = "minecraft:" + id.toLowerCase();; + logger.warn( + "Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" + + ". You are advised to preform this rename in your config backs as this translation will be removed in the next major " + + "version of Terra."); + } + if(!id.startsWith("minecraft:")) throw new IllegalArgumentException("Invalid entity identifier " + id); Identifier identifier = Identifier.tryParse(id); if(identifier == null) identifier = Identifier.tryParse(id); return (EntityType) Registries.ENTITY_TYPE.get(identifier); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java index bf85dd159..ccc8b738a 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java @@ -58,7 +58,13 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS } public void terra$setSpawnedType(@NotNull EntityType creatureType) { - method_46408((net.minecraft.entity.EntityType) creatureType, world.getRandom()); + Random rand; + if (hasWorld()) { + rand = world.getRandom(); + } else { + rand = Random.create(); + } + method_46408((net.minecraft.entity.EntityType) creatureType, rand); } public int terra$getDelay() { From 4a83f01c1f0d0129219320e05c20720599cc17b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sun, 10 Dec 2023 18:44:26 -0700 Subject: [PATCH 058/126] fix incase mods are used --- .../java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java index 4dfa940ac..01cd5ba2a 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java @@ -71,7 +71,7 @@ public class MinecraftWorldHandle implements WorldHandle { ". You are advised to preform this rename in your config backs as this translation will be removed in the next major " + "version of Terra."); } - if(!id.startsWith("minecraft:")) throw new IllegalArgumentException("Invalid entity identifier " + id); + if(!id.contains(":")) throw new IllegalArgumentException("Invalid entity identifier " + id); Identifier identifier = Identifier.tryParse(id); if(identifier == null) identifier = Identifier.tryParse(id); return (EntityType) Registries.ENTITY_TYPE.get(identifier); From 41045ae8aa7c639d056e7e8a8b528cb778a0b528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sun, 10 Dec 2023 18:47:12 -0700 Subject: [PATCH 059/126] literally forgor the most important part --- .../java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java | 1 + 1 file changed, 1 insertion(+) diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java index 01cd5ba2a..c8df3ba84 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java @@ -70,6 +70,7 @@ public class MinecraftWorldHandle implements WorldHandle { "Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" + ". You are advised to preform this rename in your config backs as this translation will be removed in the next major " + "version of Terra."); + id = newid; } if(!id.contains(":")) throw new IllegalArgumentException("Invalid entity identifier " + id); Identifier identifier = Identifier.tryParse(id); From 0091e5b78546d3207d5899de799ff45d8ec0a39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sun, 10 Dec 2023 18:50:40 -0700 Subject: [PATCH 060/126] spell check --- .../java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java index c8df3ba84..bc00f3a12 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java @@ -45,7 +45,7 @@ public class MinecraftWorldHandle implements WorldHandle { data = "minecraft:short_grass"; logger.warn( "Translating minecraft:grass to minecraft:short_grass. In 1.20.3 minecraft:grass was renamed to minecraft:short_grass" + - ". You are advised to preform this rename in your config backs as this translation will be removed in the next major " + + ". You are advised to preform this rename in your config packs as this translation will be removed in the next major " + "version of Terra."); } net.minecraft.block.BlockState state = BlockArgumentParser.block(Registries.BLOCK.getReadOnlyWrapper(), data, true) @@ -68,7 +68,7 @@ public class MinecraftWorldHandle implements WorldHandle { String newid = "minecraft:" + id.toLowerCase();; logger.warn( "Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" + - ". You are advised to preform this rename in your config backs as this translation will be removed in the next major " + + ". You are advised to preform this rename in your config packs as this translation will be removed in the next major " + "version of Terra."); id = newid; } From fd20837b555293902a15cf634b654d8ea74d51ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sun, 17 Dec 2023 15:29:18 -0700 Subject: [PATCH 061/126] fix error on startup --- .../main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java index 8540f64e5..a8701da17 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java @@ -63,14 +63,13 @@ public void onEnable() { return; } + platform.getEventManager().callEvent(new PlatformInitializationEvent()); + if(!Initializer.init(platform)) { Bukkit.getPluginManager().disablePlugin(this); return; } - platform.getEventManager().callEvent(new PlatformInitializationEvent()); - - try { PaperCommandManager commandManager = getCommandSenderPaperCommandManager(); From 3745c3e947c8b1f955e9c934f12ea402ef29907f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sun, 17 Dec 2023 15:32:35 -0700 Subject: [PATCH 062/126] fix typos --- .../com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java | 4 ++-- .../java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java index 1d8744bcf..e3b92b069 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java @@ -46,7 +46,7 @@ public BukkitWorldHandle() { data = "minecraft:short_grass"; logger.warn( "Translating minecraft:grass to minecraft:short_grass. In 1.20.3 minecraft:grass was renamed to minecraft:short_grass" + - ". You are advised to preform this rename in your config backs as this translation will be removed in the next major " + + ". You are advised to perform this rename in your config backs as this translation will be removed in the next major " + "version of Terra."); } org.bukkit.block.data.BlockData bukkitData = Bukkit.createBlockData( @@ -65,7 +65,7 @@ public BukkitWorldHandle() { String newid = "minecraft:" + id.toLowerCase();; logger.warn( "Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" + - ". You are advised to preform this rename in your config backs as this translation will be removed in the next major " + + ". You are advised to perform this rename in your config backs as this translation will be removed in the next major " + "version of Terra."); } if(!id.startsWith("minecraft:")) throw new IllegalArgumentException("Invalid entity identifier " + id); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java index bc00f3a12..3b5e1fe49 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java @@ -45,7 +45,7 @@ public class MinecraftWorldHandle implements WorldHandle { data = "minecraft:short_grass"; logger.warn( "Translating minecraft:grass to minecraft:short_grass. In 1.20.3 minecraft:grass was renamed to minecraft:short_grass" + - ". You are advised to preform this rename in your config packs as this translation will be removed in the next major " + + ". You are advised to perform this rename in your config packs as this translation will be removed in the next major " + "version of Terra."); } net.minecraft.block.BlockState state = BlockArgumentParser.block(Registries.BLOCK.getReadOnlyWrapper(), data, true) @@ -68,7 +68,7 @@ public class MinecraftWorldHandle implements WorldHandle { String newid = "minecraft:" + id.toLowerCase();; logger.warn( "Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" + - ". You are advised to preform this rename in your config packs as this translation will be removed in the next major " + + ". You are advised to perform this rename in your config packs as this translation will be removed in the next major " + "version of Terra."); id = newid; } From 84cd96ecf7748cfe82f7048542e6ca4123c65bc4 Mon Sep 17 00:00:00 2001 From: dfsek Date: Sun, 24 Dec 2023 01:53:05 -0700 Subject: [PATCH 063/126] fix BrownianMotionSampler lerp usage --- .../noise/samplers/noise/fractal/BrownianMotionSampler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/BrownianMotionSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/BrownianMotionSampler.java index 64f4ede05..bc766c731 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/BrownianMotionSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/BrownianMotionSampler.java @@ -24,7 +24,7 @@ public double getNoiseRaw(long seed, double x, double y) { for(int i = 0; i < octaves; i++) { double noise = input.noise(seed++, x, y); sum += noise * amp; - amp *= MathUtil.lerp(1.0, Math.min(noise + 1, 2) * 0.5, weightedStrength); + amp *= MathUtil.lerp(weightedStrength, 1.0, Math.min(noise + 1, 2) * 0.5); x *= lacunarity; y *= lacunarity; @@ -42,7 +42,7 @@ public double getNoiseRaw(long seed, double x, double y, double z) { for(int i = 0; i < octaves; i++) { double noise = input.noise(seed++, x, y, z); sum += noise * amp; - amp *= MathUtil.lerp(1.0, (noise + 1) * 0.5, weightedStrength); + amp *= MathUtil.lerp(weightedStrength, 1.0, (noise + 1) * 0.5); x *= lacunarity; y *= lacunarity; From 3622003a39d71c9ae792e9fcd79a379117db740c Mon Sep 17 00:00:00 2001 From: dfsek Date: Sun, 24 Dec 2023 02:02:46 -0700 Subject: [PATCH 064/126] fix other lerp issues --- .../noise/fractal/PingPongSampler.java | 4 ++-- .../noise/fractal/RidgedFractalSampler.java | 4 ++-- .../samplers/noise/simplex/PerlinSampler.java | 20 +++++++++---------- .../samplers/noise/value/ValueSampler.java | 20 +++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/PingPongSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/PingPongSampler.java index 653484fa1..761a5deaa 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/PingPongSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/PingPongSampler.java @@ -36,7 +36,7 @@ public double getNoiseRaw(long seed, double x, double y) { for(int i = 0; i < octaves; i++) { double noise = pingPong((input.noise(seed++, x, y) + 1) * pingPongStrength); sum += (noise - 0.5) * 2 * amp; - amp *= MathUtil.lerp(1.0, noise, weightedStrength); + amp *= MathUtil.lerp(weightedStrength, 1.0, noise); x *= lacunarity; y *= lacunarity; @@ -54,7 +54,7 @@ public double getNoiseRaw(long seed, double x, double y, double z) { for(int i = 0; i < octaves; i++) { double noise = pingPong((input.noise(seed++, x, y, z) + 1) * pingPongStrength); sum += (noise - 0.5) * 2 * amp; - amp *= MathUtil.lerp(1.0, noise, weightedStrength); + amp *= MathUtil.lerp(weightedStrength, 1.0, noise); x *= lacunarity; y *= lacunarity; diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/RidgedFractalSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/RidgedFractalSampler.java index 9ebb20ba0..1b45ed820 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/RidgedFractalSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/fractal/RidgedFractalSampler.java @@ -25,7 +25,7 @@ public double getNoiseRaw(long seed, double x, double y) { for(int i = 0; i < octaves; i++) { double noise = Math.abs(input.noise(seed++, x, y)); sum += (noise * -2 + 1) * amp; - amp *= MathUtil.lerp(1.0, 1 - noise, weightedStrength); + amp *= MathUtil.lerp(weightedStrength, 1.0, 1 - noise); x *= lacunarity; y *= lacunarity; @@ -43,7 +43,7 @@ public double getNoiseRaw(long seed, double x, double y, double z) { for(int i = 0; i < octaves; i++) { double noise = Math.abs(input.noise(seed++, x, y, z)); sum += (noise * -2 + 1) * amp; - amp *= MathUtil.lerp(1.0, 1 - noise, weightedStrength); + amp *= MathUtil.lerp(weightedStrength, 1.0, 1 - noise); x *= lacunarity; y *= lacunarity; diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PerlinSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PerlinSampler.java index 46ca9af30..8ce0c19dc 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PerlinSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PerlinSampler.java @@ -33,10 +33,10 @@ public double getNoiseRaw(long sl, double x, double y) { int x1 = x0 + PRIME_X; int y1 = y0 + PRIME_Y; - double xf0 = MathUtil.lerp(gradCoord(seed, x0, y0, xd0, yd0), gradCoord(seed, x1, y0, xd1, yd0), xs); - double xf1 = MathUtil.lerp(gradCoord(seed, x0, y1, xd0, yd1), gradCoord(seed, x1, y1, xd1, yd1), xs); + double xf0 = MathUtil.lerp(xs, gradCoord(seed, x0, y0, xd0, yd0), gradCoord(seed, x1, y0, xd1, yd0)); + double xf1 = MathUtil.lerp(xs, gradCoord(seed, x0, y1, xd0, yd1), gradCoord(seed, x1, y1, xd1, yd1)); - return MathUtil.lerp(xf0, xf1, ys) * 1.4247691104677813; + return MathUtil.lerp(ys, xf0, xf1) * 1.4247691104677813; } @Override @@ -64,14 +64,14 @@ public double getNoiseRaw(long sl, double x, double y, double z) { int y1 = y0 + PRIME_Y; int z1 = z0 + PRIME_Z; - double xf00 = MathUtil.lerp(gradCoord(seed, x0, y0, z0, xd0, yd0, zd0), gradCoord(seed, x1, y0, z0, xd1, yd0, zd0), xs); - double xf10 = MathUtil.lerp(gradCoord(seed, x0, y1, z0, xd0, yd1, zd0), gradCoord(seed, x1, y1, z0, xd1, yd1, zd0), xs); - double xf01 = MathUtil.lerp(gradCoord(seed, x0, y0, z1, xd0, yd0, zd1), gradCoord(seed, x1, y0, z1, xd1, yd0, zd1), xs); - double xf11 = MathUtil.lerp(gradCoord(seed, x0, y1, z1, xd0, yd1, zd1), gradCoord(seed, x1, y1, z1, xd1, yd1, zd1), xs); + double xf00 = MathUtil.lerp(xs, gradCoord(seed, x0, y0, z0, xd0, yd0, zd0), gradCoord(seed, x1, y0, z0, xd1, yd0, zd0)); + double xf10 = MathUtil.lerp(xs, gradCoord(seed, x0, y1, z0, xd0, yd1, zd0), gradCoord(seed, x1, y1, z0, xd1, yd1, zd0)); + double xf01 = MathUtil.lerp(xs, gradCoord(seed, x0, y0, z1, xd0, yd0, zd1), gradCoord(seed, x1, y0, z1, xd1, yd0, zd1)); + double xf11 = MathUtil.lerp(xs, gradCoord(seed, x0, y1, z1, xd0, yd1, zd1), gradCoord(seed, x1, y1, z1, xd1, yd1, zd1)); - double yf0 = MathUtil.lerp(xf00, xf10, ys); - double yf1 = MathUtil.lerp(xf01, xf11, ys); + double yf0 = MathUtil.lerp(ys, xf00, xf10); + double yf1 = MathUtil.lerp(ys, xf01, xf11); - return MathUtil.lerp(yf0, yf1, zs) * 0.964921414852142333984375; + return MathUtil.lerp(zs, yf0, yf1) * 0.964921414852142333984375; } } diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/value/ValueSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/value/ValueSampler.java index 09b0574cf..f0ce72403 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/value/ValueSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/value/ValueSampler.java @@ -25,10 +25,10 @@ public double getNoiseRaw(long sl, double x, double y) { int x1 = x0 + PRIME_X; int y1 = y0 + PRIME_Y; - double xf0 = MathUtil.lerp(valCoord(seed, x0, y0), valCoord(seed, x1, y0), xs); - double xf1 = MathUtil.lerp(valCoord(seed, x0, y1), valCoord(seed, x1, y1), xs); + double xf0 = MathUtil.lerp(xs, valCoord(seed, x0, y0), valCoord(seed, x1, y0)); + double xf1 = MathUtil.lerp(xs, valCoord(seed, x0, y1), valCoord(seed, x1, y1)); - return MathUtil.lerp(xf0, xf1, ys); + return MathUtil.lerp(ys, xf0, xf1); } @Override @@ -49,14 +49,14 @@ public double getNoiseRaw(long sl, double x, double y, double z) { int y1 = y0 + PRIME_Y; int z1 = z0 + PRIME_Z; - double xf00 = MathUtil.lerp(valCoord(seed, x0, y0, z0), valCoord(seed, x1, y0, z0), xs); - double xf10 = MathUtil.lerp(valCoord(seed, x0, y1, z0), valCoord(seed, x1, y1, z0), xs); - double xf01 = MathUtil.lerp(valCoord(seed, x0, y0, z1), valCoord(seed, x1, y0, z1), xs); - double xf11 = MathUtil.lerp(valCoord(seed, x0, y1, z1), valCoord(seed, x1, y1, z1), xs); + double xf00 = MathUtil.lerp(xs, valCoord(seed, x0, y0, z0), valCoord(seed, x1, y0, z0)); + double xf10 = MathUtil.lerp(xs, valCoord(seed, x0, y1, z0), valCoord(seed, x1, y1, z0)); + double xf01 = MathUtil.lerp(xs, valCoord(seed, x0, y0, z1), valCoord(seed, x1, y0, z1)); + double xf11 = MathUtil.lerp(xs, valCoord(seed, x0, y1, z1), valCoord(seed, x1, y1, z1)); - double yf0 = MathUtil.lerp(xf00, xf10, ys); - double yf1 = MathUtil.lerp(xf01, xf11, ys); + double yf0 = MathUtil.lerp(ys, xf00, xf10); + double yf1 = MathUtil.lerp(ys, xf01, xf11); - return MathUtil.lerp(yf0, yf1, zs); + return MathUtil.lerp(zs, yf0, yf1); } } From d8ba9e10164e642422295fdcbc911e422f40158d Mon Sep 17 00:00:00 2001 From: dfsek Date: Sun, 24 Dec 2023 02:06:11 -0700 Subject: [PATCH 065/126] bump version --- build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0088d805e..6d51c74f8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,8 @@ preRelease(true) -versionProjects(":common:api", version("6.4.2")) -versionProjects(":common:implementation", version("6.4.2")) -versionProjects(":platforms", version("6.4.2")) +versionProjects(":common:api", version("6.4.3")) +versionProjects(":common:implementation", version("6.4.3")) +versionProjects(":platforms", version("6.4.3")) allprojects { From 271e7f3c693244825c3dd92358e097624c64daa8 Mon Sep 17 00:00:00 2001 From: Astrash Date: Fri, 5 Jan 2024 18:42:35 +1100 Subject: [PATCH 066/126] Fix empty slant holders attempting to calculate slant This occurs when the NoiseChunkGenerator3D#getSlant method is invoked at a position where the biome has an empty slant holder, currently possible when using the slant locator addon. This is fixed by making slant calculation independent of SlantHolders. Some minor refactoring has also been done as a result of this change. --- .../NoiseChunkGenerator3DAddon.java | 7 +- ...NoiseChunkGeneratorPackConfigTemplate.java | 6 +- .../config/palette/BiomePaletteTemplate.java | 5 +- .../generation/NoiseChunkGenerator3D.java | 33 +++++--- .../generation/math/PaletteUtil.java | 29 ------- .../math/SlantCalculationMethod.java | 69 +++++++++++++++++ .../palette/slant/MultipleSlantHolder.java | 3 +- .../palette/slant/SingleSlantHolder.java | 3 +- .../palette/slant/SlantHolder.java | 77 +------------------ .../palette/slant/SlantHolderImpl.java | 11 +-- 10 files changed, 110 insertions(+), 133 deletions(-) delete mode 100644 common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/PaletteUtil.java create mode 100644 common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/SlantCalculationMethod.java diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java index 89f6e038c..ca2d8bc69 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java @@ -13,6 +13,7 @@ import com.dfsek.terra.addons.chunkgenerator.config.palette.BiomePaletteTemplate; import com.dfsek.terra.addons.chunkgenerator.config.palette.slant.SlantLayerTemplate; import com.dfsek.terra.addons.chunkgenerator.generation.NoiseChunkGenerator3D; +import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod; import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo; import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder; import com.dfsek.terra.addons.manifest.api.AddonInitializer; @@ -45,8 +46,8 @@ public void initialize() { .priority(1000) .then(event -> { - event.getPack().applyLoader(SlantHolder.CalculationMethod.class, - (type, o, loader, depthTracker) -> SlantHolder.CalculationMethod.valueOf((String) o)); + event.getPack().applyLoader(SlantCalculationMethod.class, + (type, o, loader, depthTracker) -> SlantCalculationMethod.valueOf((String) o)); NoiseChunkGeneratorPackConfigTemplate config = event.loadTemplate(new NoiseChunkGeneratorPackConfigTemplate()); event.getPack().getContext().put(config); @@ -57,7 +58,7 @@ public void initialize() { pack -> new NoiseChunkGenerator3D(pack, platform, config.getElevationBlend(), config.getHorizontalRes(), config.getVerticalRes(), noisePropertiesPropertyKey, - paletteInfoPropertyKey)); + paletteInfoPropertyKey, config.getSlantCalculationMethod())); event.getPack() .applyLoader(SlantHolder.Layer.class, SlantLayerTemplate::new); }) diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/NoiseChunkGeneratorPackConfigTemplate.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/NoiseChunkGeneratorPackConfigTemplate.java index c3828bbbf..b1f32c68a 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/NoiseChunkGeneratorPackConfigTemplate.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/NoiseChunkGeneratorPackConfigTemplate.java @@ -4,7 +4,7 @@ import com.dfsek.tectonic.api.config.template.annotations.Default; import com.dfsek.tectonic.api.config.template.annotations.Value; -import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder; +import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod; import com.dfsek.terra.api.config.meta.Meta; import com.dfsek.terra.api.properties.Properties; @@ -24,7 +24,7 @@ public class NoiseChunkGeneratorPackConfigTemplate implements ConfigTemplate, Pr @Value("slant.calculation-method") @Default - private SlantHolder.@Meta CalculationMethod slantCalculationMethod = SlantHolder.CalculationMethod.Derivative; + private @Meta SlantCalculationMethod slantCalculationMethod = SlantCalculationMethod.Derivative; public int getElevationBlend() { return elevationBlend; @@ -38,7 +38,7 @@ public int getVerticalRes() { return verticalRes; } - public SlantHolder.CalculationMethod getSlantCalculationMethod() { + public SlantCalculationMethod getSlantCalculationMethod() { return slantCalculationMethod; } } diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomePaletteTemplate.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomePaletteTemplate.java index 2d479f1a2..a4ff986e4 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomePaletteTemplate.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/palette/BiomePaletteTemplate.java @@ -16,6 +16,7 @@ import java.util.List; import java.util.Map; +import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod; import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo; import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder; import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder; @@ -27,7 +28,7 @@ public class BiomePaletteTemplate implements ObjectTemplate { private final Platform platform; - private final SlantHolder.CalculationMethod slantCalculationMethod; + private final SlantCalculationMethod slantCalculationMethod; @Value("slant") @Default @Description("The slant palettes to use in this biome.") @@ -56,7 +57,7 @@ public BlockState get(int layer, double x, double y, double z, long seed) { @Default private @Meta boolean updatePalette = false; - public BiomePaletteTemplate(Platform platform, SlantHolder.CalculationMethod slantCalculationMethod) { + public BiomePaletteTemplate(Platform platform, SlantCalculationMethod slantCalculationMethod) { this.platform = platform; this.slantCalculationMethod = slantCalculationMethod; } diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/NoiseChunkGenerator3D.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/NoiseChunkGenerator3D.java index 08dc93cbe..13cf69ace 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/NoiseChunkGenerator3D.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/NoiseChunkGenerator3D.java @@ -8,10 +8,13 @@ package com.dfsek.terra.addons.chunkgenerator.generation; +import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder; + +import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod; + import org.jetbrains.annotations.NotNull; import com.dfsek.terra.addons.chunkgenerator.config.noise.BiomeNoiseProperties; -import com.dfsek.terra.addons.chunkgenerator.generation.math.PaletteUtil; import com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation.LazilyEvaluatedInterpolator; import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D; import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.SamplerProvider; @@ -42,16 +45,19 @@ public class NoiseChunkGenerator3D implements ChunkGenerator { private final PropertyKey paletteInfoPropertyKey; private final PropertyKey noisePropertiesKey; + private final SlantCalculationMethod slantCalculationMethod; + public NoiseChunkGenerator3D(ConfigPack pack, Platform platform, int elevationBlend, int carverHorizontalResolution, int carverVerticalResolution, PropertyKey noisePropertiesKey, - PropertyKey paletteInfoPropertyKey) { + PropertyKey paletteInfoPropertyKey, SlantCalculationMethod slantCalculationMethod) { this.platform = platform; this.air = platform.getWorldHandle().air(); this.carverHorizontalResolution = carverHorizontalResolution; this.carverVerticalResolution = carverVerticalResolution; this.paletteInfoPropertyKey = paletteInfoPropertyKey; this.noisePropertiesKey = noisePropertiesKey; + this.slantCalculationMethod = slantCalculationMethod; int maxBlend = pack .getBiomeProvider() .stream() @@ -63,6 +69,17 @@ public NoiseChunkGenerator3D(ConfigPack pack, Platform platform, int elevationBl this.samplerCache = new SamplerProvider(platform, elevationBlend, noisePropertiesKey, maxBlend); } + private Palette paletteAt(int x, int y, int z, Sampler3D sampler, BiomePaletteInfo paletteInfo, int depth) { + SlantHolder slantHolder = paletteInfo.slantHolder(); + if(slantHolder.isAboveDepth(depth)) { + double slant = slantCalculationMethod.slant(sampler, x, y, z); + if(slantHolder.isInSlantThreshold(slant)) { + return slantHolder.getPalette(slant).getPalette(y); + } + } + return paletteInfo.paletteHolder().getPalette(y); + } + @Override @SuppressWarnings("try") public void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldProperties world, @@ -103,8 +120,7 @@ public void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldPropertie if(sampler.sample(x, y, z) > 0) { if(carver.sample(x, y, z) <= 0) { - data = PaletteUtil - .getPalette(x, y, z, sampler, paletteInfo, paletteLevel) + data = paletteAt(x, y, z, sampler, paletteInfo, paletteLevel) .get(paletteLevel, cx, y, cz, seed); chunk.setBlock(x, y, z, data); paletteLevel++; @@ -135,7 +151,7 @@ public BlockState getBlock(WorldProperties world, int x, int y, int z, BiomeProv int fdX = Math.floorMod(x, 16); int fdZ = Math.floorMod(z, 16); - Palette palette = PaletteUtil.getPalette(fdX, y, fdZ, sampler, paletteInfo, 0); + Palette palette = paletteAt(fdX, y, fdZ, sampler, paletteInfo, 0); double noise = sampler.sample(fdX, y, fdZ); if(noise > 0) { int level = 0; @@ -157,11 +173,8 @@ public Palette getPalette(int x, int y, int z, WorldProperties world, BiomeProvi public double getSlant(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) { int fdX = Math.floorMod(x, 16); int fdZ = Math.floorMod(z, 16); - return biomeProvider.getBiome(x, y, z, world.getSeed()) - .getContext() - .get(paletteInfoPropertyKey) - .slantHolder() - .calculateSlant(samplerCache.get(x, z, world, biomeProvider), fdX, y, fdZ); + Sampler3D sampler = samplerCache.get(x, z, world, biomeProvider); + return slantCalculationMethod.slant(sampler, fdX, y, fdZ); } public SamplerProvider samplerProvider() { diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/PaletteUtil.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/PaletteUtil.java deleted file mode 100644 index e7c20784c..000000000 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/PaletteUtil.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2020-2023 Polyhedral Development - * - * The Terra Core Addons are licensed under the terms of the MIT License. For more details, - * reference the LICENSE file in this module's root directory. - */ - -package com.dfsek.terra.addons.chunkgenerator.generation.math; - -import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D; -import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo; -import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder; -import com.dfsek.terra.api.world.chunk.generation.util.Palette; - - -public final class PaletteUtil { - - public static Palette getPalette(int x, int y, int z, Sampler3D sampler, BiomePaletteInfo paletteInfo, int depth) { - SlantHolder slantHolder = paletteInfo.slantHolder(); - if(slantHolder.isAboveDepth(depth)) { - double slant = slantHolder.calculateSlant(sampler, x, y, z); - if(slantHolder.isInSlantThreshold(slant)) { - return slantHolder.getPalette(slant).getPalette(y); - } - } - - return paletteInfo.paletteHolder().getPalette(y); - } -} \ No newline at end of file diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/SlantCalculationMethod.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/SlantCalculationMethod.java new file mode 100644 index 000000000..1c03a038a --- /dev/null +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/SlantCalculationMethod.java @@ -0,0 +1,69 @@ +package com.dfsek.terra.addons.chunkgenerator.generation.math; + +import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D; +import com.dfsek.terra.api.util.vector.Vector3; + + +public enum SlantCalculationMethod { + DotProduct { + private static final Vector3 DOT_PRODUCT_DIRECTION = Vector3.of(0, 1, 0); + + private static final Vector3[] DOT_PRODUCT_SAMPLE_POINTS = { + Vector3.of(0, 0, -DERIVATIVE_DIST), + Vector3.of(0, 0, DERIVATIVE_DIST), + Vector3.of(0, -DERIVATIVE_DIST, 0), + Vector3.of(0, DERIVATIVE_DIST, 0), + Vector3.of(-DERIVATIVE_DIST, 0, 0), + Vector3.of(DERIVATIVE_DIST, 0, 0) + }; + + @Override + public double slant(Sampler3D sampler, double x, double y, double z) { + Vector3.Mutable normalApproximation = Vector3.Mutable.of(0, 0, 0); + for(Vector3 point : DOT_PRODUCT_SAMPLE_POINTS) { + var scalar = -sampler.sample(x + point.getX(), y + point.getY(), z + point.getZ()); + normalApproximation.add(point.mutable().multiply(scalar)); + } + return DOT_PRODUCT_DIRECTION.dot(normalApproximation.normalize()); + } + + @Override + public boolean floorToThreshold() { + return false; + } + }, + + Derivative { + @Override + public double slant(Sampler3D sampler, double x, double y, double z) { + double baseSample = sampler.sample(x, y, z); + + double xVal1 = (sampler.sample(x + DERIVATIVE_DIST, y, z) - baseSample) / DERIVATIVE_DIST; + double xVal2 = (sampler.sample(x - DERIVATIVE_DIST, y, z) - baseSample) / DERIVATIVE_DIST; + double zVal1 = (sampler.sample(x, y, z + DERIVATIVE_DIST) - baseSample) / DERIVATIVE_DIST; + double zVal2 = (sampler.sample(x, y, z - DERIVATIVE_DIST) - baseSample) / DERIVATIVE_DIST; + double yVal1 = (sampler.sample(x, y + DERIVATIVE_DIST, z) - baseSample) / DERIVATIVE_DIST; + double yVal2 = (sampler.sample(x, y - DERIVATIVE_DIST, z) - baseSample) / DERIVATIVE_DIST; + + return Math.sqrt( + ((xVal2 - xVal1) * (xVal2 - xVal1)) + ((zVal2 - zVal1) * (zVal2 - zVal1)) + ((yVal2 - yVal1) * (yVal2 - yVal1))); + } + + @Override + public boolean floorToThreshold() { + return true; + } + }; + + private static final double DERIVATIVE_DIST = 0.55; + + public abstract double slant(Sampler3D sampler, double x, double y, double z); + + /* + * Controls whether palettes should be applied before or after their respective thresholds. + * + * If true, slant values will map to the palette of the next floor threshold, otherwise they + * will map to the ceiling. + */ + public abstract boolean floorToThreshold(); +} diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/MultipleSlantHolder.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/MultipleSlantHolder.java index 895c02698..08f1d16fe 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/MultipleSlantHolder.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/MultipleSlantHolder.java @@ -14,6 +14,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod; import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder; @@ -21,7 +22,7 @@ public class MultipleSlantHolder extends SlantHolderImpl { private final NavigableMap layers; private final double slantThreshold; - MultipleSlantHolder(List slant, int slantDepth, CalculationMethod calculationMethod) { + MultipleSlantHolder(List slant, int slantDepth, SlantCalculationMethod calculationMethod) { super(slantDepth, calculationMethod); NavigableMap layers = new TreeMap<>( slant.stream().collect(Collectors.toMap(SlantHolder.Layer::threshold, SlantHolder.Layer::palette))); diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SingleSlantHolder.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SingleSlantHolder.java index 12f29ef18..3f8ab5408 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SingleSlantHolder.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SingleSlantHolder.java @@ -1,5 +1,6 @@ package com.dfsek.terra.addons.chunkgenerator.palette.slant; +import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod; import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder; @@ -7,7 +8,7 @@ final class SingleSlantHolder extends SlantHolderImpl { private final SlantHolder.Layer layer; - public SingleSlantHolder(SlantHolder.Layer layer, int slantDepth, CalculationMethod calculationMethod) { + public SingleSlantHolder(SlantHolder.Layer layer, int slantDepth, SlantCalculationMethod calculationMethod) { super(slantDepth, calculationMethod); this.layer = layer; } diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SlantHolder.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SlantHolder.java index 359913d41..d4c2855cd 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SlantHolder.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SlantHolder.java @@ -2,19 +2,13 @@ import java.util.List; -import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D; +import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod; import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder; -import com.dfsek.terra.api.util.vector.Vector3; public interface SlantHolder { SlantHolder EMPTY = new SlantHolder() { - @Override - public double calculateSlant(Sampler3D sampler, double x, double y, double z) { - throw new UnsupportedOperationException("Empty holder should not calculate slant"); - } - @Override public boolean isAboveDepth(int depth) { return false; @@ -31,7 +25,7 @@ public PaletteHolder getPalette(double slant) { } }; - static SlantHolder of(List layers, int slantDepth, CalculationMethod calculationMethod) { + static SlantHolder of(List layers, int slantDepth, SlantCalculationMethod calculationMethod) { if(layers.isEmpty()) { return EMPTY; } else if(layers.size() == 1) { @@ -40,8 +34,6 @@ static SlantHolder of(List layers, int slantDepth, Calculatio return new MultipleSlantHolder(layers, slantDepth, calculationMethod); } - double calculateSlant(Sampler3D sampler, double x, double y, double z); - boolean isAboveDepth(int depth); boolean isInSlantThreshold(double slant); @@ -49,71 +41,6 @@ static SlantHolder of(List layers, int slantDepth, Calculatio PaletteHolder getPalette(double slant); - enum CalculationMethod { - DotProduct { - private static final Vector3 DOT_PRODUCT_DIRECTION = Vector3.of(0, 1, 0); - - private static final Vector3[] DOT_PRODUCT_SAMPLE_POINTS = { - Vector3.of(0, 0, -DERIVATIVE_DIST), - Vector3.of(0, 0, DERIVATIVE_DIST), - Vector3.of(0, -DERIVATIVE_DIST, 0), - Vector3.of(0, DERIVATIVE_DIST, 0), - Vector3.of(-DERIVATIVE_DIST, 0, 0), - Vector3.of(DERIVATIVE_DIST, 0, 0) - }; - - @Override - public double slant(Sampler3D sampler, double x, double y, double z) { - Vector3.Mutable normalApproximation = Vector3.Mutable.of(0, 0, 0); - for(Vector3 point : DOT_PRODUCT_SAMPLE_POINTS) { - var scalar = -sampler.sample(x + point.getX(), y + point.getY(), z + point.getZ()); - normalApproximation.add(point.mutable().multiply(scalar)); - } - return DOT_PRODUCT_DIRECTION.dot(normalApproximation.normalize()); - } - - @Override - public boolean floorToThreshold() { - return false; - } - }, - - Derivative { - @Override - public double slant(Sampler3D sampler, double x, double y, double z) { - double baseSample = sampler.sample(x, y, z); - - double xVal1 = (sampler.sample(x + DERIVATIVE_DIST, y, z) - baseSample) / DERIVATIVE_DIST; - double xVal2 = (sampler.sample(x - DERIVATIVE_DIST, y, z) - baseSample) / DERIVATIVE_DIST; - double zVal1 = (sampler.sample(x, y, z + DERIVATIVE_DIST) - baseSample) / DERIVATIVE_DIST; - double zVal2 = (sampler.sample(x, y, z - DERIVATIVE_DIST) - baseSample) / DERIVATIVE_DIST; - double yVal1 = (sampler.sample(x, y + DERIVATIVE_DIST, z) - baseSample) / DERIVATIVE_DIST; - double yVal2 = (sampler.sample(x, y - DERIVATIVE_DIST, z) - baseSample) / DERIVATIVE_DIST; - - return Math.sqrt( - ((xVal2 - xVal1) * (xVal2 - xVal1)) + ((zVal2 - zVal1) * (zVal2 - zVal1)) + ((yVal2 - yVal1) * (yVal2 - yVal1))); - } - - @Override - public boolean floorToThreshold() { - return true; - } - }; - - private static final double DERIVATIVE_DIST = 0.55; - - public abstract double slant(Sampler3D sampler, double x, double y, double z); - - /* - * Controls whether palettes should be applied before or after their respective thresholds. - * - * If true, slant values will map to the palette of the next floor threshold, otherwise they - * will map to the ceiling. - */ - public abstract boolean floorToThreshold(); - } - - record Layer(PaletteHolder palette, double threshold) { } } diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SlantHolderImpl.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SlantHolderImpl.java index 13fc68ef1..bef21cdba 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SlantHolderImpl.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/slant/SlantHolderImpl.java @@ -1,26 +1,19 @@ package com.dfsek.terra.addons.chunkgenerator.palette.slant; -import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D; +import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod; public abstract class SlantHolderImpl implements SlantHolder { protected final boolean floorToThreshold; - private final SlantHolder.CalculationMethod calculationMethod; private final int slantDepth; - protected SlantHolderImpl(int slantDepth, CalculationMethod calculationMethod) { + protected SlantHolderImpl(int slantDepth, SlantCalculationMethod calculationMethod) { this.floorToThreshold = calculationMethod.floorToThreshold(); - this.calculationMethod = calculationMethod; this.slantDepth = slantDepth; } protected abstract double getSlantThreshold(); - @Override - public final double calculateSlant(Sampler3D sampler, double x, double y, double z) { - return calculationMethod.slant(sampler, x, y, z); - } - @Override public final boolean isAboveDepth(int depth) { return depth <= slantDepth; From 9c181f7ee123bdf60cfecc3a8472b3359cf396a7 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sat, 6 Jan 2024 09:13:02 +1100 Subject: [PATCH 067/126] Add ability to disable slant palettes globally --- .../addons/chunkgenerator/NoiseChunkGenerator3DAddon.java | 3 ++- .../config/NoiseChunkGeneratorPackConfigTemplate.java | 8 ++++++++ .../chunkgenerator/generation/NoiseChunkGenerator3D.java | 8 ++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java index ca2d8bc69..f2f0c9386 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java @@ -58,7 +58,8 @@ public void initialize() { pack -> new NoiseChunkGenerator3D(pack, platform, config.getElevationBlend(), config.getHorizontalRes(), config.getVerticalRes(), noisePropertiesPropertyKey, - paletteInfoPropertyKey, config.getSlantCalculationMethod())); + paletteInfoPropertyKey, config.getSlantCalculationMethod(), + config.isSlantPalettesEnabled())); event.getPack() .applyLoader(SlantHolder.Layer.class, SlantLayerTemplate::new); }) diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/NoiseChunkGeneratorPackConfigTemplate.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/NoiseChunkGeneratorPackConfigTemplate.java index b1f32c68a..ae1f1ca4a 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/NoiseChunkGeneratorPackConfigTemplate.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/config/NoiseChunkGeneratorPackConfigTemplate.java @@ -26,6 +26,10 @@ public class NoiseChunkGeneratorPackConfigTemplate implements ConfigTemplate, Pr @Default private @Meta SlantCalculationMethod slantCalculationMethod = SlantCalculationMethod.Derivative; + @Value("slant.disable-palettes") + @Default + private @Meta boolean disableSlantPalettes = false; + public int getElevationBlend() { return elevationBlend; } @@ -41,4 +45,8 @@ public int getVerticalRes() { public SlantCalculationMethod getSlantCalculationMethod() { return slantCalculationMethod; } + + public boolean isSlantPalettesEnabled() { + return !disableSlantPalettes; + } } diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/NoiseChunkGenerator3D.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/NoiseChunkGenerator3D.java index 13cf69ace..95c2891cc 100644 --- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/NoiseChunkGenerator3D.java +++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/NoiseChunkGenerator3D.java @@ -47,10 +47,13 @@ public class NoiseChunkGenerator3D implements ChunkGenerator { private final SlantCalculationMethod slantCalculationMethod; + private final boolean useSlantPalettes; + public NoiseChunkGenerator3D(ConfigPack pack, Platform platform, int elevationBlend, int carverHorizontalResolution, int carverVerticalResolution, PropertyKey noisePropertiesKey, - PropertyKey paletteInfoPropertyKey, SlantCalculationMethod slantCalculationMethod) { + PropertyKey paletteInfoPropertyKey, + SlantCalculationMethod slantCalculationMethod, boolean useSlantPalettes) { this.platform = platform; this.air = platform.getWorldHandle().air(); this.carverHorizontalResolution = carverHorizontalResolution; @@ -58,6 +61,7 @@ public NoiseChunkGenerator3D(ConfigPack pack, Platform platform, int elevationBl this.paletteInfoPropertyKey = paletteInfoPropertyKey; this.noisePropertiesKey = noisePropertiesKey; this.slantCalculationMethod = slantCalculationMethod; + this.useSlantPalettes = useSlantPalettes; int maxBlend = pack .getBiomeProvider() .stream() @@ -71,7 +75,7 @@ public NoiseChunkGenerator3D(ConfigPack pack, Platform platform, int elevationBl private Palette paletteAt(int x, int y, int z, Sampler3D sampler, BiomePaletteInfo paletteInfo, int depth) { SlantHolder slantHolder = paletteInfo.slantHolder(); - if(slantHolder.isAboveDepth(depth)) { + if(useSlantPalettes && slantHolder.isAboveDepth(depth)) { double slant = slantCalculationMethod.slant(sampler, x, y, z); if(slantHolder.isInSlantThreshold(slant)) { return slantHolder.getPalette(slant).getPalette(y); From f3476c5cc8ca220d976686778bcf0a598582dcd7 Mon Sep 17 00:00:00 2001 From: Astrash Date: Sun, 7 Jan 2024 17:02:08 +1100 Subject: [PATCH 068/126] Add feature stage blending --- .../feature/FeatureGenerationStage.java | 15 +++++++++++-- .../feature/config/FeatureStageTemplate.java | 21 ++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java b/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java index 6baf88b7a..123107d15 100644 --- a/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java +++ b/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java @@ -12,6 +12,7 @@ import com.dfsek.terra.addons.generation.feature.config.BiomeFeatures; import com.dfsek.terra.api.Platform; +import com.dfsek.terra.api.noise.NoiseSampler; import com.dfsek.terra.api.properties.PropertyKey; import com.dfsek.terra.api.registry.key.StringIdentifiable; import com.dfsek.terra.api.util.Rotation; @@ -31,13 +32,20 @@ public class FeatureGenerationStage implements GenerationStage, StringIdentifiab private final int resolution; private final PropertyKey biomeFeaturesKey; + private final NoiseSampler blendSampler; + private final boolean doBlending; + private final double blendAmplitude; - public FeatureGenerationStage(Platform platform, String id, int resolution, PropertyKey biomeFeaturesKey) { + public FeatureGenerationStage(Platform platform, String id, int resolution, PropertyKey biomeFeaturesKey, + NoiseSampler blendSampler, double blendAmplitude) { this.platform = platform; this.id = id; this.profile = "feature_stage:" + id; this.resolution = resolution; this.biomeFeaturesKey = biomeFeaturesKey; + this.blendSampler = blendSampler; + this.doBlending = blendAmplitude != 0d; + this.blendAmplitude = blendAmplitude; } @Override @@ -52,7 +60,10 @@ public void populate(ProtoWorld world) { int tx = cx + chunkX; int tz = cz + chunkZ; world.getBiomeProvider() - .getColumn(tx, tz, world) + .getColumn( + tx + (doBlending ? (int) (blendSampler.noise(seed, tx, tz) * blendAmplitude) : 0), + tz + (doBlending ? (int) (blendSampler.noise(seed+1, tx, tz) * blendAmplitude) : 0), + world) .forRanges(resolution, (min, max, biome) -> { for(int subChunkX = 0; subChunkX < resolution; subChunkX++) { for(int subChunkZ = 0; subChunkZ < resolution; subChunkZ++) { diff --git a/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/config/FeatureStageTemplate.java b/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/config/FeatureStageTemplate.java index ffc077f1a..d0fae0e1f 100644 --- a/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/config/FeatureStageTemplate.java +++ b/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/config/FeatureStageTemplate.java @@ -8,6 +8,7 @@ import com.dfsek.terra.addons.generation.feature.FeatureGenerationStage; import com.dfsek.terra.api.Platform; +import com.dfsek.terra.api.noise.NoiseSampler; import com.dfsek.terra.api.properties.PropertyKey; import com.dfsek.terra.api.world.chunk.generation.stage.GenerationStage; @@ -22,6 +23,24 @@ public class FeatureStageTemplate implements ObjectTemplate, Va @Default private int resolution = 4; + @Value("blend.sampler") + @Default + private NoiseSampler blendSampler = new NoiseSampler() { + @Override + public double noise(long seed, double x, double y) { + return 0; + } + + @Override + public double noise(long seed, double x, double y, double z) { + return 0; + } + }; + + @Value("blend.amplitude") + @Default + private double blendAmplitude = 0d; + public FeatureStageTemplate(Platform platform, PropertyKey biomeFeaturesKey) { this.platform = platform; this.biomeFeaturesKey = biomeFeaturesKey; @@ -30,7 +49,7 @@ public FeatureStageTemplate(Platform platform, PropertyKey biomeF @Override public FeatureGenerationStage get() { - return new FeatureGenerationStage(platform, id, resolution, biomeFeaturesKey); + return new FeatureGenerationStage(platform, id, resolution, biomeFeaturesKey, blendSampler, blendAmplitude); } @Override From c52ad56cccb4590726f3fb744b94153983e68c2a Mon Sep 17 00:00:00 2001 From: Browsit <80560008+Browsit@users.noreply.github.com> Date: Fri, 2 Feb 2024 08:15:37 -0500 Subject: [PATCH 069/126] Return null for empty generator IDs --- .../src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java index a8701da17..555d073c7 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java @@ -189,6 +189,7 @@ private boolean doVersionCheck() { @Override public @Nullable ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id) { + if (id == null || id.trim().equals("")) { return null; } return new BukkitChunkGeneratorWrapper(generatorMap.computeIfAbsent(worldName, name -> { ConfigPack pack = platform.getConfigRegistry().getByID(id).orElseThrow( () -> new IllegalArgumentException("No such config pack \"" + id + "\"")); From 01e011a9edec3884bade363b03394a72922b41c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Fri, 5 Jan 2024 14:46:01 -0700 Subject: [PATCH 070/126] UX tweaks to biome config --- .../java/com/dfsek/terra/mod/ModPlatform.java | 53 +++++++++---------- .../terra/mod/config/SpawnGroupTemplate.java | 18 ------- .../mod/config/SpawnSettingsTemplate.java | 7 ++- .../terra/mod/config/SpawnTypeConfig.java | 14 ++--- 4 files changed, 40 insertions(+), 52 deletions(-) delete mode 100644 platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnGroupTemplate.java diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java index 25c78c228..d6d35508a 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java @@ -44,7 +44,6 @@ import com.dfsek.terra.mod.config.SoundEventTemplate; import com.dfsek.terra.mod.config.SpawnCostConfig; import com.dfsek.terra.mod.config.SpawnEntryTemplate; -import com.dfsek.terra.mod.config.SpawnGroupTemplate; import com.dfsek.terra.mod.config.SpawnSettingsTemplate; import com.dfsek.terra.mod.config.SpawnTypeConfig; import com.dfsek.terra.mod.config.VillagerTypeTemplate; @@ -68,32 +67,32 @@ public void registerWorldTypes(BiConsumer registerFunct public void register(TypeRegistry registry) { super.register(registry); registry.registerLoader(PlatformBiome.class, (type, o, loader, depthTracker) -> parseBiome((String) o, depthTracker)) - .registerLoader(Identifier.class, (type, o, loader, depthTracker) -> { - Identifier identifier = Identifier.tryParse((String) o); - if(identifier == null) - throw new LoadException("Invalid identifier: " + o, depthTracker); - return identifier; - }) - .registerLoader(Precipitation.class, (type, o, loader, depthTracker) -> Precipitation.valueOf(((String) o).toUpperCase( - Locale.ROOT))) - .registerLoader(GrassColorModifier.class, - (type, o, loader, depthTracker) -> GrassColorModifier.valueOf(((String) o).toUpperCase( - Locale.ROOT))) - .registerLoader(GrassColorModifier.class, - (type, o, loader, depthTracker) -> TemperatureModifier.valueOf(((String) o).toUpperCase( - Locale.ROOT))) - .registerLoader(BiomeParticleConfig.class, BiomeParticleConfigTemplate::new) - .registerLoader(SoundEvent.class, SoundEventTemplate::new) - .registerLoader(BiomeMoodSound.class, BiomeMoodSoundTemplate::new) - .registerLoader(BiomeAdditionsSound.class, BiomeAdditionsSoundTemplate::new) - .registerLoader(MusicSound.class, MusicSoundTemplate::new) - .registerLoader(EntityType.class, EntityTypeTemplate::new) - .registerLoader(SpawnCostConfig.class, SpawnCostConfig::new) - .registerLoader(SpawnEntry.class, SpawnEntryTemplate::new) - .registerLoader(SpawnGroup.class, SpawnGroupTemplate::new) - .registerLoader(SpawnTypeConfig.class, SpawnTypeConfig::new) - .registerLoader(SpawnSettings.class, SpawnSettingsTemplate::new) - .registerLoader(VillagerType.class, VillagerTypeTemplate::new); + .registerLoader(Identifier.class, (type, o, loader, depthTracker) -> { + Identifier identifier = Identifier.tryParse((String) o); + if(identifier == null) + throw new LoadException("Invalid identifier: " + o, depthTracker); + return identifier; + }) + .registerLoader(Precipitation.class, (type, o, loader, depthTracker) -> Precipitation.valueOf(((String) o).toUpperCase( + Locale.ROOT))) + .registerLoader(GrassColorModifier.class, + (type, o, loader, depthTracker) -> GrassColorModifier.valueOf(((String) o).toUpperCase( + Locale.ROOT))) + .registerLoader(GrassColorModifier.class, + (type, o, loader, depthTracker) -> TemperatureModifier.valueOf(((String) o).toUpperCase( + Locale.ROOT))) + .registerLoader(SpawnGroup.class,(type, o, loader, depthTracker) -> SpawnGroup.valueOf((String) o)) + .registerLoader(BiomeParticleConfig.class, BiomeParticleConfigTemplate::new) + .registerLoader(SoundEvent.class, SoundEventTemplate::new) + .registerLoader(BiomeMoodSound.class, BiomeMoodSoundTemplate::new) + .registerLoader(BiomeAdditionsSound.class, BiomeAdditionsSoundTemplate::new) + .registerLoader(MusicSound.class, MusicSoundTemplate::new) + .registerLoader(EntityType.class, EntityTypeTemplate::new) + .registerLoader(SpawnCostConfig.class, SpawnCostConfig::new) + .registerLoader(SpawnEntry.class, SpawnEntryTemplate::new) + .registerLoader(SpawnTypeConfig.class, SpawnTypeConfig::new) + .registerLoader(SpawnSettings.class, SpawnSettingsTemplate::new) + .registerLoader(VillagerType.class, VillagerTypeTemplate::new); } private ProtoPlatformBiome parseBiome(String id, DepthTracker tracker) throws LoadException { diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnGroupTemplate.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnGroupTemplate.java deleted file mode 100644 index 0ae2047f2..000000000 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnGroupTemplate.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.dfsek.terra.mod.config; - -import com.dfsek.tectonic.api.config.template.annotations.Default; -import com.dfsek.tectonic.api.config.template.annotations.Value; -import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; -import net.minecraft.entity.SpawnGroup; - - -public class SpawnGroupTemplate implements ObjectTemplate { - @Value("group") - @Default - private String group = null; - - @Override - public SpawnGroup get() { - return SpawnGroup.valueOf(group); - } -} diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnSettingsTemplate.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnSettingsTemplate.java index 9392e94e1..86e9de007 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnSettingsTemplate.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnSettingsTemplate.java @@ -3,7 +3,9 @@ import com.dfsek.tectonic.api.config.template.annotations.Default; import com.dfsek.tectonic.api.config.template.annotations.Value; import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; +import net.minecraft.entity.SpawnGroup; import net.minecraft.world.biome.SpawnSettings; +import net.minecraft.world.biome.SpawnSettings.SpawnEntry; import java.util.List; @@ -25,7 +27,10 @@ public class SpawnSettingsTemplate implements ObjectTemplate { public SpawnSettings get() { SpawnSettings.Builder builder = new SpawnSettings.Builder(); for(SpawnTypeConfig spawn : spawns) { - builder.spawn(spawn.getGroup(), spawn.getEntry()); + SpawnGroup group = spawn.getGroup(); + for (SpawnEntry entry : spawn.getEntry()) { + builder.spawn(group, entry); + } } for(SpawnCostConfig cost : costs) { builder.spawnCost(cost.getType(), cost.getMass(), cost.getGravity()); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnTypeConfig.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnTypeConfig.java index 9384f991d..b18c87e62 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnTypeConfig.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnTypeConfig.java @@ -6,21 +6,23 @@ import net.minecraft.entity.SpawnGroup; import net.minecraft.world.biome.SpawnSettings.SpawnEntry; +import java.util.List; + public class SpawnTypeConfig implements ObjectTemplate { @Value("group") @Default private SpawnGroup group = null; - - @Value("entry") + + @Value("entries") @Default - private SpawnEntry entry = null; - + private List entry = null; + public SpawnGroup getGroup() { return group; } - - public SpawnEntry getEntry() { + + public List getEntry() { return entry; } From 142d3646821f2c084deaa692dde96dcb2881f675 Mon Sep 17 00:00:00 2001 From: Astrash Date: Wed, 17 Apr 2024 09:54:07 +1000 Subject: [PATCH 071/126] WIP fractal-gavoro-pseudoerosion --- .../dfsek/terra/addons/noise/NoiseAddon.java | 10 +- .../DerivativeNoiseSamplerTemplate.java | 25 +++ .../noise/DerivativeFractalTemplate.java | 32 ++++ .../noise/PseudoErosionTemplate.java | 62 ++++++ .../noise/simplex/DerivativeFractal.java | 104 ++++++++++ .../samplers/noise/simplex/PseudoErosion.java | 179 ++++++++++++++++++ .../api/noise/DerivativeNoiseSampler.java | 22 +++ 7 files changed, 432 insertions(+), 2 deletions(-) create mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java create mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java create mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java create mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java create mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java create mode 100644 common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java index ca3aa1a44..53b5ef555 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java @@ -17,6 +17,7 @@ import com.dfsek.terra.addons.noise.config.CubicSplinePointTemplate; import com.dfsek.terra.addons.noise.config.DimensionApplicableNoiseSampler; import com.dfsek.terra.addons.noise.config.templates.BinaryArithmeticTemplate; +import com.dfsek.terra.addons.noise.config.templates.DerivativeNoiseSamplerTemplate; import com.dfsek.terra.addons.noise.config.templates.DomainWarpTemplate; import com.dfsek.terra.addons.noise.config.templates.FunctionTemplate; import com.dfsek.terra.addons.noise.config.templates.ImageSamplerTemplate; @@ -25,9 +26,11 @@ import com.dfsek.terra.addons.noise.config.templates.TranslateSamplerTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.CellularNoiseTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.ConstantNoiseTemplate; +import com.dfsek.terra.addons.noise.config.templates.noise.DerivativeFractalTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.DistanceSamplerTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.ExpressionFunctionTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.GaborNoiseTemplate; +import com.dfsek.terra.addons.noise.config.templates.noise.PseudoErosionTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.SimpleNoiseTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.fractal.BrownianMotionTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.fractal.PingPongTemplate; @@ -63,6 +66,7 @@ import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent; import com.dfsek.terra.api.event.functional.FunctionalEventHandler; import com.dfsek.terra.api.inject.annotations.Inject; +import com.dfsek.terra.api.noise.DerivativeNoiseSampler; import com.dfsek.terra.api.noise.NoiseSampler; import com.dfsek.terra.api.registry.CheckedRegistry; import com.dfsek.terra.api.util.reflection.TypeKey; @@ -94,7 +98,8 @@ public void initialize() { (type, o, loader, depthTracker) -> DistanceSampler.DistanceFunction.valueOf((String) o)) .applyLoader(DimensionApplicableNoiseSampler.class, DimensionApplicableNoiseSampler::new) .applyLoader(FunctionTemplate.class, FunctionTemplate::new) - .applyLoader(CubicSpline.Point.class, CubicSplinePointTemplate::new); + .applyLoader(CubicSpline.Point.class, CubicSplinePointTemplate::new) + .applyLoader(DerivativeNoiseSampler.class, DerivativeNoiseSamplerTemplate::new); noiseRegistry.register(addon.key("LINEAR"), LinearNormalizerTemplate::new); noiseRegistry.register(addon.key("NORMAL"), NormalNormalizerTemplate::new); @@ -117,7 +122,8 @@ public void initialize() { noiseRegistry.register(addon.key("PERLIN"), () -> new SimpleNoiseTemplate(PerlinSampler::new)); noiseRegistry.register(addon.key("SIMPLEX"), () -> new SimpleNoiseTemplate(SimplexSampler::new)); noiseRegistry.register(addon.key("GABOR"), GaborNoiseTemplate::new); - + noiseRegistry.register(addon.key("PSEUDOEROSION"), PseudoErosionTemplate::new); + noiseRegistry.register(addon.key("DERIVATIVE"), DerivativeFractalTemplate::new); noiseRegistry.register(addon.key("VALUE"), () -> new SimpleNoiseTemplate(ValueSampler::new)); noiseRegistry.register(addon.key("VALUE_CUBIC"), () -> new SimpleNoiseTemplate(ValueCubicSampler::new)); diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java new file mode 100644 index 000000000..4d01cc58b --- /dev/null +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java @@ -0,0 +1,25 @@ +package com.dfsek.terra.addons.noise.config.templates; + +import com.dfsek.tectonic.api.config.template.annotations.Value; +import com.dfsek.tectonic.api.exception.ValidationException; + +import com.dfsek.terra.api.noise.DerivativeNoiseSampler; +import com.dfsek.terra.api.noise.NoiseSampler; + + +public class DerivativeNoiseSamplerTemplate extends SamplerTemplate { + + @Value(".") + private NoiseSampler sampler; + + @Override + public boolean validate() throws ValidationException { + if (!(sampler instanceof DerivativeNoiseSampler)) throw new ValidationException("Provided sampler does not support calculating a derivative"); + return super.validate(); + } + + @Override + public DerivativeNoiseSampler get() { + return (DerivativeNoiseSampler) sampler; + } +} diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java new file mode 100644 index 000000000..9387651a2 --- /dev/null +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java @@ -0,0 +1,32 @@ +package com.dfsek.terra.addons.noise.config.templates.noise; + +import com.dfsek.tectonic.api.config.template.annotations.Default; +import com.dfsek.tectonic.api.config.template.annotations.Value; + +import com.dfsek.terra.addons.noise.config.templates.SamplerTemplate; +import com.dfsek.terra.addons.noise.samplers.noise.simplex.DerivativeFractal; + + +public class DerivativeFractalTemplate extends SamplerTemplate { + + @Value("octaves") + @Default + private int octaves = 3; + + @Value("gain") + @Default + private double gain = 0.5; + + @Value("lacunarity") + @Default + private double lacunarity = 2.0; + + @Value("frequency") + @Default + private double frequency = 0.02; + + @Override + public DerivativeFractal get() { + return new DerivativeFractal(octaves, gain, lacunarity, frequency); + } +} diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java new file mode 100644 index 000000000..b81c053f7 --- /dev/null +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java @@ -0,0 +1,62 @@ +package com.dfsek.terra.addons.noise.config.templates.noise; + +import com.dfsek.tectonic.api.config.template.annotations.Default; +import com.dfsek.tectonic.api.config.template.annotations.Value; + +import com.dfsek.terra.addons.noise.config.templates.SamplerTemplate; +import com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion; +import com.dfsek.terra.api.noise.DerivativeNoiseSampler; + + +public class PseudoErosionTemplate extends SamplerTemplate { + + @Value("octaves") + @Default + private int octaves = 4; + + @Value("lacunarity") + @Default + private double lacunarity = 2.0; + + @Value("gain") + @Default + private double gain = 0.5; + + @Value("slope-strength") + @Default + private double slopeStrength = 1.0; + + @Value("branch-strength") + @Default + private double branchStrength = 1.0; + + @Value("strength") + @Default + private double strength = 0.04; + + @Value("erosion-frequency") + @Default + private double erosionFrequency = 0.02; + + @Value("sampler") + private DerivativeNoiseSampler heightSampler; + + @Value("slope-mask.enable") + @Default + private boolean slopeMask = true; + + @Value("slope-mask.none") + @Default + private double slopeMaskNone = -0.5; + + @Value("slope-mask.full") + @Default + private double slopeMaskFull = 1; + + @Override + public PseudoErosion get() { + return new PseudoErosion(octaves, gain, lacunarity, + slopeStrength, branchStrength, strength, + erosionFrequency, heightSampler, slopeMask, slopeMaskFull, slopeMaskNone); + } +} diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java new file mode 100644 index 000000000..45928a619 --- /dev/null +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java @@ -0,0 +1,104 @@ +package com.dfsek.terra.addons.noise.samplers.noise.simplex; + +import com.dfsek.terra.api.noise.DerivativeNoiseSampler; + +import static com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion.dot; +import static com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion.hash; +import static com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion.hashX; +import static com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion.hashY; + + +/** + * Temporary sampler that provides derivatives to test pseudoerosion, should be replaced with + * derivative versions of existing samplers + */ +public class DerivativeFractal implements DerivativeNoiseSampler { + + private final int heightOctaves; + private final double heightGain; + private final double heightLacunarity; + private final double frequency; + + public DerivativeFractal(int octaves, double gain, double lacunarity, double frequency) { + this.heightOctaves = octaves; + this.heightGain = gain; + this.heightLacunarity = lacunarity; + this.frequency = frequency; + } + + private static float[] baseNoise(float px, float py) { + float ix = (float)Math.floor(px); + float iy = (float)Math.floor(py); + float fx = px - ix; + float fy = py - iy; + + float ux = fx * fx * fx * (fx * (fx * 6.0f - 15.0f) + 10.0f); + float uy = fy * fy * fy * (fy * (fy * 6.0f - 15.0f) + 10.0f); + float dux = fx * fx * 30.0f * (fx * (fx - 2.0f) + 1.0f); + float duy = fy * fy * 30.0f * (fy * (fy - 2.0f) + 1.0f); + + float gan = hash(ix, iy); + float gax = hashX(gan); + float gay = hashY(gan); + + float gbn = hash(ix + 1, iy); + float gbx = hashX(gbn); + float gby = hashY(gbn); + + float gcn = hash(ix, iy + 1); + float gcx = hashX(gcn); + float gcy = hashY(gcn); + + float gdn = hash(ix + 1, iy + 1); + float gdx = hashX(gdn); + float gdy = hashY(gdn); + + float va = dot(gax, gay, fx, fy); + float vb = dot(gbx, gby, fx - 1, fy); + float vc = dot(gcx, gcy, fx, fy - 1); + float vd = dot(gdx, gdy, fx - 1, fy - 1); + + float u2x = gax + (gbx - gax) * ux + (gcx - gax) * uy + (gax - gbx - gcx + gdx) * ux * uy + dux * (uy * (va - vb - vc + vd) + vb - va); + float u2y = gay + (gby - gay) * ux + (gcy - gay) * uy + (gay - gby - gcy + gdy) * ux * uy + duy * (ux * (va - vb - vc + vd) + vc - va); + + return new float[] { va + ux * (vb - va) + uy * (vc - va) + ux * uy * (va - vb - vc + vd), u2x, u2y }; + } + + @Override + public double[] noised(long seed, double x, double y) { + x *= frequency; + y *= frequency; + double[] out = { 0.0f, 0.0f, 0.0f }; + float heightFreq = 1.0f; + float heightAmp = 1f; + float cumAmp = 0.0f; + for (int i = 0; i < heightOctaves; i++) { + float[] noise = baseNoise((float) (x * heightFreq), (float) (y * heightFreq)); + out[0] += noise[0] * heightAmp; + out[1] += noise[1] * heightAmp * heightFreq; + out[2] += noise[2] * heightAmp * heightFreq; + cumAmp += heightAmp; + heightAmp *= heightGain; + heightFreq *= heightLacunarity; + } + out[0] /= cumAmp; + out[1] /= cumAmp; + out[2] /= cumAmp; + return out; + } + + @Override + public double[] noised(long seed, double x, double y, double z) { + return noised(seed, x, z); + } + + @Override + public double noise(long seed, double x, double y) { + return noised(seed, x, y)[0]; + } + + @Override + public double noise(long seed, double x, double y, double z) { + return noised(seed, x, y, z)[0]; + } +} diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java new file mode 100644 index 000000000..ca4ce8212 --- /dev/null +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java @@ -0,0 +1,179 @@ +package com.dfsek.terra.addons.noise.samplers.noise.simplex; + + +import com.dfsek.terra.api.noise.DerivativeNoiseSampler; +import com.dfsek.terra.api.noise.NoiseSampler; +import com.dfsek.terra.api.util.MathUtil; + + +public class PseudoErosion implements NoiseSampler { + public static final float TAU = (float) (2.0 * Math.PI); + private static final float HASH_X = 0.3183099f; + private static final float HASH_Y = 0.3678794f; + private final int octaves; + public final double gain; + public final double lacunarity; + public final double slopeStrength; + public final double branchStrength; + public final double erosionStrength; + private final double erosionFrequency; + private final DerivativeNoiseSampler sampler; + private final boolean slopeMask; + private final double slopeMaskFullSq; + private final double slopeMaskNoneSq; + + public PseudoErosion(int octaves, double gain, double lacunarity, double slopeStrength, double branchStrength, double erosionStrength, double erosionFrequency, DerivativeNoiseSampler sampler, + boolean slopeMask, double slopeMaskFull, double slopeMaskNone) { + this.octaves = octaves; + this.gain = gain; + this.lacunarity = lacunarity; + this.slopeStrength = slopeStrength; + this.branchStrength = branchStrength; + this.erosionStrength = erosionStrength; + this.erosionFrequency = erosionFrequency; + this.sampler = sampler; + this.slopeMask = slopeMask; + // Square these values and maintain sign since they're compared to a + // squared value, otherwise a sqrt would need to be used + this.slopeMaskFullSq = slopeMaskFull * slopeMaskFull * Math.signum(slopeMaskFull); + this.slopeMaskNoneSq = slopeMaskNone * slopeMaskNone * Math.signum((slopeMaskNone)); + } + + public static float hash(float x, float y) { + float xx = x * HASH_X + HASH_Y; + float yy = y * HASH_Y + HASH_X; + + // Swapped the components here + return 16 * (xx * yy * (xx + yy)); + } + + public static float hashX(float n) { + // Swapped the components here + float nx = HASH_X * n; + return -1.0f + 2.0f * fract(nx); + } + + public static float hashY(float n) { + float ny = HASH_Y * n; + return -1.0f + 2.0f * fract(ny); + } + + public static float fract(float x) { + return (x - (float)Math.floor(x)); + } + + public static float[] erosion(float x, float y, float dirX, float dirY) { + float gridX = (float) Math.floor(x); + float gridY = (float) Math.floor(y); + float localX = x - gridX; + float localY = y - gridY; + float noise = 0.0f; + float dirOutX = 0.0f; + float dirOutY = 0.0f; + float cumAmp = 0.0f; + + for (int cellX = -2; cellX < 2; cellX++) { + for (int cellY = -2; cellY < 2; cellY++) { + // TODO - Make seed affect hashing + float cellHash = hash(gridX - (float) cellX, gridY - (float) cellY); + float cellOffsetX = hashX(cellHash) * 0.5f; + float cellOffsetY = hashY(cellHash) * 0.5f; + float cellOriginDeltaX = cellX - cellOffsetX + localX; + float cellOriginDeltaY = cellY - cellOffsetY + localY; + float cellOriginDistSq = dot(cellOriginDeltaX, cellOriginDeltaY, cellOriginDeltaX, cellOriginDeltaY); + float amp = (float)exp(-cellOriginDistSq * 2.0); // Exponentially decrease amplitude further from cell center + cumAmp += amp; + float directionalStrength = dot(cellOriginDeltaX, cellOriginDeltaY, dirX, dirY) * TAU; + noise += (float) (MathUtil.cos(directionalStrength) * amp); + float sinAngle = (float) MathUtil.sin(directionalStrength) * amp; + dirOutX -= sinAngle * (cellOriginDeltaX + dirX); + dirOutY -= sinAngle * (cellOriginDeltaY + dirY); + } + } + + noise /= cumAmp; + dirOutX /= cumAmp; + dirOutY /= cumAmp; + + return new float[] {noise, dirOutX, dirOutY}; + } + + public static double exp(double val) { + final long tmp = (long) (1512775 * val + 1072632447); + return Double.longBitsToDouble(tmp << 32); + } + + public static float smoothstep(float edge0, float edge1, float x) { + // Scale, bias and saturate x to 0..1 range + x = clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f); + // Evaluate polynomial + return x * x * (3 - 2 * x); + } + + public static float clamp(float x, float minVal, float maxVal) { + return Math.max(minVal, Math.min(maxVal, x)); + } + + public float heightMap(long seed, float x, float y) { + double[] sample = sampler.noised(seed, x, y); + float height = (float) sample[0]; + float heightDirX = (float) sample[1]; + float heightDirY = (float) sample[2]; + + // Take the curl of the normal to get the gradient facing down the slope + float baseDirX = heightDirY * (float) slopeStrength; + float baseDirY = -heightDirX * (float) slopeStrength; + + float erosion = 0.0f; + float dirX = 0.0f; + float dirY = 0.0f; + float amp = 1.0f; + float cumAmp = 0.0f; + float freq = 1.0f; + + // Stack erosion octaves + for (int i = 0; i < octaves; i++) { + float[] erosionResult = erosion( + x * freq * (float) erosionFrequency, + y * freq * (float) erosionFrequency, + baseDirX + dirY * (float) branchStrength, + baseDirY - dirX * (float) branchStrength); + erosion += erosionResult[0] * amp; + dirX += erosionResult[1] * amp * freq; + dirY += erosionResult[2] * amp * freq; + cumAmp += amp; + amp *= gain; + freq *= lacunarity; + } + + // TODO - Test different output ranges, see how they affect visuals + // Normalize erosion noise + erosion /= cumAmp; + // [-1, 1] -> [0, 1] + erosion = erosion * 0.5F + 0.5F; + + // Without masking, erosion noise in areas with small gradients tend to produce mounds, + // this reduces erosion amplitude towards smaller gradients to avoid this + if (slopeMask) { + float dirMagSq = dot(baseDirX, baseDirY, baseDirX, baseDirY); + float flatness = smoothstep((float) slopeMaskNoneSq, (float) slopeMaskFullSq, dirMagSq); + erosion *= flatness; + } + + return (float) (height + erosion * erosionStrength); + } + + public static float dot(float x1, float y1, float x2, float y2) { + return x1 * x2 + y1 * y2; + } + + @Override + public double noise(long seed, double x, double y) { + return heightMap(seed, (float) x, (float) y); + } + + @Override + public double noise(long seed, double x, double y, double z) { + return noise(seed, x, z); + } +} \ No newline at end of file diff --git a/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java b/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java new file mode 100644 index 000000000..12bc1e36d --- /dev/null +++ b/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java @@ -0,0 +1,22 @@ +package com.dfsek.terra.api.noise; + +/** + * A NoiseSampler which additionally provides directional derivatives + */ +public interface DerivativeNoiseSampler extends NoiseSampler { + + static boolean providesDerivative(NoiseSampler sampler) { + if (sampler instanceof DerivativeNoiseSampler dSampler) { + return dSampler.isDerivable(); + } + return false; + } + + default boolean isDerivable() { + return false; + } + + double[] noised(long seed, double x, double y); + + double[] noised(long seed, double x, double y, double z); +} From 41652d29dfa4dc6e95911ab10e4e3919f7504433 Mon Sep 17 00:00:00 2001 From: Astrash Date: Fri, 19 Apr 2024 21:05:52 +1000 Subject: [PATCH 072/126] Use proper check for derivative sampler validation --- .../noise/config/templates/DerivativeNoiseSamplerTemplate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java index 4d01cc58b..de6dbac3a 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java @@ -14,7 +14,7 @@ public class DerivativeNoiseSamplerTemplate extends SamplerTemplate Date: Fri, 19 Apr 2024 21:07:53 +1000 Subject: [PATCH 073/126] Require implementing derivable check --- .../noise/samplers/noise/simplex/DerivativeFractal.java | 5 +++++ .../com/dfsek/terra/api/noise/DerivativeNoiseSampler.java | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java index 45928a619..bbf5d8e5c 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java @@ -64,6 +64,11 @@ private static float[] baseNoise(float px, float py) { return new float[] { va + ux * (vb - va) + uy * (vc - va) + ux * uy * (va - vb - vc + vd), u2x, u2y }; } + @Override + public boolean isDerivable() { + return true; + } + @Override public double[] noised(long seed, double x, double y) { x *= frequency; diff --git a/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java b/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java index 12bc1e36d..5f341ada2 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java +++ b/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java @@ -12,9 +12,7 @@ static boolean providesDerivative(NoiseSampler sampler) { return false; } - default boolean isDerivable() { - return false; - } + boolean isDerivable(); double[] noised(long seed, double x, double y); From ff03b38b814ef4db4e1fcfe8fd559365735ada28 Mon Sep 17 00:00:00 2001 From: Astrash Date: Fri, 19 Apr 2024 21:25:16 +1000 Subject: [PATCH 074/126] Derivative API documentation --- .../DerivativeNoiseSamplerTemplate.java | 2 +- .../noise/simplex/DerivativeFractal.java | 2 +- .../api/noise/DerivativeNoiseSampler.java | 31 ++++++++++++++++--- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java index de6dbac3a..d93054ac9 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java @@ -14,7 +14,7 @@ public class DerivativeNoiseSamplerTemplate extends SamplerTemplate Date: Sat, 20 Apr 2024 15:55:59 +1000 Subject: [PATCH 075/126] Reduce number of erosion impulses A reduction of impulse evaluations from 5^2 to 3^2, original algorithm used exponential falloff function which required evaluating impulses from further away to avoid artifacts. I've changed it to a parabolic falloff function which is exactly 0 at the largest possible distance from a cell origin, meaning any cells further than that will not have an effect, preventing said artifacting from occurring. The parabolic function could be replaced with an exponential function (or any other similar easing function) as long as it has an x-intercept at maxCellDistSq. In addition, an option to control whether averaging impulses has been added as it has more of a visual impact with the aforementioned changes. --- .../noise/PseudoErosionTemplate.java | 10 +++- .../samplers/noise/simplex/PseudoErosion.java | 48 +++++++++++-------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java index b81c053f7..f5e1ac46c 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java @@ -53,10 +53,18 @@ public class PseudoErosionTemplate extends SamplerTemplate { @Default private double slopeMaskFull = 1; + @Value("jitter") + @Default + private double jitterModifier = 1; + + @Value("average-impulses") + @Default + private boolean averageErosionImpulses = true; + @Override public PseudoErosion get() { return new PseudoErosion(octaves, gain, lacunarity, slopeStrength, branchStrength, strength, - erosionFrequency, heightSampler, slopeMask, slopeMaskFull, slopeMaskNone); + erosionFrequency, heightSampler, slopeMask, slopeMaskFull, slopeMaskNone, jitterModifier, averageErosionImpulses); } } diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java index ca4ce8212..41b1e2db8 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java @@ -21,9 +21,14 @@ public class PseudoErosion implements NoiseSampler { private final boolean slopeMask; private final double slopeMaskFullSq; private final double slopeMaskNoneSq; + private final double jitter; + private final double maxCellDistSq; + private final double maxCellDistSqRecip; + private final boolean averageErosionImpulses; public PseudoErosion(int octaves, double gain, double lacunarity, double slopeStrength, double branchStrength, double erosionStrength, double erosionFrequency, DerivativeNoiseSampler sampler, - boolean slopeMask, double slopeMaskFull, double slopeMaskNone) { + boolean slopeMask, double slopeMaskFull, double slopeMaskNone, double jitterModifier, + boolean averageErosionImpulses) { this.octaves = octaves; this.gain = gain; this.lacunarity = lacunarity; @@ -37,6 +42,10 @@ public PseudoErosion(int octaves, double gain, double lacunarity, double slopeSt // squared value, otherwise a sqrt would need to be used this.slopeMaskFullSq = slopeMaskFull * slopeMaskFull * Math.signum(slopeMaskFull); this.slopeMaskNoneSq = slopeMaskNone * slopeMaskNone * Math.signum((slopeMaskNone)); + this.jitter = 0.43701595 * jitterModifier; + this.averageErosionImpulses = averageErosionImpulses; + this.maxCellDistSq = 1 + jitter * jitter; + this.maxCellDistSqRecip = 1 / maxCellDistSq; } public static float hash(float x, float y) { @@ -62,26 +71,25 @@ public static float fract(float x) { return (x - (float)Math.floor(x)); } - public static float[] erosion(float x, float y, float dirX, float dirY) { - float gridX = (float) Math.floor(x); - float gridY = (float) Math.floor(y); - float localX = x - gridX; - float localY = y - gridY; + public float[] erosion(float x, float y, float dirX, float dirY) { + int gridX = Math.round(x); + int gridY = Math.round(y); float noise = 0.0f; float dirOutX = 0.0f; float dirOutY = 0.0f; float cumAmp = 0.0f; - for (int cellX = -2; cellX < 2; cellX++) { - for (int cellY = -2; cellY < 2; cellY++) { + for (int cellX = gridX - 1; cellX <= gridX + 1; cellX++) { + for (int cellY = gridY - 1; cellY <= gridY + 1; cellY++) { // TODO - Make seed affect hashing - float cellHash = hash(gridX - (float) cellX, gridY - (float) cellY); - float cellOffsetX = hashX(cellHash) * 0.5f; - float cellOffsetY = hashY(cellHash) * 0.5f; - float cellOriginDeltaX = cellX - cellOffsetX + localX; - float cellOriginDeltaY = cellY - cellOffsetY + localY; - float cellOriginDistSq = dot(cellOriginDeltaX, cellOriginDeltaY, cellOriginDeltaX, cellOriginDeltaY); - float amp = (float)exp(-cellOriginDistSq * 2.0); // Exponentially decrease amplitude further from cell center + float cellHash = hash(cellX, cellY); + float cellOffsetX = (float) (hashX(cellHash) * jitter); + float cellOffsetY = (float) (hashY(cellHash) * jitter); + float cellOriginDeltaX = (x - cellX) + cellOffsetX; + float cellOriginDeltaY = (y - cellY) + cellOffsetY; + float cellOriginDistSq = cellOriginDeltaX * cellOriginDeltaX + cellOriginDeltaY * cellOriginDeltaY; + if (cellOriginDistSq > maxCellDistSq) continue; // Skip calculating cells too far away + float ampTmp = (float) ((cellOriginDistSq * maxCellDistSqRecip) - 1); float amp = ampTmp * ampTmp; // Decrease cell amplitude further away cumAmp += amp; float directionalStrength = dot(cellOriginDeltaX, cellOriginDeltaY, dirX, dirY) * TAU; noise += (float) (MathUtil.cos(directionalStrength) * amp); @@ -90,11 +98,11 @@ public static float[] erosion(float x, float y, float dirX, float dirY) { dirOutY -= sinAngle * (cellOriginDeltaY + dirY); } } - - noise /= cumAmp; - dirOutX /= cumAmp; - dirOutY /= cumAmp; - + if (averageErosionImpulses && cumAmp != 0) { + noise /= cumAmp; + dirOutX /= cumAmp; + dirOutY /= cumAmp; + } return new float[] {noise, dirOutX, dirOutY}; } From 62317a2f3f4a2b03e0749e5e0a4bca6a284dee83 Mon Sep 17 00:00:00 2001 From: Gavin Tran Date: Sun, 21 Apr 2024 14:48:46 -0400 Subject: [PATCH 076/126] Add SaltedNoiseFunctions --- .../noise/SaltedNoiseFunction2.java | 38 +++++++++++++++++++ .../noise/SaltedNoiseFunction3.java | 38 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java create mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction3.java diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java new file mode 100644 index 000000000..16f3b2a8e --- /dev/null +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java @@ -0,0 +1,38 @@ +package com.dfsek.terra.addons.noise.paralithic.noise; + +import com.dfsek.paralithic.functions.dynamic.Context; +import com.dfsek.paralithic.functions.dynamic.DynamicFunction; +import com.dfsek.paralithic.node.Statefulness; + +import com.dfsek.terra.api.noise.NoiseSampler; + +import org.jetbrains.annotations.NotNull; + + +public class SaltedNoiseFunction2 implements DynamicFunction { + private final NoiseSampler gen; + + public SaltedNoiseFunction2(NoiseSampler gen) { + this.gen = gen; + } + + @Override + public double eval(double... args) { + throw new UnsupportedOperationException("Cannot evaluate seeded function without seed context."); + } + + @Override + public double eval(Context context, double... args) { + return gen.noise(((SeedContext) context).getSeed() + (long) args[2], args[0], args[1]); + } + + @Override + public int getArgNumber() { + return 3; + } + + @Override + public @NotNull Statefulness statefulness() { + return Statefulness.CONTEXTUAL; + } +} diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction3.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction3.java new file mode 100644 index 000000000..5dc483d5c --- /dev/null +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction3.java @@ -0,0 +1,38 @@ +package com.dfsek.terra.addons.noise.paralithic.noise; + +import com.dfsek.paralithic.functions.dynamic.Context; +import com.dfsek.paralithic.functions.dynamic.DynamicFunction; +import com.dfsek.paralithic.node.Statefulness; + +import com.dfsek.terra.api.noise.NoiseSampler; + +import org.jetbrains.annotations.NotNull; + + +public class SaltedNoiseFunction3 implements DynamicFunction { + private final NoiseSampler gen; + + public SaltedNoiseFunction3(NoiseSampler gen) { + this.gen = gen; + } + + @Override + public double eval(double... args) { + throw new UnsupportedOperationException("Cannot evaluate seeded function without seed context."); + } + + @Override + public double eval(Context context, double... args) { + return gen.noise(((SeedContext) context).getSeed() + (long) args[3], args[0], args[1], args[2]); + } + + @Override + public int getArgNumber() { + return 4; + } + + @Override + public @NotNull Statefulness statefulness() { + return Statefulness.CONTEXTUAL; + } +} From 72f761678af082d8f8a13d2d34ca920afae0c80e Mon Sep 17 00:00:00 2001 From: Gavin Tran Date: Sun, 21 Apr 2024 14:54:45 -0400 Subject: [PATCH 077/126] Add SaltedNoiseFunctions in sampler conversion --- .../addons/noise/paralithic/FunctionUtil.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/FunctionUtil.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/FunctionUtil.java index 5dbc740ec..ef4fe2aeb 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/FunctionUtil.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/FunctionUtil.java @@ -11,6 +11,8 @@ import com.dfsek.terra.addons.noise.paralithic.defined.UserDefinedFunction; import com.dfsek.terra.addons.noise.paralithic.noise.NoiseFunction2; import com.dfsek.terra.addons.noise.paralithic.noise.NoiseFunction3; +import com.dfsek.terra.addons.noise.paralithic.noise.SaltedNoiseFunction2; +import com.dfsek.terra.addons.noise.paralithic.noise.SaltedNoiseFunction3; public class FunctionUtil { @@ -23,10 +25,15 @@ public static Map convertFunctionsAndSamplers(Map entry : functions.entrySet()) { functionMap.put(entry.getKey(), UserDefinedFunction.newInstance(entry.getValue())); } - samplers.forEach((id, sampler) -> functionMap.put(id, - sampler.getDimensions() == 2 ? - new NoiseFunction2(sampler.getSampler()) : - new NoiseFunction3(sampler.getSampler()))); + samplers.forEach((id, sampler) -> { + if (sampler.getDimensions() == 2) { + functionMap.put(id, new NoiseFunction2(sampler.getSampler())); + functionMap.put(id + "Salted", new SaltedNoiseFunction2(sampler.getSampler())); + } else { + functionMap.put(id, new NoiseFunction3(sampler.getSampler())); + functionMap.put(id + "Salted", new SaltedNoiseFunction3(sampler.getSampler())); + } + }); return functionMap; } } From c20b1eaf107f9f616d20f4429c6d746118f14b8d Mon Sep 17 00:00:00 2001 From: Gavin Tran Date: Sun, 21 Apr 2024 15:39:48 -0400 Subject: [PATCH 078/126] Apply code style fixes --- .../com/dfsek/terra/addons/noise/paralithic/FunctionUtil.java | 2 +- .../addons/noise/paralithic/noise/SaltedNoiseFunction2.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/FunctionUtil.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/FunctionUtil.java index ef4fe2aeb..d47693cde 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/FunctionUtil.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/FunctionUtil.java @@ -26,7 +26,7 @@ public static Map convertFunctionsAndSamplers(Map { - if (sampler.getDimensions() == 2) { + if(sampler.getDimensions() == 2) { functionMap.put(id, new NoiseFunction2(sampler.getSampler())); functionMap.put(id + "Salted", new SaltedNoiseFunction2(sampler.getSampler())); } else { diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java index 16f3b2a8e..2e8f72929 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java @@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull; -public class SaltedNoiseFunction2 implements DynamicFunction { +public class SaltedNoiseFunction2 implements DynamicFunction { private final NoiseSampler gen; public SaltedNoiseFunction2(NoiseSampler gen) { From dd272bce64131b3470a3f30ecedbdb7be0d7fe4d Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Wed, 1 May 2024 17:04:34 -0600 Subject: [PATCH 079/126] WIP 1.20.6 --- buildSrc/build.gradle.kts | 6 ++-- buildSrc/src/main/kotlin/Versions.kt | 35 +++++++++---------- gradle/wrapper/gradle-wrapper.properties | 4 +-- .../config/BiomeParticleConfigTemplate.java | 3 +- .../java/com/dfsek/terra/mod/data/Codecs.java | 9 ++--- .../MinecraftChunkGeneratorWrapper.java | 3 +- .../mod/generation/TerraBiomeSource.java | 3 +- .../entity/MobSpawnerBlockEntityMixin.java | 4 +-- .../terra/block/state/BlockStateMixin.java | 3 +- .../src/main/resources/terra.accesswidener | 1 + 10 files changed, 38 insertions(+), 33 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 3bdfddef0..6b56f288f 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -17,10 +17,10 @@ repositories { dependencies { //TODO Allow pulling from Versions.kt implementation("com.github.johnrengelman", "shadow", "8.1.1") - implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.5.11") + implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.0") - implementation("org.ow2.asm", "asm", "9.6") - implementation("org.ow2.asm", "asm-tree", "9.6") + implementation("org.ow2.asm", "asm", "9.7") + implementation("org.ow2.asm", "asm-tree", "9.7") implementation("com.dfsek.tectonic", "common", "4.2.1") implementation("org.yaml", "snakeyaml", "2.2") } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index a150ac3b2..ba9195cc7 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -12,23 +12,22 @@ object Versions { const val caffeine = "3.1.8" - const val slf4j = "2.0.9" - const val log4j_slf4j_impl = "2.20.0" - + const val slf4j = "2.0.13" + object Internal { const val shadow = "8.1.1" - const val apacheText = "1.11.0" - const val apacheIO = "2.15.1" - const val guava = "32.1.3-jre" - const val asm = "9.6" + const val apacheText = "1.12.0" + const val apacheIO = "2.16.1" + const val guava = "33.1.0-jre" + const val asm = "9.7" const val snakeYml = "2.2" const val jetBrainsAnnotations = "24.1.0" - const val junit = "5.10.1" + const val junit = "5.10.2" } } object Fabric { - const val fabricAPI = "0.91.2+${Mod.minecraft}" + const val fabricAPI = "0.97.8+${Mod.minecraft}" } // // object Quilt { @@ -39,12 +38,12 @@ object Versions { object Mod { const val mixin = "0.12.5+mixin.0.8.5" - const val minecraft = "1.20.4" + const val minecraft = "1.20.6" const val yarn = "$minecraft+build.1" - const val fabricLoader = "0.15.1" + const val fabricLoader = "0.15.10" - const val architecuryLoom = "1.4.369" - const val architecturyPlugin = "3.4.151" + const val architecuryLoom = "1.6.395" + const val architecturyPlugin = "3.4.155" } // // object Forge { @@ -53,14 +52,14 @@ object Versions { // } object Bukkit { - const val minecraft = "1.20.4" - const val paperBuild = "$minecraft-R0.1-20231209.173338-2" + const val minecraft = "1.20.6" + const val paperBuild = "$minecraft-R0.1-20240501.172135-12" const val paper = paperBuild const val paperLib = "1.0.8" - const val reflectionRemapper = "0.1.0" + const val reflectionRemapper = "0.1.1" const val paperDevBundle = paperBuild - const val runPaper = "2.2.2" - const val paperWeight = "1.5.11" + const val runPaper = "2.3.0" + const val paperWeight = "1.7.0" } // diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index db8c3baaf..381baa9ce 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/BiomeParticleConfigTemplate.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/BiomeParticleConfigTemplate.java index 97c8c8ed7..3bc4474b6 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/BiomeParticleConfigTemplate.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/BiomeParticleConfigTemplate.java @@ -7,6 +7,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import net.minecraft.command.argument.ParticleEffectArgumentType; import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryWrapper; import net.minecraft.world.biome.BiomeParticleConfig; @@ -27,7 +28,7 @@ public BiomeParticleConfig get() { try { return new BiomeParticleConfig( - ParticleEffectArgumentType.readParameters(new StringReader(particle), Registries.PARTICLE_TYPE.getReadOnlyWrapper()), + ParticleEffectArgumentType.readParameters(new StringReader(particle), (RegistryWrapper.WrapperLookup) Registries.PARTICLE_TYPE.getReadOnlyWrapper()), probability); } catch(CommandSyntaxException e) { throw new RuntimeException(e); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/data/Codecs.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/data/Codecs.java index 595f5ec5b..ab7604fe5 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/data/Codecs.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/data/Codecs.java @@ -1,6 +1,7 @@ package com.dfsek.terra.mod.data; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.world.gen.chunk.ChunkGeneratorSettings; @@ -32,15 +33,15 @@ public final class Codecs { "No such config pack " + id))))); - public static final Codec TERRA_BIOME_SOURCE = RecordCodecBuilder - .create(instance -> instance.group( + public static final MapCodec TERRA_BIOME_SOURCE = RecordCodecBuilder + .mapCodec(instance -> instance.group( CONFIG_PACK.fieldOf("pack") .stable() .forGetter(TerraBiomeSource::getPack)) .apply(instance, instance.stable(TerraBiomeSource::new))); - public static final Codec MINECRAFT_CHUNK_GENERATOR_WRAPPER = RecordCodecBuilder - .create( + public static final MapCodec MINECRAFT_CHUNK_GENERATOR_WRAPPER = RecordCodecBuilder + .mapCodec( instance -> instance.group( TERRA_BIOME_SOURCE.fieldOf("biome_source") .stable() diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java index 899b007f0..8ac07a688 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java @@ -18,6 +18,7 @@ package com.dfsek.terra.mod.generation; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.registry.entry.RegistryEntry; @@ -85,7 +86,7 @@ public MinecraftChunkGeneratorWrapper(TerraBiomeSource biomeSource, ConfigPack c } @Override - protected Codec getCodec() { + protected MapCodec getCodec() { return Codecs.MINECRAFT_CHUNK_GENERATOR_WRAPPER; } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/TerraBiomeSource.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/TerraBiomeSource.java index 7aa5d8aea..533a8c98b 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/TerraBiomeSource.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/TerraBiomeSource.java @@ -18,6 +18,7 @@ package com.dfsek.terra.mod.generation; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.source.BiomeSource; @@ -47,7 +48,7 @@ public TerraBiomeSource(ConfigPack pack) { } @Override - protected Codec getCodec() { + protected MapCodec getCodec() { return Codecs.TERRA_BIOME_SOURCE; } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java index ccc8b738a..2ec582417 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java @@ -50,7 +50,7 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS public abstract MobSpawnerLogic getLogic(); @Shadow - public abstract void method_46408(net.minecraft.entity.EntityType entityType, Random random); + public abstract void setEntityType(net.minecraft.entity.EntityType entityType, Random random); public EntityType terra$getSpawnedType() { return (EntityType) Registries.ENTITY_TYPE.get( @@ -64,7 +64,7 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS } else { rand = Random.create(); } - method_46408((net.minecraft.entity.EntityType) creatureType, rand); + setEntityType((net.minecraft.entity.EntityType) creatureType, rand); } public int terra$getDelay() { diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/state/BlockStateMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/state/BlockStateMixin.java index 7053dd4f5..9ecb3eccc 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/state/BlockStateMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/state/BlockStateMixin.java @@ -3,6 +3,7 @@ import com.google.common.collect.ImmutableMap; import com.mojang.serialization.MapCodec; +import it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap; import net.minecraft.block.AbstractBlock.AbstractBlockState; import net.minecraft.block.Block; import net.minecraft.registry.Registries; @@ -24,7 +25,7 @@ @Mixin(AbstractBlockState.class) @Implements(@Interface(iface = BlockState.class, prefix = "terra$")) public abstract class BlockStateMixin extends State { - private BlockStateMixin(Block owner, ImmutableMap, Comparable> entries, + private BlockStateMixin(Block owner, Reference2ObjectArrayMap, Comparable> entries, MapCodec codec) { super(owner, entries, codec); } diff --git a/platforms/mixin-common/src/main/resources/terra.accesswidener b/platforms/mixin-common/src/main/resources/terra.accesswidener index d638bbf45..50cba4f7d 100644 --- a/platforms/mixin-common/src/main/resources/terra.accesswidener +++ b/platforms/mixin-common/src/main/resources/terra.accesswidener @@ -1,3 +1,4 @@ accessWidener v1 named accessible class net/minecraft/world/biome/Biome$Weather accessible class net/minecraft/world/gen/WorldPresets$Registrar +accessible method net/minecraft/block/FluidBlock getFluidState (Lnet/minecraft/block/BlockState;)Lnet/minecraft/fluid/FluidState From 17acde09a31d81063a29b877d0bfdd9381e09b68 Mon Sep 17 00:00:00 2001 From: Oak Date: Fri, 31 May 2024 12:11:07 +0100 Subject: [PATCH 080/126] Updated Bukkit to 1.20.6 --- .github/workflows/gradle-build.yml | 4 ++-- buildSrc/build.gradle.kts | 2 +- buildSrc/src/main/kotlin/Versions.kt | 4 ++-- platforms/bukkit/build.gradle.kts | 2 +- platforms/bukkit/nms/{v1_20_R3 => v1_20_R6}/build.gradle.kts | 0 .../dfsek/terra/bukkit/nms/v1_20_R6}/AwfulBukkitHacks.java | 2 +- .../com/dfsek/terra/bukkit/nms/v1_20_R6}/NMSBiomeInfo.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R6}/NMSBiomeInjector.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R6}/NMSBiomeProvider.java | 2 +- .../bukkit/nms/v1_20_R6}/NMSChunkGeneratorDelegate.java | 4 ++-- .../com/dfsek/terra/bukkit/nms/v1_20_R6}/NMSInitializer.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R6}/NMSInjectListener.java | 4 ++-- .../dfsek/terra/bukkit/nms/v1_20_R6}/NMSWorldProperties.java | 2 +- .../com/dfsek/terra/bukkit/nms/v1_20_R6}/Reflection.java | 2 +- .../dfsek/terra/bukkit/nms/v1_20_R6}/RegistryFetcher.java | 5 ++--- 15 files changed, 19 insertions(+), 20 deletions(-) rename platforms/bukkit/nms/{v1_20_R3 => v1_20_R6}/build.gradle.kts (100%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6}/AwfulBukkitHacks.java (99%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6}/NMSBiomeInfo.java (83%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6}/NMSBiomeInjector.java (98%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6}/NMSBiomeProvider.java (97%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6}/NMSChunkGeneratorDelegate.java (98%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6}/NMSInitializer.java (90%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6}/NMSInjectListener.java (95%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6}/NMSWorldProperties.java (94%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6}/Reflection.java (97%) rename platforms/bukkit/nms/{v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3 => v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6}/RegistryFetcher.java (84%) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 3e40fe7be..2117c7eee 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 with: - java-version: '17' + java-version: '21' distribution: 'temurin' server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 6b56f288f..2bf3aa5a7 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -17,7 +17,7 @@ repositories { dependencies { //TODO Allow pulling from Versions.kt implementation("com.github.johnrengelman", "shadow", "8.1.1") - implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.0") + implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.1") implementation("org.ow2.asm", "asm", "9.7") implementation("org.ow2.asm", "asm-tree", "9.7") diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index ba9195cc7..5169834f0 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -53,13 +53,13 @@ object Versions { object Bukkit { const val minecraft = "1.20.6" - const val paperBuild = "$minecraft-R0.1-20240501.172135-12" + const val paperBuild = "$minecraft-R0.1-20240530.204353-104" const val paper = paperBuild const val paperLib = "1.0.8" const val reflectionRemapper = "0.1.1" const val paperDevBundle = paperBuild const val runPaper = "2.3.0" - const val paperWeight = "1.7.0" + const val paperWeight = "1.7.1" } // diff --git a/platforms/bukkit/build.gradle.kts b/platforms/bukkit/build.gradle.kts index 6f75b0133..a63703c55 100644 --- a/platforms/bukkit/build.gradle.kts +++ b/platforms/bukkit/build.gradle.kts @@ -10,7 +10,7 @@ repositories { dependencies { shaded(project(":platforms:bukkit:common")) - shaded(project(":platforms:bukkit:nms:v1_20_R3", configuration = "reobf")) + shaded(project(":platforms:bukkit:nms:v1_20_R6", configuration = "reobf")) shaded("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) } diff --git a/platforms/bukkit/nms/v1_20_R3/build.gradle.kts b/platforms/bukkit/nms/v1_20_R6/build.gradle.kts similarity index 100% rename from platforms/bukkit/nms/v1_20_R3/build.gradle.kts rename to platforms/bukkit/nms/v1_20_R6/build.gradle.kts diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/AwfulBukkitHacks.java similarity index 99% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/AwfulBukkitHacks.java index fa2cc9907..d6352afb8 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/AwfulBukkitHacks.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/AwfulBukkitHacks.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R6; import com.google.common.collect.ImmutableMap; import com.mojang.serialization.Lifecycle; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInfo.java similarity index 83% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInfo.java index f47d21c56..fe3cbcf77 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInfo.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInfo.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R6; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.biome.Biome; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInjector.java similarity index 98% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInjector.java index e75b6fc0a..77b3c2701 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeInjector.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInjector.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R6; import net.minecraft.core.Holder; import net.minecraft.core.Registry; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeProvider.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeProvider.java index 875a77fb5..e72819aba 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSBiomeProvider.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeProvider.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R6; import com.mojang.serialization.Codec; import net.minecraft.core.Holder; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSChunkGeneratorDelegate.java similarity index 98% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSChunkGeneratorDelegate.java index 4338dc140..49c956eda 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSChunkGeneratorDelegate.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSChunkGeneratorDelegate.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R6; import com.mojang.serialization.Codec; import net.minecraft.core.BlockPos; @@ -19,7 +19,7 @@ import net.minecraft.world.level.levelgen.Heightmap.Types; import net.minecraft.world.level.levelgen.RandomState; import net.minecraft.world.level.levelgen.blending.Blender; -import org.bukkit.craftbukkit.v1_20_R3.block.data.CraftBlockData; +import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInitializer.java similarity index 90% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInitializer.java index 084c5c30a..625275cf0 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInitializer.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInitializer.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R6; import org.bukkit.Bukkit; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInjectListener.java similarity index 95% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInjectListener.java index a81e93a3f..fddc03f9c 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSInjectListener.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInjectListener.java @@ -1,9 +1,9 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R6; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.chunk.ChunkGenerator; import org.bukkit.World; -import org.bukkit.craftbukkit.v1_20_R3.CraftWorld; +import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.world.WorldInitEvent; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSWorldProperties.java similarity index 94% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSWorldProperties.java index 60f6cee46..d322a2bff 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/NMSWorldProperties.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSWorldProperties.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R6; import net.minecraft.world.level.LevelHeightAccessor; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/Reflection.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/Reflection.java index 32243da54..0b229acd2 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/Reflection.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/Reflection.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R6; import net.minecraft.core.Holder; import net.minecraft.core.Holder.Reference; diff --git a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/RegistryFetcher.java similarity index 84% rename from platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/RegistryFetcher.java index 6dbbecbc7..de2258d09 100644 --- a/platforms/bukkit/nms/v1_20_R3/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R3/RegistryFetcher.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/RegistryFetcher.java @@ -1,12 +1,11 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R3; +package com.dfsek.terra.bukkit.nms.v1_20_R6; import net.minecraft.core.Registry; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.world.level.biome.Biome; -import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_20_R3.CraftServer; +import org.bukkit.craftbukkit.CraftServer; public class RegistryFetcher { From 3fa4b21247c15de31208d24ef921cb9908793188 Mon Sep 17 00:00:00 2001 From: Oak Date: Sun, 2 Jun 2024 21:27:07 +0100 Subject: [PATCH 081/126] Attempted to fix paper versions --- buildSrc/src/main/kotlin/Versions.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 5169834f0..ada0b6147 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -53,11 +53,11 @@ object Versions { object Bukkit { const val minecraft = "1.20.6" - const val paperBuild = "$minecraft-R0.1-20240530.204353-104" + const val paperBuild = "$minecraft-R0.1-20240601.143523-106" const val paper = paperBuild const val paperLib = "1.0.8" const val reflectionRemapper = "0.1.1" - const val paperDevBundle = paperBuild + const val paperDevBundle = "$minecraft-R0.1-20240601.143523-105" const val runPaper = "2.3.0" const val paperWeight = "1.7.1" } From 4536767794d36174e1fe46cb1dfa0f3f36833aed Mon Sep 17 00:00:00 2001 From: Oak Date: Mon, 3 Jun 2024 11:36:50 +0100 Subject: [PATCH 082/126] Updated to 1.20.6 --- buildSrc/build.gradle.kts | 2 +- buildSrc/src/main/kotlin/CompilationConfig.kt | 4 ++-- buildSrc/src/main/kotlin/DependencyConfig.kt | 2 +- buildSrc/src/main/kotlin/Versions.kt | 2 +- .../terra/bukkit/handles/BukkitWorldHandle.java | 2 +- .../java/com/dfsek/terra/bukkit/nms/Initializer.java | 2 +- .../nms/{v1_20_R6 => v1_20_6}/AwfulBukkitHacks.java | 6 +++--- .../nms/{v1_20_R6 => v1_20_6}/NMSBiomeInfo.java | 2 +- .../nms/{v1_20_R6 => v1_20_6}/NMSBiomeInjector.java | 2 +- .../nms/{v1_20_R6 => v1_20_6}/NMSBiomeProvider.java | 12 ++++++++---- .../NMSChunkGeneratorDelegate.java | 8 ++++---- .../nms/{v1_20_R6 => v1_20_6}/NMSInitializer.java | 2 +- .../nms/{v1_20_R6 => v1_20_6}/NMSInjectListener.java | 2 +- .../{v1_20_R6 => v1_20_6}/NMSWorldProperties.java | 2 +- .../bukkit/nms/{v1_20_R6 => v1_20_6}/Reflection.java | 2 +- .../nms/{v1_20_R6 => v1_20_6}/RegistryFetcher.java | 3 ++- 16 files changed, 30 insertions(+), 25 deletions(-) rename platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/{v1_20_R6 => v1_20_6}/AwfulBukkitHacks.java (97%) rename platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/{v1_20_R6 => v1_20_6}/NMSBiomeInfo.java (83%) rename platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/{v1_20_R6 => v1_20_6}/NMSBiomeInjector.java (98%) rename platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/{v1_20_R6 => v1_20_6}/NMSBiomeProvider.java (75%) rename platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/{v1_20_R6 => v1_20_6}/NMSChunkGeneratorDelegate.java (97%) rename platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/{v1_20_R6 => v1_20_6}/NMSInitializer.java (90%) rename platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/{v1_20_R6 => v1_20_6}/NMSInjectListener.java (97%) rename platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/{v1_20_R6 => v1_20_6}/NMSWorldProperties.java (94%) rename platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/{v1_20_R6 => v1_20_6}/Reflection.java (97%) rename platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/{v1_20_R6 => v1_20_6}/RegistryFetcher.java (91%) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 2bf3aa5a7..3d319e8c7 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -9,7 +9,7 @@ repositories { maven("https://repo.codemc.org/repository/maven-public") { name = "CodeMC" } - maven("https://papermc.io/repo/repository/maven-public/") { + maven("https://repo.papermc.io/repository/maven-public/") { name = "PaperMC" } } diff --git a/buildSrc/src/main/kotlin/CompilationConfig.kt b/buildSrc/src/main/kotlin/CompilationConfig.kt index 952b91091..f0d1e7829 100644 --- a/buildSrc/src/main/kotlin/CompilationConfig.kt +++ b/buildSrc/src/main/kotlin/CompilationConfig.kt @@ -22,8 +22,8 @@ fun Project.configureCompilation() { apply() configure { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } tasks.withType { diff --git a/buildSrc/src/main/kotlin/DependencyConfig.kt b/buildSrc/src/main/kotlin/DependencyConfig.kt index 58bde514c..0778808d8 100644 --- a/buildSrc/src/main/kotlin/DependencyConfig.kt +++ b/buildSrc/src/main/kotlin/DependencyConfig.kt @@ -36,7 +36,7 @@ fun Project.configureDependencies() { maven("https://repo.codemc.org/repository/maven-public") { name = "CodeMC" } - maven("https://papermc.io/repo/repository/maven-public/") { + maven("https://repo.papermc.io/repository/maven-public/") { name = "PaperMC" } maven("https://files.minecraftforge.net/maven/") { diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index ada0b6147..748399512 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -53,7 +53,7 @@ object Versions { object Bukkit { const val minecraft = "1.20.6" - const val paperBuild = "$minecraft-R0.1-20240601.143523-106" + const val paperBuild = "$minecraft-R0.1-20240602.222958-107" const val paper = paperBuild const val paperLib = "1.0.8" const val reflectionRemapper = "0.1.1" diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java index e3b92b069..c6113bbd7 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java @@ -72,7 +72,7 @@ public BukkitWorldHandle() { String entityID = id.toUpperCase(Locale.ROOT).substring(10); return new BukkitEntityType(switch(entityID) { - case "END_CRYSTAL" -> org.bukkit.entity.EntityType.ENDER_CRYSTAL; + case "END_CRYSTAL" -> org.bukkit.entity.EntityType.END_CRYSTAL; case "ENDER_CRYSTAL" -> throw new IllegalArgumentException( "Invalid entity identifier " + id); // make sure this issue can't happen the other way around. default -> org.bukkit.entity.EntityType.valueOf(entityID); diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java index 413250d57..2b9217847 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java @@ -8,7 +8,7 @@ public interface Initializer { - String NMS = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]; + String NMS = "v" + Bukkit.getServer().getMinecraftVersion().replace(".", "_"); String TERRA_PACKAGE = Initializer.class.getPackageName(); static boolean init(PlatformImpl platform) { diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/AwfulBukkitHacks.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/AwfulBukkitHacks.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/AwfulBukkitHacks.java index d6352afb8..d052b8109 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/AwfulBukkitHacks.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/AwfulBukkitHacks.java @@ -1,10 +1,10 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R6; +package com.dfsek.terra.bukkit.nms.v1_20_6; import com.google.common.collect.ImmutableMap; -import com.mojang.serialization.Lifecycle; import net.minecraft.core.Holder; import net.minecraft.core.Holder.Reference; import net.minecraft.core.MappedRegistry; +import net.minecraft.core.RegistrationInfo; import net.minecraft.core.WritableRegistry; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; @@ -49,7 +49,7 @@ public static void registerBiomes(ConfigRegistry configRegistry) { new ResourceLocation("terra", NMSBiomeInjector.createBiomeID(pack, key)) ); - Reference holder = biomeRegistry.register(delegateKey, platform, Lifecycle.stable()); + Reference holder = biomeRegistry.register(delegateKey, platform, RegistrationInfo.BUILT_IN); Reflection.REFERENCE.invokeBindValue(holder, platform); // IMPORTANT: bind holder. platformBiome.getContext().put(new NMSBiomeInfo(delegateKey)); diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInfo.java similarity index 83% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInfo.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInfo.java index fe3cbcf77..a62604447 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInfo.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInfo.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R6; +package com.dfsek.terra.bukkit.nms.v1_20_6; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.biome.Biome; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInjector.java similarity index 98% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInjector.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInjector.java index 77b3c2701..deba15dec 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeInjector.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInjector.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R6; +package com.dfsek.terra.bukkit.nms.v1_20_6; import net.minecraft.core.Holder; import net.minecraft.core.Registry; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeProvider.java similarity index 75% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeProvider.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeProvider.java index e72819aba..79861c7e4 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSBiomeProvider.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeProvider.java @@ -1,6 +1,6 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R6; +package com.dfsek.terra.bukkit.nms.v1_20_6; -import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import net.minecraft.core.Holder; import net.minecraft.core.Registry; import net.minecraft.world.level.biome.Biome; @@ -35,8 +35,12 @@ protected Stream> collectPossibleBiomes() { } @Override - protected @NotNull Codec codec() { - return BiomeSource.CODEC; + protected @NotNull MapCodec codec() { + return MapCodec.assumeMapUnsafe(BiomeSource.CODEC); +// return MapCodec.unit(null); +// BuiltInRegistries.BIOME_SOURCE.byNameCodec().dispatchMap(this::codec, Function.identity()); +// BuiltInRegistries.BIOME_SOURCE.byNameCodec().dispatchStable(BiomeSource::codec, Function.identity()); +// return BiomeSource.CODEC; } @Override diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSChunkGeneratorDelegate.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSChunkGeneratorDelegate.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSChunkGeneratorDelegate.java index 49c956eda..0aadfcb9e 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSChunkGeneratorDelegate.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSChunkGeneratorDelegate.java @@ -1,6 +1,6 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R6; +package com.dfsek.terra.bukkit.nms.v1_20_6; -import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.server.level.WorldGenRegion; import net.minecraft.world.level.LevelAccessor; @@ -54,8 +54,8 @@ public NMSChunkGeneratorDelegate(ChunkGenerator vanilla, ConfigPack pack, NMSBio } @Override - protected @NotNull Codec codec() { - return ChunkGenerator.CODEC; + protected @NotNull MapCodec codec() { + return MapCodec.assumeMapUnsafe(ChunkGenerator.CODEC); } @Override diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInitializer.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInitializer.java similarity index 90% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInitializer.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInitializer.java index 625275cf0..8ac1b46c9 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInitializer.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInitializer.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R6; +package com.dfsek.terra.bukkit.nms.v1_20_6; import org.bukkit.Bukkit; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInjectListener.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInjectListener.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInjectListener.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInjectListener.java index fddc03f9c..22e153139 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSInjectListener.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInjectListener.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R6; +package com.dfsek.terra.bukkit.nms.v1_20_6; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.chunk.ChunkGenerator; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSWorldProperties.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSWorldProperties.java similarity index 94% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSWorldProperties.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSWorldProperties.java index d322a2bff..386192103 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/NMSWorldProperties.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSWorldProperties.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R6; +package com.dfsek.terra.bukkit.nms.v1_20_6; import net.minecraft.world.level.LevelHeightAccessor; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/Reflection.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/Reflection.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/Reflection.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/Reflection.java index 0b229acd2..77652cd6e 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/Reflection.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/Reflection.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R6; +package com.dfsek.terra.bukkit.nms.v1_20_6; import net.minecraft.core.Holder; import net.minecraft.core.Holder.Reference; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/RegistryFetcher.java b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/RegistryFetcher.java similarity index 91% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/RegistryFetcher.java rename to platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/RegistryFetcher.java index de2258d09..ca511dffa 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_R6/RegistryFetcher.java +++ b/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/RegistryFetcher.java @@ -1,10 +1,11 @@ -package com.dfsek.terra.bukkit.nms.v1_20_R6; +package com.dfsek.terra.bukkit.nms.v1_20_6; import net.minecraft.core.Registry; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.world.level.biome.Biome; +import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; From 9e60db4b0da03f59c7991a93659b9c4ea40f8362 Mon Sep 17 00:00:00 2001 From: Oak Date: Mon, 10 Jun 2024 11:07:24 +0100 Subject: [PATCH 083/126] Updated MinecraftVersionInfo --- .../main/java/com/dfsek/terra/bukkit/util/VersionUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java index 6bc06a437..848befc60 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java @@ -77,13 +77,13 @@ public boolean isSpigot() { public static final class MinecraftVersionInfo { private static final Logger logger = LoggerFactory.getLogger(MinecraftVersionInfo.class); - private static final Pattern VERSION_PATTERN = Pattern.compile("v?(\\d+)_(\\d+)_R(\\d+)"); + private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)"); private final int major; private final int minor; private final int patch; private MinecraftVersionInfo() { - this(Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]); + this(Bukkit.getServer().getMinecraftVersion()); } private MinecraftVersionInfo(int major, int minor, int patch) { From 4e7de501c038be60df2f18004de6d7323e5a4282 Mon Sep 17 00:00:00 2001 From: Oak Date: Sun, 16 Jun 2024 19:21:34 +0100 Subject: [PATCH 084/126] Updated bukkit platform to 1.21 --- buildSrc/src/main/kotlin/Versions.kt | 6 ++--- platforms/bukkit/build.gradle.kts | 2 +- .../nms/{v1_20_R6 => v1_21}/build.gradle.kts | 0 .../bukkit/nms/v1_21}/AwfulBukkitHacks.java | 6 ++--- .../terra/bukkit/nms/v1_21}/NMSBiomeInfo.java | 2 +- .../bukkit/nms/v1_21}/NMSBiomeInjector.java | 2 +- .../bukkit/nms/v1_21}/NMSBiomeProvider.java | 2 +- .../nms/v1_21}/NMSChunkGeneratorDelegate.java | 11 ++++----- .../bukkit/nms/v1_21}/NMSInitializer.java | 2 +- .../bukkit/nms/v1_21}/NMSInjectListener.java | 23 +++++++++++++++++-- .../bukkit/nms/v1_21}/NMSWorldProperties.java | 2 +- .../terra/bukkit/nms/v1_21}/Reflection.java | 2 +- .../bukkit/nms/v1_21}/RegistryFetcher.java | 2 +- 13 files changed, 40 insertions(+), 22 deletions(-) rename platforms/bukkit/nms/{v1_20_R6 => v1_21}/build.gradle.kts (100%) rename platforms/bukkit/nms/{v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6 => v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21}/AwfulBukkitHacks.java (93%) rename platforms/bukkit/nms/{v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6 => v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21}/NMSBiomeInfo.java (83%) rename platforms/bukkit/nms/{v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6 => v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21}/NMSBiomeInjector.java (98%) rename platforms/bukkit/nms/{v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6 => v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21}/NMSBiomeProvider.java (97%) rename platforms/bukkit/nms/{v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6 => v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21}/NMSChunkGeneratorDelegate.java (93%) rename platforms/bukkit/nms/{v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6 => v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21}/NMSInitializer.java (90%) rename platforms/bukkit/nms/{v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6 => v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21}/NMSInjectListener.java (61%) rename platforms/bukkit/nms/{v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6 => v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21}/NMSWorldProperties.java (94%) rename platforms/bukkit/nms/{v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6 => v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21}/Reflection.java (97%) rename platforms/bukkit/nms/{v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6 => v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21}/RegistryFetcher.java (94%) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 748399512..512af9721 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -52,12 +52,12 @@ object Versions { // } object Bukkit { - const val minecraft = "1.20.6" - const val paperBuild = "$minecraft-R0.1-20240602.222958-107" + const val minecraft = "1.21" + const val paperBuild = "$minecraft-R0.1-20240615.005026-1" const val paper = paperBuild const val paperLib = "1.0.8" const val reflectionRemapper = "0.1.1" - const val paperDevBundle = "$minecraft-R0.1-20240601.143523-105" + const val paperDevBundle = paperBuild const val runPaper = "2.3.0" const val paperWeight = "1.7.1" } diff --git a/platforms/bukkit/build.gradle.kts b/platforms/bukkit/build.gradle.kts index a63703c55..95924dadd 100644 --- a/platforms/bukkit/build.gradle.kts +++ b/platforms/bukkit/build.gradle.kts @@ -10,7 +10,7 @@ repositories { dependencies { shaded(project(":platforms:bukkit:common")) - shaded(project(":platforms:bukkit:nms:v1_20_R6", configuration = "reobf")) + shaded(project(":platforms:bukkit:nms:v1_21", configuration = "reobf")) shaded("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper) } diff --git a/platforms/bukkit/nms/v1_20_R6/build.gradle.kts b/platforms/bukkit/nms/v1_21/build.gradle.kts similarity index 100% rename from platforms/bukkit/nms/v1_20_R6/build.gradle.kts rename to platforms/bukkit/nms/v1_21/build.gradle.kts diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java similarity index 93% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/AwfulBukkitHacks.java rename to platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java index d052b8109..d16bbbf30 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/AwfulBukkitHacks.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_6; +package com.dfsek.terra.bukkit.nms.v1_21; import com.google.common.collect.ImmutableMap; import net.minecraft.core.Holder; @@ -41,12 +41,12 @@ public static void registerBiomes(ConfigRegistry configRegistry) { try { BukkitPlatformBiome platformBiome = (BukkitPlatformBiome) biome.getPlatformBiome(); NamespacedKey vanillaBukkitKey = platformBiome.getHandle().getKey(); - ResourceLocation vanillaMinecraftKey = new ResourceLocation(vanillaBukkitKey.getNamespace(), vanillaBukkitKey.getKey()); + ResourceLocation vanillaMinecraftKey = ResourceLocation.fromNamespaceAndPath(vanillaBukkitKey.getNamespace(), vanillaBukkitKey.getKey()); Biome platform = NMSBiomeInjector.createBiome(biome, Objects.requireNonNull(biomeRegistry.get(vanillaMinecraftKey))); ResourceKey delegateKey = ResourceKey.create( Registries.BIOME, - new ResourceLocation("terra", NMSBiomeInjector.createBiomeID(pack, key)) + ResourceLocation.fromNamespaceAndPath("terra", NMSBiomeInjector.createBiomeID(pack, key)) ); Reference holder = biomeRegistry.register(delegateKey, platform, RegistrationInfo.BUILT_IN); diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInfo.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeInfo.java similarity index 83% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInfo.java rename to platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeInfo.java index a62604447..5bf85aa6d 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInfo.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeInfo.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_6; +package com.dfsek.terra.bukkit.nms.v1_21; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.biome.Biome; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInjector.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeInjector.java similarity index 98% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInjector.java rename to platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeInjector.java index deba15dec..e6d1f7869 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeInjector.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeInjector.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_6; +package com.dfsek.terra.bukkit.nms.v1_21; import net.minecraft.core.Holder; import net.minecraft.core.Registry; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeProvider.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeProvider.java rename to platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeProvider.java index 79861c7e4..18184144f 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSBiomeProvider.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeProvider.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_6; +package com.dfsek.terra.bukkit.nms.v1_21; import com.mojang.serialization.MapCodec; import net.minecraft.core.Holder; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSChunkGeneratorDelegate.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSChunkGeneratorDelegate.java similarity index 93% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSChunkGeneratorDelegate.java rename to platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSChunkGeneratorDelegate.java index 0aadfcb9e..16097df27 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSChunkGeneratorDelegate.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSChunkGeneratorDelegate.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_6; +package com.dfsek.terra.bukkit.nms.v1_21; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; @@ -26,7 +26,6 @@ import java.util.List; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; import com.dfsek.terra.api.config.ConfigPack; import com.dfsek.terra.api.world.biome.generation.BiomeProvider; @@ -87,10 +86,10 @@ public int getGenDepth() { } @Override - public @NotNull CompletableFuture fillFromNoise(@NotNull Executor executor, @NotNull Blender blender, - @NotNull RandomState noiseConfig, - @NotNull StructureManager structureAccessor, @NotNull ChunkAccess chunk) { - return vanilla.fillFromNoise(executor, blender, noiseConfig, structureAccessor, chunk) + public CompletableFuture fillFromNoise(@NotNull Blender blender, + @NotNull RandomState noiseConfig, + @NotNull StructureManager structureAccessor, @NotNull ChunkAccess chunk) { + return vanilla.fillFromNoise(blender, noiseConfig, structureAccessor, chunk) .thenApply(c -> { LevelAccessor level = Reflection.STRUCTURE_MANAGER.getLevel(structureAccessor); BiomeProvider biomeProvider = pack.getBiomeProvider(); diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInitializer.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInitializer.java similarity index 90% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInitializer.java rename to platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInitializer.java index 8ac1b46c9..18f1a058f 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInitializer.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInitializer.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_6; +package com.dfsek.terra.bukkit.nms.v1_21; import org.bukkit.Bukkit; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInjectListener.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java similarity index 61% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInjectListener.java rename to platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java index 22e153139..98510ff88 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSInjectListener.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java @@ -1,7 +1,9 @@ -package com.dfsek.terra.bukkit.nms.v1_20_6; +package com.dfsek.terra.bukkit.nms.v1_21; +import net.minecraft.server.level.ChunkMap; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.chunk.ChunkGenerator; +import net.minecraft.world.level.chunk.status.WorldGenContext; import org.bukkit.World; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.event.EventHandler; @@ -10,6 +12,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.reflect.Field; import java.util.HashSet; import java.util.Set; import java.util.concurrent.locks.ReentrantLock; @@ -37,8 +40,24 @@ public void onWorldInit(WorldInitEvent event) { ChunkGenerator vanilla = serverWorld.getChunkSource().getGenerator(); NMSBiomeProvider provider = new NMSBiomeProvider(pack.getBiomeProvider(), craftWorld.getSeed()); + ChunkMap chunkMap = serverWorld.getChunkSource().chunkMap; - serverWorld.getChunkSource().chunkMap.generator = new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()); + try { + Field worldGenContextField = chunkMap.getClass().getDeclaredField("worldGenContext"); + worldGenContextField.setAccessible(true); + + WorldGenContext worldGenContext = (WorldGenContext) worldGenContextField.get(chunkMap); + worldGenContextField.set(chunkMap, + new WorldGenContext( + worldGenContext.level(), + new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()), + worldGenContext.structureManager(), + worldGenContext.lightEngine(), + worldGenContext.mainThreadMailBox() + )); + } catch(NoSuchFieldException | IllegalAccessException e) { + throw new RuntimeException(e); + } LOGGER.info("Successfully injected into world."); diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSWorldProperties.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSWorldProperties.java similarity index 94% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSWorldProperties.java rename to platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSWorldProperties.java index 386192103..7860cf530 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/NMSWorldProperties.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSWorldProperties.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_6; +package com.dfsek.terra.bukkit.nms.v1_21; import net.minecraft.world.level.LevelHeightAccessor; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/Reflection.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/Reflection.java similarity index 97% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/Reflection.java rename to platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/Reflection.java index 77652cd6e..57e1b8c9c 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/Reflection.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/Reflection.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_6; +package com.dfsek.terra.bukkit.nms.v1_21; import net.minecraft.core.Holder; import net.minecraft.core.Holder.Reference; diff --git a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/RegistryFetcher.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/RegistryFetcher.java similarity index 94% rename from platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/RegistryFetcher.java rename to platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/RegistryFetcher.java index ca511dffa..0377eea0f 100644 --- a/platforms/bukkit/nms/v1_20_R6/src/main/java/com/dfsek/terra/bukkit/nms/v1_20_6/RegistryFetcher.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/RegistryFetcher.java @@ -1,4 +1,4 @@ -package com.dfsek.terra.bukkit.nms.v1_20_6; +package com.dfsek.terra.bukkit.nms.v1_21; import net.minecraft.core.Registry; import net.minecraft.core.registries.Registries; From d810cad8d05b77a9a344751800ed3cf79c791611 Mon Sep 17 00:00:00 2001 From: Oak Date: Mon, 17 Jun 2024 15:50:06 +0100 Subject: [PATCH 085/126] Adjusted code for Spigot compatibility --- .../main/java/com/dfsek/terra/bukkit/nms/Initializer.java | 5 +++-- .../main/java/com/dfsek/terra/bukkit/util/VersionUtil.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java index 2b9217847..db50be325 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java @@ -1,6 +1,7 @@ package com.dfsek.terra.bukkit.nms; -import org.bukkit.Bukkit; +import com.dfsek.terra.bukkit.util.VersionUtil; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -8,7 +9,7 @@ public interface Initializer { - String NMS = "v" + Bukkit.getServer().getMinecraftVersion().replace(".", "_"); + String NMS = "v" + VersionUtil.getMinecraftVersionInfo().toString().replace(".", "_"); String TERRA_PACKAGE = Initializer.class.getPackageName(); static boolean init(PlatformImpl platform) { diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java index 848befc60..97f4b713f 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java @@ -83,7 +83,7 @@ public static final class MinecraftVersionInfo { private final int patch; private MinecraftVersionInfo() { - this(Bukkit.getServer().getMinecraftVersion()); + this(Bukkit.getServer().getBukkitVersion().split("-")[0]); } private MinecraftVersionInfo(int major, int minor, int patch) { From 0758e13bc76fd1276ee6f81a3a57dca8b03c7e35 Mon Sep 17 00:00:00 2001 From: Oak Date: Wed, 19 Jun 2024 13:33:55 +0100 Subject: [PATCH 086/126] Made patch version optional as not all Minecraft versions have a patch number --- .../java/com/dfsek/terra/bukkit/nms/Initializer.java | 2 +- .../java/com/dfsek/terra/bukkit/util/VersionUtil.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java index db50be325..1ca6f8c3f 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java @@ -9,7 +9,7 @@ public interface Initializer { - String NMS = "v" + VersionUtil.getMinecraftVersionInfo().toString().replace(".", "_"); + String NMS = VersionUtil.getMinecraftVersionInfo().toString().replace(".", "_"); String TERRA_PACKAGE = Initializer.class.getPackageName(); static boolean init(PlatformImpl platform) { diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java index 97f4b713f..6a8c662e0 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java @@ -77,7 +77,7 @@ public boolean isSpigot() { public static final class MinecraftVersionInfo { private static final Logger logger = LoggerFactory.getLogger(MinecraftVersionInfo.class); - private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)"); + private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)(?:\\.(\\d+))?"); private final int major; private final int minor; private final int patch; @@ -97,7 +97,7 @@ private MinecraftVersionInfo(String versionString) { if(versionMatcher.find()) { major = Integer.parseInt(versionMatcher.group(1)); minor = Integer.parseInt(versionMatcher.group(2)); - patch = Integer.parseInt(versionMatcher.group(3)); + patch = versionMatcher.group(3) != null ? Integer.parseInt(versionMatcher.group(3)) : -1; } else { logger.warn("Error while parsing minecraft version info. Continuing launch, but setting all versions to -1."); @@ -112,7 +112,11 @@ public String toString() { if(major == -1 && minor == -1 && patch == -1) return "Unknown"; - return String.format("v%d.%d.%d", major, minor, patch); + if (patch >= 0) { + return String.format("v%d.%d.%d", major, minor, patch); + } else { + return String.format("v%d.%d", major, minor); + } } public int getMajor() { From fddc9a52b94eb326c95513adc63cb2cf0e560ec8 Mon Sep 17 00:00:00 2001 From: Oak Date: Wed, 19 Jun 2024 13:34:35 +0100 Subject: [PATCH 087/126] Temporarily disabled commands whilst awaiting Cloud Framework update --- .../com/dfsek/terra/bukkit/TerraBukkitPlugin.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java index 555d073c7..b6c9a6e1d 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java @@ -96,13 +96,14 @@ private PaperCommandManager getCommandSenderPaperCommandManager() CommandExecutionCoordinator.simpleCoordinator(), BukkitAdapter::adapt, BukkitAdapter::adapt); - if(commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) { - commandManager.registerBrigadier(); - final CloudBrigadierManager brigManager = commandManager.brigadierManager(); - if(brigManager != null) { - brigManager.setNativeNumberSuggestions(false); - } - } + // TODO: Uncomment once Cloud has updated for 1.21 +// if(commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) { +// commandManager.registerBrigadier(); +// final CloudBrigadierManager brigManager = commandManager.brigadierManager(); +// if(brigManager != null) { +// brigManager.setNativeNumberSuggestions(false); +// } +// } if(commandManager.hasCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION)) { commandManager.registerAsynchronousCompletions(); From e7cc2753401d7ca67739a036b26665492fd3d185 Mon Sep 17 00:00:00 2001 From: Oak Date: Sun, 23 Jun 2024 14:16:50 +0100 Subject: [PATCH 088/126] Corrected issues with worldGenContext not correctly being set (Ref: https://stackoverflow.com/questions/56039341/get-declared-fields-of-java-lang-reflect-fields-in-jdk12/56043252#56043252) --- .../api/util/reflection/ReflectionUtil.java | 21 +++++++++++++++ .../bukkit/nms/v1_21/NMSInjectListener.java | 26 +++++++++---------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/common/api/src/main/java/com/dfsek/terra/api/util/reflection/ReflectionUtil.java b/common/api/src/main/java/com/dfsek/terra/api/util/reflection/ReflectionUtil.java index 8e35c3f9f..6b0c8fd28 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/util/reflection/ReflectionUtil.java +++ b/common/api/src/main/java/com/dfsek/terra/api/util/reflection/ReflectionUtil.java @@ -8,6 +8,7 @@ package com.dfsek.terra.api.util.reflection; import org.jetbrains.annotations.NotNull; +import sun.misc.Unsafe; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; @@ -26,6 +27,18 @@ public final class ReflectionUtil { + private static final Unsafe UNSAFE; + + static { + try{ + final Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe"); + unsafeField.setAccessible(true); + UNSAFE = (Unsafe) unsafeField.get(null); + } catch(NoSuchFieldException | IllegalAccessException e){ + throw new RuntimeException(e); + } + } + public static Field[] getFields(@NotNull Class type) { Field[] result = type.getDeclaredFields(); Class parentClass = type.getSuperclass(); @@ -35,6 +48,14 @@ public static Field[] getFields(@NotNull Class type) { return result; } + public static void setFinalField(Object obj, String fieldName, Object value) throws NoSuchFieldException { + Field field = obj.getClass().getDeclaredField(fieldName); + field.setAccessible(true); + long fieldOffset = UNSAFE.objectFieldOffset(field); + + UNSAFE.putObject(obj, fieldOffset, value); + } + public static Method[] getMethods(@NotNull Class type) { Method[] result = type.getDeclaredMethods(); Class parentClass = type.getSuperclass(); diff --git a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java index 98510ff88..b471faa88 100644 --- a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java @@ -1,9 +1,12 @@ package com.dfsek.terra.bukkit.nms.v1_21; +import com.dfsek.terra.api.util.reflection.ReflectionUtil; + import net.minecraft.server.level.ChunkMap; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.chunk.status.WorldGenContext; +import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.event.EventHandler; @@ -12,7 +15,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.lang.reflect.Field; import java.util.HashSet; import java.util.Set; import java.util.concurrent.locks.ReentrantLock; @@ -41,21 +43,17 @@ public void onWorldInit(WorldInitEvent event) { ChunkGenerator vanilla = serverWorld.getChunkSource().getGenerator(); NMSBiomeProvider provider = new NMSBiomeProvider(pack.getBiomeProvider(), craftWorld.getSeed()); ChunkMap chunkMap = serverWorld.getChunkSource().chunkMap; + WorldGenContext worldGenContext = chunkMap.worldGenContext; try { - Field worldGenContextField = chunkMap.getClass().getDeclaredField("worldGenContext"); - worldGenContextField.setAccessible(true); - - WorldGenContext worldGenContext = (WorldGenContext) worldGenContextField.get(chunkMap); - worldGenContextField.set(chunkMap, - new WorldGenContext( - worldGenContext.level(), - new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()), - worldGenContext.structureManager(), - worldGenContext.lightEngine(), - worldGenContext.mainThreadMailBox() - )); - } catch(NoSuchFieldException | IllegalAccessException e) { + ReflectionUtil.setFinalField(chunkMap, "worldGenContext", new WorldGenContext( + worldGenContext.level(), + new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()), + worldGenContext.structureManager(), + worldGenContext.lightEngine(), + worldGenContext.mainThreadMailBox() + )); + } catch(NoSuchFieldException e) { throw new RuntimeException(e); } From 44d23573b3c2c4f19f8b56492ac9c8218a83cfac Mon Sep 17 00:00:00 2001 From: Oak Date: Sat, 20 Jul 2024 20:17:25 +0100 Subject: [PATCH 089/126] Updated dependencies to Paper 1.21 snapshot --- buildSrc/src/main/kotlin/Versions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 512af9721..933986d54 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -53,7 +53,7 @@ object Versions { object Bukkit { const val minecraft = "1.21" - const val paperBuild = "$minecraft-R0.1-20240615.005026-1" + const val paperBuild = "$minecraft-R0.1-SNAPSHOT" const val paper = paperBuild const val paperLib = "1.0.8" const val reflectionRemapper = "0.1.1" From 922cd35e84f2968e559051542f7b652bf612ebf8 Mon Sep 17 00:00:00 2001 From: OakLoaf Date: Fri, 16 Aug 2024 11:07:03 +0100 Subject: [PATCH 090/126] Updated Cloud dependency to v2 --- buildSrc/src/main/kotlin/Versions.kt | 4 +- .../commands/addons/AddonsCommandAddon.java | 12 +- .../commands/packs/PacksCommandAddon.java | 20 +-- .../profiler/ProfilerCommandAddon.java | 28 ++--- .../structure/StructureCommandAddon.java | 25 ++-- common/api/build.gradle.kts | 2 +- .../command/arguments/RegistryArgument.java | 117 ++++++++---------- .../platform/CommandRegistrationEvent.java | 4 +- platforms/bukkit/common/build.gradle.kts | 2 +- .../dfsek/terra/bukkit/TerraBukkitPlugin.java | 42 ++++--- platforms/fabric/build.gradle.kts | 10 +- platforms/mixin-lifecycle/build.gradle.kts | 2 +- .../terra/lifecycle/LifecycleEntryPoint.java | 3 +- 13 files changed, 133 insertions(+), 138 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 933986d54..f6e2606e0 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -8,7 +8,9 @@ object Versions { const val paralithic = "0.7.1" const val strata = "1.3.2" - const val cloud = "1.8.4" + const val cloud = "2.0.0-rc.2" + const val cloudPaper = "2.0.0-beta.9" + const val cloudFabric = "2.0.0-beta.7" const val caffeine = "3.1.8" diff --git a/common/addons/command-addons/src/main/java/com/dfsek/terra/addons/commands/addons/AddonsCommandAddon.java b/common/addons/command-addons/src/main/java/com/dfsek/terra/addons/commands/addons/AddonsCommandAddon.java index 58a22ef7a..3277c0089 100644 --- a/common/addons/command-addons/src/main/java/com/dfsek/terra/addons/commands/addons/AddonsCommandAddon.java +++ b/common/addons/command-addons/src/main/java/com/dfsek/terra/addons/commands/addons/AddonsCommandAddon.java @@ -1,8 +1,5 @@ package com.dfsek.terra.addons.commands.addons; -import cloud.commandframework.ArgumentDescription; -import cloud.commandframework.CommandManager; - import com.dfsek.terra.addons.manifest.api.AddonInitializer; import com.dfsek.terra.api.Platform; import com.dfsek.terra.api.addon.BaseAddon; @@ -12,6 +9,9 @@ import com.dfsek.terra.api.event.functional.FunctionalEventHandler; import com.dfsek.terra.api.inject.annotations.Inject; +import org.incendo.cloud.CommandManager; +import org.incendo.cloud.description.Description; + public class AddonsCommandAddon implements AddonInitializer { @Inject @@ -30,7 +30,7 @@ public void initialize() { CommandManager manager = event.getCommandManager(); manager.command( - manager.commandBuilder("addons", ArgumentDescription.of("List installed Terra addons")) + manager.commandBuilder("addons", Description.of("List installed Terra addons")) .permission("terra.addons") .handler(context -> { StringBuilder addons = new StringBuilder("Installed addons:\n"); @@ -41,7 +41,7 @@ public void initialize() { .append('@') .append(addon.getVersion().getFormatted()) .append('\n')); - context.getSender().sendMessage(addons.toString()); + context.sender().sendMessage(addons.toString()); }) ) .command( @@ -61,7 +61,7 @@ public void initialize() { .append('@') .append(versions.getFormatted()) .append('\n')); - context.getSender().sendMessage(addonInfo.toString()); + context.sender().sendMessage(addonInfo.toString()); }) ); }); diff --git a/common/addons/command-packs/src/main/java/com/dfsek/terra/addons/commands/packs/PacksCommandAddon.java b/common/addons/command-packs/src/main/java/com/dfsek/terra/addons/commands/packs/PacksCommandAddon.java index 1d99af328..6b840ef1f 100644 --- a/common/addons/command-packs/src/main/java/com/dfsek/terra/addons/commands/packs/PacksCommandAddon.java +++ b/common/addons/command-packs/src/main/java/com/dfsek/terra/addons/commands/packs/PacksCommandAddon.java @@ -1,7 +1,7 @@ package com.dfsek.terra.addons.commands.packs; -import cloud.commandframework.ArgumentDescription; -import cloud.commandframework.CommandManager; +import org.incendo.cloud.CommandManager; +import org.incendo.cloud.description.Description; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,7 +35,7 @@ public void initialize() { CommandManager manager = event.getCommandManager(); manager.command( - manager.commandBuilder("packs", ArgumentDescription.of("List installed config packs")) + manager.commandBuilder("packs", Description.of("List installed config packs")) .permission("terra.packs") .handler(context -> { StringBuilder packs = new StringBuilder("Installed packs:\n"); @@ -43,12 +43,12 @@ public void initialize() { .append(pack.getID()) .append('@') .append(pack.getVersion().getFormatted())); - context.getSender().sendMessage(packs.toString()); + context.sender().sendMessage(packs.toString()); }) ) .command( manager.commandBuilder("packs") - .literal("info", ArgumentDescription.of("Get information about a pack")) + .literal("info", Description.of("Get information about a pack")) .permission("terra.packs.info") .argument(RegistryArgument.of("pack", platform.getConfigRegistry())) .handler(context -> { @@ -65,21 +65,21 @@ public void initialize() { .append('@') .append(versions.getFormatted()) .append('\n')); - context.getSender().sendMessage(packInfo.toString()); + context.sender().sendMessage(packInfo.toString()); })) .command( manager.commandBuilder("packs") - .literal("reload", ArgumentDescription.of("Reload config packs")) + .literal("reload", Description.of("Reload config packs")) .permission("terra.packs.reload") .handler(context -> { - context.getSender().sendMessage("Reloading Terra..."); + context.sender().sendMessage("Reloading Terra..."); logger.info("Reloading Terra..."); if(platform.reload()) { logger.info("Terra reloaded successfully."); - context.getSender().sendMessage("Terra reloaded successfully."); + context.sender().sendMessage("Terra reloaded successfully."); } else { logger.error("Terra failed to reload."); - context.getSender().sendMessage( + context.sender().sendMessage( "Terra failed to reload. See logs for more information."); } })); diff --git a/common/addons/command-profiler/src/main/java/com/dfsek/terra/addons/commands/profiler/ProfilerCommandAddon.java b/common/addons/command-profiler/src/main/java/com/dfsek/terra/addons/commands/profiler/ProfilerCommandAddon.java index 2376c919b..a1559c8c5 100644 --- a/common/addons/command-profiler/src/main/java/com/dfsek/terra/addons/commands/profiler/ProfilerCommandAddon.java +++ b/common/addons/command-profiler/src/main/java/com/dfsek/terra/addons/commands/profiler/ProfilerCommandAddon.java @@ -1,7 +1,7 @@ package com.dfsek.terra.addons.commands.profiler; -import cloud.commandframework.ArgumentDescription; -import cloud.commandframework.CommandManager; +import org.incendo.cloud.CommandManager; +import org.incendo.cloud.description.Description; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,24 +33,24 @@ public void initialize() { CommandManager manager = event.getCommandManager(); manager .command( - manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler")) - .literal("start", ArgumentDescription.of("Start profiling"), "st") + manager.commandBuilder("profiler", Description.of("Access the profiler")) + .literal("start", Description.of("Start profiling"), "st") .permission("terra.profiler.start") .handler(context -> { platform.getProfiler().start(); - context.getSender().sendMessage("Profiling started."); + context.sender().sendMessage("Profiling started."); })) .command( - manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler")) - .literal("stop", ArgumentDescription.of("Stop profiling"), "s") + manager.commandBuilder("profiler", Description.of("Access the profiler")) + .literal("stop", Description.of("Stop profiling"), "s") .permission("terra.profiler.stop") .handler(context -> { platform.getProfiler().stop(); - context.getSender().sendMessage("Profiling stopped."); + context.sender().sendMessage("Profiling stopped."); })) .command( - manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler")) - .literal("query", ArgumentDescription.of("Query profiler results"), "q") + manager.commandBuilder("profiler", Description.of("Access the profiler")) + .literal("query", Description.of("Query profiler results"), "q") .permission("terra.profiler.query") .handler(context -> { StringBuilder data = new StringBuilder("Terra Profiler data: \n"); @@ -59,15 +59,15 @@ public void initialize() { .append(timings.toString()) .append('\n')); logger.info(data.toString()); - context.getSender().sendMessage("Profiling data dumped to console."); + context.sender().sendMessage("Profiling data dumped to console."); })) .command( - manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler")) - .literal("reset", ArgumentDescription.of("Reset the profiler"), "r") + manager.commandBuilder("profiler", Description.of("Access the profiler")) + .literal("reset", Description.of("Reset the profiler"), "r") .permission("terra.profiler.reset") .handler(context -> { platform.getProfiler().reset(); - context.getSender().sendMessage("Profiler reset."); + context.sender().sendMessage("Profiler reset."); })); }); } diff --git a/common/addons/command-structures/src/main/java/com/dfsek/terra/addons/commands/structure/StructureCommandAddon.java b/common/addons/command-structures/src/main/java/com/dfsek/terra/addons/commands/structure/StructureCommandAddon.java index 438546137..67e910661 100644 --- a/common/addons/command-structures/src/main/java/com/dfsek/terra/addons/commands/structure/StructureCommandAddon.java +++ b/common/addons/command-structures/src/main/java/com/dfsek/terra/addons/commands/structure/StructureCommandAddon.java @@ -1,11 +1,5 @@ package com.dfsek.terra.addons.commands.structure; -import cloud.commandframework.ArgumentDescription; -import cloud.commandframework.CommandManager; -import cloud.commandframework.arguments.standard.EnumArgument; -import cloud.commandframework.arguments.standard.LongArgument; -import cloud.commandframework.context.CommandContext; - import java.util.Random; import com.dfsek.terra.addons.manifest.api.AddonInitializer; @@ -22,6 +16,13 @@ import com.dfsek.terra.api.util.Rotation; import com.dfsek.terra.api.util.reflection.TypeKey; +import org.incendo.cloud.CommandManager; +import org.incendo.cloud.component.DefaultValue; +import org.incendo.cloud.context.CommandContext; +import org.incendo.cloud.description.Description; +import org.incendo.cloud.parser.standard.EnumParser; +import org.incendo.cloud.parser.standard.LongParser; + public class StructureCommandAddon implements AddonInitializer { @Inject @@ -31,7 +32,7 @@ public class StructureCommandAddon implements AddonInitializer { private BaseAddon addon; private static Registry getStructureRegistry(CommandContext sender) { - return sender.getSender().getEntity().orElseThrow().world().getPack().getRegistry(Structure.class); + return sender.sender().getEntity().orElseThrow().world().getPack().getRegistry(Structure.class); } @Override @@ -43,16 +44,16 @@ public void initialize() { CommandManager manager = event.getCommandManager(); manager.command( - manager.commandBuilder("structures", ArgumentDescription.of("Manage or generate structures")) + manager.commandBuilder("structures", Description.of("Manage or generate structures")) .literal("generate") - .argument(RegistryArgument.builder("structure", + .optional(RegistryArgument.builder("structure", StructureCommandAddon::getStructureRegistry, TypeKey.of(Structure.class))) - .argument(LongArgument.optional("seed", 0)) - .argument(EnumArgument.optional(Rotation.class, "rotation", Rotation.NONE)) + .optional("seed", LongParser.longParser(), DefaultValue.constant(0L)) + .optional("rotation", EnumParser.enumParser(Rotation.class), DefaultValue.constant(Rotation.NONE)) .handler(context -> { Structure structure = context.get("structure"); - Entity sender = context.getSender().getEntity().orElseThrow(); + Entity sender = context.sender().getEntity().orElseThrow(); structure.generate( sender.position().toInt(), sender.world(), diff --git a/common/api/build.gradle.kts b/common/api/build.gradle.kts index 4f88c83e3..898f8bdcd 100644 --- a/common/api/build.gradle.kts +++ b/common/api/build.gradle.kts @@ -2,7 +2,7 @@ dependencies { api("ca.solo-studios", "strata", Versions.Libraries.strata) compileOnlyApi("org.slf4j", "slf4j-api", Versions.Libraries.slf4j) testImplementation("org.slf4j", "slf4j-api", Versions.Libraries.slf4j) - api("cloud.commandframework", "cloud-core", Versions.Libraries.cloud) + api("org.incendo", "cloud-core", Versions.Libraries.cloud) api("com.dfsek.tectonic", "common", Versions.Libraries.tectonic) diff --git a/common/api/src/main/java/com/dfsek/terra/api/command/arguments/RegistryArgument.java b/common/api/src/main/java/com/dfsek/terra/api/command/arguments/RegistryArgument.java index e89298751..91d6b56b9 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/command/arguments/RegistryArgument.java +++ b/common/api/src/main/java/com/dfsek/terra/api/command/arguments/RegistryArgument.java @@ -1,18 +1,10 @@ package com.dfsek.terra.api.command.arguments; -import cloud.commandframework.ArgumentDescription; -import cloud.commandframework.arguments.CommandArgument; -import cloud.commandframework.arguments.parser.ArgumentParseResult; -import cloud.commandframework.arguments.parser.ArgumentParser; -import cloud.commandframework.context.CommandContext; import io.leangen.geantyref.TypeToken; import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.checker.nullness.qual.Nullable; -import java.util.List; import java.util.Optional; -import java.util.Queue; -import java.util.function.BiFunction; +import java.util.concurrent.CompletableFuture; import java.util.function.Function; import java.util.stream.Collectors; @@ -21,40 +13,33 @@ import com.dfsek.terra.api.registry.key.RegistryKey; import com.dfsek.terra.api.util.reflection.TypeKey; +import org.incendo.cloud.component.CommandComponent; +import org.incendo.cloud.component.DefaultValue; +import org.incendo.cloud.context.CommandContext; +import org.incendo.cloud.context.CommandInput; +import org.incendo.cloud.parser.ArgumentParseResult; +import org.incendo.cloud.parser.ArgumentParser; +import org.incendo.cloud.parser.ParserDescriptor; +import org.incendo.cloud.suggestion.Suggestion; +import org.incendo.cloud.suggestion.SuggestionProvider; -public class RegistryArgument extends CommandArgument { - private RegistryArgument( - boolean required, - @NonNull String name, - Function, Registry> registryFunction, - TypeToken typeToken, - @NonNull String defaultValue, - @Nullable BiFunction, String, List> suggestionsProvider, - @NonNull ArgumentDescription description - ) { - super(required, - name, - new RegistryArgumentParser<>(registryFunction), - defaultValue, - typeToken, - suggestionsProvider, - description); - } + +public class RegistryArgument { public static Builder builder(String name, Registry registry) { return new Builder<>(name, registry); } - public static CommandArgument of(String name, Registry registry) { + public static CommandComponent of(String name, Registry registry) { return RegistryArgument.builder(name, registry).build(); } - public static CommandArgument optional(String name, Registry registry) { - return RegistryArgument.builder(name, registry).asOptional().build(); + public static CommandComponent optional(String name, Registry registry) { + return RegistryArgument.builder(name, registry).optional().build(); } - public static CommandArgument optional(String name, Registry registry, String defaultKey) { - return RegistryArgument.builder(name, registry).asOptionalWithDefault(defaultKey).build(); + public static CommandComponent optional(String name, Registry registry, DefaultValue defaultKey) { + return RegistryArgument.builder(name, registry).optional(defaultKey).build(); } @SuppressWarnings("unchecked") @@ -63,49 +48,36 @@ public static Builder builder(String name, Function(name, registryFunction, (TypeToken) TypeToken.get(registryType.getType())); } - public static CommandArgument of(String name, Function, Registry> registryFunction, + public static CommandComponent of(String name, Function, Registry> registryFunction, TypeKey registryType) { return RegistryArgument.builder(name, registryFunction, registryType).build(); } - public static CommandArgument optional(String name, Function, Registry> registryFunction, + public static CommandComponent optional(String name, Function, Registry> registryFunction, TypeKey registryType) { - return RegistryArgument.builder(name, registryFunction, registryType).asOptional().build(); + return RegistryArgument.builder(name, registryFunction, registryType).optional().build(); } - public static CommandArgument optional(String name, Function, Registry> registryFunction, - TypeKey registryType, String defaultKey) { - return RegistryArgument.builder(name, registryFunction, registryType).asOptionalWithDefault(defaultKey).build(); + public static CommandComponent optional(String name, Function, Registry> registryFunction, + TypeKey registryType, DefaultValue defaultKey) { + return RegistryArgument.builder(name, registryFunction, registryType).optional(defaultKey).build(); } - public static final class Builder extends CommandArgument.Builder { - private final Function, Registry> registryFunction; - private final TypeToken typeToken; + public static final class Builder extends CommandComponent.Builder { @SuppressWarnings("unchecked") private Builder(@NonNull String name, Registry registry) { - super((TypeToken) TypeToken.get(registry.getType().getType()), name); - this.registryFunction = commandContext -> registry; - this.typeToken = (TypeToken) TypeToken.get(registry.getType().getType()); + super(); + this.name(name); + this.parser(ParserDescriptor.of( + new RegistryArgumentParser<>(commandContext -> registry), + (TypeToken) TypeToken.get(registry.getType().getType()))); } private Builder(@NonNull String name, Function, Registry> registryFunction, TypeToken typeToken) { - super(typeToken, name); - this.typeToken = typeToken; - this.registryFunction = registryFunction; - } - - @Override - public @NonNull RegistryArgument build() { - return new RegistryArgument<>( - isRequired(), - getName(), - registryFunction, - typeToken, - getDefaultValue(), - getSuggestionsProvider(), - getDefaultDescription() - ); + super(); + this.name(name); + this.parser(ParserDescriptor.of(new RegistryArgumentParser<>(registryFunction), typeToken)); } } @@ -119,12 +91,12 @@ private RegistryArgumentParser(Function, Registry> registry @Override public @NonNull ArgumentParseResult<@NonNull R> parse(@NonNull CommandContext<@NonNull T> commandContext, - @NonNull Queue<@NonNull String> inputQueue) { - String input = inputQueue.remove(); - String next = inputQueue.peek(); - if(next != null && next.equals(":")) { - input += inputQueue.remove(); - input += inputQueue.remove(); + @NonNull CommandInput commandInput) { + String input = commandInput.readString(); + String next = commandInput.peekString(); + if(next.equals(":")) { + input += commandInput.readString(); + input += commandInput.readString(); } Registry registry = registryFunction.apply(commandContext); @@ -146,8 +118,17 @@ private RegistryArgumentParser(Function, Registry> registry } @Override - public @NonNull List<@NonNull String> suggestions(@NonNull CommandContext commandContext, @NonNull String input) { - return registryFunction.apply(commandContext).keys().stream().map(RegistryKey::toString).sorted().collect(Collectors.toList()); + public @NonNull SuggestionProvider suggestionProvider() { + return new SuggestionProvider<>() { + @Override + public @NonNull CompletableFuture> suggestionsFuture( + @NonNull CommandContext context, @NonNull CommandInput input) { + + // TODO: Verify whether this is correct + return CompletableFuture.completedFuture(registryFunction.apply(context).keys().stream().map( + registryKey -> Suggestion.suggestion(registryKey.toString())).sorted().collect(Collectors.toList())); + } + }; } } } diff --git a/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java b/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java index de13f061a..3ad041c9b 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java +++ b/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java @@ -1,10 +1,10 @@ package com.dfsek.terra.api.event.events.platform; -import cloud.commandframework.CommandManager; - import com.dfsek.terra.api.command.CommandSender; import com.dfsek.terra.api.event.events.Event; +import org.incendo.cloud.CommandManager; + public class CommandRegistrationEvent implements Event { private final CommandManager commandManager; diff --git a/platforms/bukkit/common/build.gradle.kts b/platforms/bukkit/common/build.gradle.kts index f47415da4..eaf1956cb 100644 --- a/platforms/bukkit/common/build.gradle.kts +++ b/platforms/bukkit/common/build.gradle.kts @@ -11,5 +11,5 @@ dependencies { shadedApi("com.google.guava", "guava", Versions.Libraries.Internal.guava) - shadedApi("cloud.commandframework", "cloud-paper", Versions.Libraries.cloud) + shadedApi("org.incendo", "cloud-paper", Versions.Libraries.cloudPaper) } diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java index b6c9a6e1d..6ae24afc3 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java @@ -17,15 +17,16 @@ package com.dfsek.terra.bukkit; -import cloud.commandframework.brigadier.CloudBrigadierManager; -import cloud.commandframework.bukkit.CloudBukkitCapabilities; -import cloud.commandframework.execution.CommandExecutionCoordinator; -import cloud.commandframework.paper.PaperCommandManager; import io.papermc.paper.threadedregions.scheduler.AsyncScheduler; import io.papermc.paper.threadedregions.scheduler.GlobalRegionScheduler; import org.bukkit.Bukkit; import org.bukkit.generator.ChunkGenerator; import org.bukkit.plugin.java.JavaPlugin; +import org.incendo.cloud.SenderMapper; +import org.incendo.cloud.brigadier.CloudBrigadierManager; +import org.incendo.cloud.bukkit.CloudBukkitCapabilities; +import org.incendo.cloud.execution.ExecutionCoordinator; +import org.incendo.cloud.paper.LegacyPaperCommandManager; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; @@ -71,7 +72,7 @@ public void onEnable() { } try { - PaperCommandManager commandManager = getCommandSenderPaperCommandManager(); + LegacyPaperCommandManager commandManager = getCommandSenderPaperCommandManager(); platform.getEventManager().callEvent(new CommandRegistrationEvent(commandManager)); @@ -91,23 +92,28 @@ public void onEnable() { } @NotNull - private PaperCommandManager getCommandSenderPaperCommandManager() throws Exception { - PaperCommandManager commandManager = new PaperCommandManager<>(this, - CommandExecutionCoordinator.simpleCoordinator(), - BukkitAdapter::adapt, - BukkitAdapter::adapt); - // TODO: Uncomment once Cloud has updated for 1.21 -// if(commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) { -// commandManager.registerBrigadier(); -// final CloudBrigadierManager brigManager = commandManager.brigadierManager(); -// if(brigManager != null) { -// brigManager.setNativeNumberSuggestions(false); -// } -// } + private LegacyPaperCommandManager getCommandSenderPaperCommandManager() throws Exception { + // TODO: Update to PaperCommandManager + LegacyPaperCommandManager commandManager = new LegacyPaperCommandManager<>( + this, + ExecutionCoordinator.simpleCoordinator(), + SenderMapper.create( + BukkitAdapter::adapt, + BukkitAdapter::adapt + )); + + if(commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) { + commandManager.registerBrigadier(); + final CloudBrigadierManager brigManager = commandManager.brigadierManager(); + if(brigManager != null) { + brigManager.setNativeNumberSuggestions(false); + } + } if(commandManager.hasCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION)) { commandManager.registerAsynchronousCompletions(); } + return commandManager; } diff --git a/platforms/fabric/build.gradle.kts b/platforms/fabric/build.gradle.kts index dba268728..58e892e99 100644 --- a/platforms/fabric/build.gradle.kts +++ b/platforms/fabric/build.gradle.kts @@ -10,6 +10,12 @@ architectury { loader("fabric") } +repositories { + maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") { + name = "Sonatype Snapshots" + } +} + dependencies { shadedApi(project(":common:implementation:base")) @@ -26,8 +32,8 @@ dependencies { modImplementation("net.fabricmc:fabric-loader:${Versions.Mod.fabricLoader}") - modImplementation("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud) - include("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud) + modImplementation("org.incendo", "cloud-fabric", Versions.Libraries.cloudFabric) + include("org.incendo", "cloud-fabric", Versions.Libraries.cloudFabric) modRuntimeOnly("net.fabricmc.fabric-api", "fabric-api", Versions.Fabric.fabricAPI) } diff --git a/platforms/mixin-lifecycle/build.gradle.kts b/platforms/mixin-lifecycle/build.gradle.kts index a4e700412..824d3cb46 100644 --- a/platforms/mixin-lifecycle/build.gradle.kts +++ b/platforms/mixin-lifecycle/build.gradle.kts @@ -15,7 +15,7 @@ dependencies { minecraft("com.mojang:minecraft:${Versions.Mod.minecraft}") mappings("net.fabricmc:yarn:${Versions.Mod.yarn}:v2") - modImplementation("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud) { + modImplementation("org.incendo", "cloud-fabric", Versions.Libraries.cloudFabric) { exclude("net.fabricmc") exclude("net.fabricmc.fabric-api") } diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java index f20038e5e..781536773 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java @@ -1,8 +1,7 @@ package com.dfsek.terra.lifecycle; -import cloud.commandframework.execution.CommandExecutionCoordinator; -import cloud.commandframework.fabric.FabricServerCommandManager; import net.minecraft.server.command.ServerCommandSource; +import org.incendo.cloud.fabric.FabricServerCommandManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; From 08df5fc2789c71d5134339a6286fcf38fac0e334 Mon Sep 17 00:00:00 2001 From: OakLoaf Date: Mon, 26 Aug 2024 11:24:04 +0100 Subject: [PATCH 091/126] Added 1.21.1 support --- .../main/java/com/dfsek/terra/bukkit/nms/Initializer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java index 1ca6f8c3f..3f7375bc4 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java @@ -15,7 +15,12 @@ public interface Initializer { static boolean init(PlatformImpl platform) { Logger logger = LoggerFactory.getLogger(Initializer.class); try { - Class initializerClass = Class.forName(TERRA_PACKAGE + "." + NMS + ".NMSInitializer"); + String packageVersion = NMS; + if (NMS.equals("v1_21_1")) { + packageVersion = "v1_21"; + } + + Class initializerClass = Class.forName(TERRA_PACKAGE + "." + packageVersion + ".NMSInitializer"); try { Initializer initializer = (Initializer) initializerClass.getConstructor().newInstance(); initializer.initialize(platform); From 3bef7d8572558066c2db8e8b3088d4811db167f5 Mon Sep 17 00:00:00 2001 From: OakLoaf Date: Mon, 26 Aug 2024 12:34:08 +0100 Subject: [PATCH 092/126] Resolved errors when tab completing --- .../main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java index 6ae24afc3..8c392dba1 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java @@ -102,15 +102,13 @@ private LegacyPaperCommandManager getCommandSenderPaperCommandMan BukkitAdapter::adapt )); - if(commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) { + if (commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) { commandManager.registerBrigadier(); final CloudBrigadierManager brigManager = commandManager.brigadierManager(); if(brigManager != null) { brigManager.setNativeNumberSuggestions(false); } - } - - if(commandManager.hasCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION)) { + } else if (commandManager.hasCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION)) { commandManager.registerAsynchronousCompletions(); } From 664d1a3191e301975bea973fecaa6105483c15e8 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Tue, 17 Sep 2024 16:34:30 -0600 Subject: [PATCH 093/126] working 1.20.6 --- build.gradle.kts | 3 +- buildSrc/build.gradle.kts | 6 +- buildSrc/src/main/kotlin/DependencyConfig.kt | 3 + .../src/main/kotlin/DistributionConfig.kt | 2 +- buildSrc/src/main/kotlin/Versions.kt | 34 +++++----- gradle/wrapper/gradle-wrapper.jar | Bin 43462 -> 43453 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 2 +- gradlew.bat | 20 +++--- platforms/bukkit/build.gradle.kts | 6 -- platforms/bukkit/nms/v1_21/build.gradle.kts | 4 -- .../bukkit/nms/v1_21/AwfulBukkitHacks.java | 1 + platforms/fabric/build.gradle.kts | 10 --- .../fabric/src/main/resources/fabric.mod.json | 6 +- .../main/resources/terra.fabric.mixins.json | 2 +- .../main/resources/terra.forge.mixins.json | 2 +- .../terra/mod/handle/MinecraftItemHandle.java | 12 +++- .../entity/MobSpawnerBlockEntityMixin.java | 4 +- .../terra/inventory/item/ItemMixin.java | 5 +- .../terra/inventory/item/ItemStackMixin.java | 20 +++++- .../inventory/meta/ItemStackMetaMixin.java | 10 +-- .../terra/world/ChunkRegionMixin.java | 4 +- .../mod/mixin/invoke/FluidBlockInvoker.java | 14 ++++ .../lifecycle/DataPackContentsMixin.java | 11 ++- .../src/main/resources/terra.accesswidener | 2 +- .../main/resources/terra.common.mixins.json | 2 +- platforms/mixin-lifecycle/build.gradle.kts | 4 -- .../terra/lifecycle/LifecycleEntryPoint.java | 7 +- .../terra/lifecycle/LifecyclePlatform.java | 2 +- .../mixin/lifecycle/RegistryLoaderMixin.java | 64 +++++++++++------- .../mixin/lifecycle/SaveLoadingMixin.java | 16 ++--- .../resources/terra.lifecycle.mixins.json | 2 +- .../main/resources/terra.quilt.mixins.json | 2 +- 33 files changed, 167 insertions(+), 119 deletions(-) create mode 100644 platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/invoke/FluidBlockInvoker.java diff --git a/build.gradle.kts b/build.gradle.kts index a8a497a85..67b22ccb5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,6 +15,7 @@ allprojects { tasks.withType().configureEach { options.isFork = true options.isIncremental = true + options.release.set(21) } tasks.withType().configureEach { @@ -44,7 +45,7 @@ afterEvaluate { } project(":platforms:bukkit:common").configureDistribution() forSubProjects(":common:addons") { - apply(plugin = "com.github.johnrengelman.shadow") + apply(plugin = "com.gradleup.shadow") tasks.named("build") { finalizedBy(tasks.named("shadowJar")) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 3d319e8c7..cec2d002d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -16,11 +16,11 @@ repositories { dependencies { //TODO Allow pulling from Versions.kt - implementation("com.github.johnrengelman", "shadow", "8.1.1") - implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.1") + implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.1") + implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.2") implementation("org.ow2.asm", "asm", "9.7") implementation("org.ow2.asm", "asm-tree", "9.7") implementation("com.dfsek.tectonic", "common", "4.2.1") - implementation("org.yaml", "snakeyaml", "2.2") + implementation("org.yaml", "snakeyaml", "2.3") } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/DependencyConfig.kt b/buildSrc/src/main/kotlin/DependencyConfig.kt index 0778808d8..0df8e29f2 100644 --- a/buildSrc/src/main/kotlin/DependencyConfig.kt +++ b/buildSrc/src/main/kotlin/DependencyConfig.kt @@ -48,6 +48,9 @@ fun Project.configureDependencies() { maven("https://jitpack.io") { name = "JitPack" } + maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") { + name = "Sonatype Snapshots" + } } dependencies { diff --git a/buildSrc/src/main/kotlin/DistributionConfig.kt b/buildSrc/src/main/kotlin/DistributionConfig.kt index 80e59104e..12ebd8376 100644 --- a/buildSrc/src/main/kotlin/DistributionConfig.kt +++ b/buildSrc/src/main/kotlin/DistributionConfig.kt @@ -21,7 +21,7 @@ import kotlin.io.path.exists fun Project.configureDistribution() { - apply(plugin = "com.github.johnrengelman.shadow") + apply(plugin = "com.gradleup.shadow") val downloadDefaultPacks = tasks.create("downloadDefaultPacks") { group = "terra" diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index f6e2606e0..d1b7f4024 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -8,23 +8,23 @@ object Versions { const val paralithic = "0.7.1" const val strata = "1.3.2" - const val cloud = "2.0.0-rc.2" - const val cloudPaper = "2.0.0-beta.9" - const val cloudFabric = "2.0.0-beta.7" + const val cloud = "2.0.0" + const val cloudPaper = "2.0.0-beta.10" + const val cloudFabric = "2.0.0-beta.9" const val caffeine = "3.1.8" - const val slf4j = "2.0.13" + const val slf4j = "2.0.16" object Internal { - const val shadow = "8.1.1" + const val shadow = "8.3.1" const val apacheText = "1.12.0" const val apacheIO = "2.16.1" - const val guava = "33.1.0-jre" + const val guava = "33.3.0-jre" const val asm = "9.7" - const val snakeYml = "2.2" + const val snakeYml = "2.3" const val jetBrainsAnnotations = "24.1.0" - const val junit = "5.10.2" + const val junit = "5.11.0" } } @@ -38,14 +38,14 @@ object Versions { // } object Mod { - const val mixin = "0.12.5+mixin.0.8.5" + const val mixin = "0.15.3+mixin.0.8.7" const val minecraft = "1.20.6" const val yarn = "$minecraft+build.1" - const val fabricLoader = "0.15.10" + const val fabricLoader = "0.16.5" - const val architecuryLoom = "1.6.395" - const val architecturyPlugin = "3.4.155" + const val architecuryLoom = "1.7.413" + const val architecturyPlugin = "3.4.159" } // // object Forge { @@ -54,14 +54,14 @@ object Versions { // } object Bukkit { - const val minecraft = "1.21" - const val paperBuild = "$minecraft-R0.1-SNAPSHOT" + const val minecraft = "1.21.1" + const val paperBuild = "$minecraft-R0.1-20240917.151311-80" const val paper = paperBuild const val paperLib = "1.0.8" const val reflectionRemapper = "0.1.1" const val paperDevBundle = paperBuild - const val runPaper = "2.3.0" - const val paperWeight = "1.7.1" + const val runPaper = "2.3.1" + const val paperWeight = "1.7.2" } // @@ -73,6 +73,6 @@ object Versions { // object CLI { const val nbt = "6.1" - const val logback = "1.4.14" + const val logback = "1.5.8" } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd4917707c1f8861d8cb53dd15194d4248596..e6441136f3d4ba8a0da8d277868979cfbc8ad796 100644 GIT binary patch delta 34118 zcmY(qRX`kF)3u#IAjsf0xCD212@LM;?(PINyAue(f;$XO2=4Cg1P$=#e%|lo zKk1`B>Q#GH)wNd-&cJofz}3=WfYndTeo)CyX{fOHsQjGa<{e=jamMNwjdatD={CN3>GNchOE9OGPIqr)3v>RcKWR3Z zF-guIMjE2UF0Wqk1)21791y#}ciBI*bAenY*BMW_)AeSuM5}vz_~`+1i!Lo?XAEq{TlK5-efNFgHr6o zD>^vB&%3ZGEWMS>`?tu!@66|uiDvS5`?bF=gIq3rkK(j<_TybyoaDHg8;Y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g$j#dLVham{yGkc$I#!HF7mRS%f* z!+NdzG49K(qaO^SBlp@K@D?|^rAq;8{*@kRc4sYSNQmoy7@_RS_ksWl2T_38h2A)# ziU2WXWD03(NqS&Mu*?0-iK8X_Z3w`}c7MPv0qZ7iM|L3xdTnR{y!7{#82$}uJCiGT zqa=8<9L05hu6 z1N+2n7OzT{NEf?gS@eq7@buCDFe9mAxY%THo^b@BHckKK>jg6{@)>n z43cPs%$Qi0iwyZ+{C491>FRu5+6baJ{&XXXC@Sp+b!QE|{7_d?lm5K=B z)myKEcxjFm74+drF|JCYcxdY%ASig#YoRBRUV7An7f-%rqj%PHECbxh#5476cEq@NQL?dI6gUqvS@w zq!WmD(aR0{NxItAZCKDCVw=Zu{9WGDu^i?2g zLerPiOU*HSaXg^3CdOX^F6c9MiHINP339N%)a96`^Z-c#&EogcxMSYo0Cb4{-}q1( zRrJine`P|6WRkm8u4Ja1QRYq$AR>b7tugd#EsT-VmXN-t!TYjZy}i!uKi6$u>EJ?w zvdHZg+hp+5ree?>fdJAX)5#Wtm#2M-{~2jfX2{G`)?D6UD1MevdeeU;;HCi}AtJr( SGW6ptSs!X7{rG*o_g?|vpSEZK diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 381baa9ce..8e876e1c5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionSha256Sum=1541fa36599e12857140465f3c91a97409b4512501c26f9631fb113e392c5bd1 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a426..b740cf133 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f1..25da30dbd 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/platforms/bukkit/build.gradle.kts b/platforms/bukkit/build.gradle.kts index 95924dadd..08a75dc12 100644 --- a/platforms/bukkit/build.gradle.kts +++ b/platforms/bukkit/build.gradle.kts @@ -2,12 +2,6 @@ plugins { id("xyz.jpenilla.run-paper") version Versions.Bukkit.runPaper } -repositories { - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") { - name = "Sonatype" - } -} - dependencies { shaded(project(":platforms:bukkit:common")) shaded(project(":platforms:bukkit:nms:v1_21", configuration = "reobf")) diff --git a/platforms/bukkit/nms/v1_21/build.gradle.kts b/platforms/bukkit/nms/v1_21/build.gradle.kts index 6881c96ca..d52f1d169 100644 --- a/platforms/bukkit/nms/v1_21/build.gradle.kts +++ b/platforms/bukkit/nms/v1_21/build.gradle.kts @@ -1,9 +1,5 @@ apply(plugin = "io.papermc.paperweight.userdev") -repositories { - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") -} - dependencies { api(project(":platforms:bukkit:common")) paperDevBundle(Versions.Bukkit.paperDevBundle) diff --git a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java index d16bbbf30..fc5cc0367 100644 --- a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java @@ -10,6 +10,7 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.biome.Biome; import org.bukkit.NamespacedKey; import org.slf4j.Logger; diff --git a/platforms/fabric/build.gradle.kts b/platforms/fabric/build.gradle.kts index 58e892e99..631424699 100644 --- a/platforms/fabric/build.gradle.kts +++ b/platforms/fabric/build.gradle.kts @@ -10,12 +10,6 @@ architectury { loader("fabric") } -repositories { - maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") { - name = "Sonatype Snapshots" - } -} - dependencies { shadedApi(project(":common:implementation:base")) @@ -51,10 +45,6 @@ loom { addonDir(project.file("./run/config/Terra/addons"), tasks.named("configureLaunch").get()) tasks { - compileJava { - options.release.set(17) - } - remapJar { dependsOn("installAddons") diff --git a/platforms/fabric/src/main/resources/fabric.mod.json b/platforms/fabric/src/main/resources/fabric.mod.json index 8b67c7b54..bc5319452 100644 --- a/platforms/fabric/src/main/resources/fabric.mod.json +++ b/platforms/fabric/src/main/resources/fabric.mod.json @@ -26,9 +26,9 @@ "terra.common.mixins.json" ], "depends": { - "fabricloader": ">=0.15.1", - "java": ">=17", - "minecraft": ">=1.20.4", + "fabricloader": ">=0.16.5", + "java": ">=21", + "minecraft": ">=1.20.6", "fabric": "*" } } \ No newline at end of file diff --git a/platforms/fabric/src/main/resources/terra.fabric.mixins.json b/platforms/fabric/src/main/resources/terra.fabric.mixins.json index f97889f6d..4778acf1b 100644 --- a/platforms/fabric/src/main/resources/terra.fabric.mixins.json +++ b/platforms/fabric/src/main/resources/terra.fabric.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "com.dfsek.terra.fabric.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ ], "client": [ diff --git a/platforms/forge/src/main/resources/terra.forge.mixins.json b/platforms/forge/src/main/resources/terra.forge.mixins.json index 25c1c470e..095ea9234 100644 --- a/platforms/forge/src/main/resources/terra.forge.mixins.json +++ b/platforms/forge/src/main/resources/terra.forge.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "com.dfsek.terra.forge.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ "lifecycle.NoiseConfigMixin" ], diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java index 541e764ab..f260ba3f2 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java @@ -25,10 +25,13 @@ import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryWrapper; +import net.minecraft.registry.RegistryWrapper.Impl; import net.minecraft.util.Identifier; +import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; +import java.util.stream.Stream; import com.dfsek.terra.api.handle.ItemHandle; import com.dfsek.terra.api.inventory.Item; @@ -43,8 +46,13 @@ public Item createItem(String data) { try { return (Item) new ItemStackArgumentType(new CommandRegistryAccess() { @Override - public RegistryWrapper createWrapper(RegistryKey> registryRef) { - return CommonPlatform.get().getServer().getRegistryManager().getWrapperOrThrow(registryRef); + public Stream>> streamAllRegistryKeys() { + return CommonPlatform.get().getServer().getRegistryManager().streamAllRegistryKeys(); + } + + @Override + public Optional> getOptionalWrapper(RegistryKey> registryRef) { + return Optional.of(CommonPlatform.get().getServer().getRegistryManager().getWrapperOrThrow(registryRef)); } }).parse(new StringReader(data)).getItem(); } catch(CommandSyntaxException e) { diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java index 2ec582417..ccc8b738a 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java @@ -50,7 +50,7 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS public abstract MobSpawnerLogic getLogic(); @Shadow - public abstract void setEntityType(net.minecraft.entity.EntityType entityType, Random random); + public abstract void method_46408(net.minecraft.entity.EntityType entityType, Random random); public EntityType terra$getSpawnedType() { return (EntityType) Registries.ENTITY_TYPE.get( @@ -64,7 +64,7 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS } else { rand = Random.create(); } - setEntityType((net.minecraft.entity.EntityType) creatureType, rand); + method_46408((net.minecraft.entity.EntityType) creatureType, rand); } public int terra$getDelay() { diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemMixin.java index 78593ecb1..e8832c214 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemMixin.java @@ -30,7 +30,7 @@ @Implements(@Interface(iface = com.dfsek.terra.api.inventory.Item.class, prefix = "terra$")) public abstract class ItemMixin { @Shadow - public abstract int getMaxDamage(); + public abstract net.minecraft.item.ItemStack getDefaultStack(); @SuppressWarnings("ConstantConditions") public ItemStack terra$newItemStack(int amount) { @@ -38,6 +38,7 @@ public abstract class ItemMixin { } public double terra$getMaxDurability() { - return getMaxDamage(); + //TODO verify this is correct + return getDefaultStack().getMaxDamage(); } } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java index 089a6db1d..155836837 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java @@ -17,9 +17,15 @@ package com.dfsek.terra.mod.mixin.implementations.terra.inventory.item; +import net.minecraft.component.Component; +import net.minecraft.component.ComponentChanges; +import net.minecraft.component.ComponentMap; +import net.minecraft.component.ComponentMapImpl; +import net.minecraft.component.DataComponentType; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Implements; import org.spongepowered.asm.mixin.Interface; import org.spongepowered.asm.mixin.Intrinsic; @@ -46,7 +52,11 @@ public abstract class ItemStackMixin { public abstract boolean isDamageable(); @Shadow - public abstract void setNbt(@Nullable NbtCompound tag); + public abstract ComponentMap getComponents(); + + @Shadow + @Final + private ComponentMapImpl components; public int terra$getAmount() { return getCount(); @@ -66,7 +76,13 @@ public abstract class ItemStackMixin { @SuppressWarnings("ConstantConditions") public void terra$setItemMeta(ItemMeta meta) { - setNbt(((ItemStack) (Object) meta).getNbt()); + ComponentChanges.Builder builder = ComponentChanges.builder(); + this.getComponents().getTypes().forEach(builder::remove); + + ComponentMap components = ((ItemStack) (Object) meta).getComponents(); + components.forEach(builder::add); + + this.components.applyChanges(builder.build()); } @Intrinsic diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java index a6307b02c..5617f494c 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java @@ -17,6 +17,7 @@ package com.dfsek.terra.mod.mixin.implementations.terra.inventory.meta; +import net.minecraft.component.type.ItemEnchantmentsComponent; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtList; @@ -42,7 +43,7 @@ public abstract class ItemStackMetaMixin { public abstract boolean hasEnchantments(); @Shadow - public abstract NbtList getEnchantments(); + public abstract ItemEnchantmentsComponent getEnchantments(); @Shadow public abstract void addEnchantment(net.minecraft.enchantment.Enchantment enchantment, int level); @@ -56,9 +57,10 @@ public abstract class ItemStackMetaMixin { if(!hasEnchantments()) return Collections.emptyMap(); Map map = new HashMap<>(); - getEnchantments().forEach(enchantment -> { - NbtCompound eTag = (NbtCompound) enchantment; - map.put((Enchantment) Registries.ENCHANTMENT.get(eTag.getInt("id")), eTag.getInt("lvl")); + ItemEnchantmentsComponent enchantments = getEnchantments(); + enchantments.getEnchantments().forEach(enchantment -> { + net.minecraft.enchantment.Enchantment enchantmentValue = enchantment.value(); + map.put((Enchantment) enchantmentValue, enchantments.getLevel(enchantmentValue)); }); return map; } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java index 82080579b..1a0e9e0df 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java @@ -17,6 +17,8 @@ package com.dfsek.terra.mod.mixin.implementations.terra.world; +import com.dfsek.terra.mod.mixin.invoke.FluidBlockInvoker; + import net.minecraft.block.FluidBlock; import net.minecraft.fluid.Fluid; import net.minecraft.util.math.BlockPos; @@ -88,7 +90,7 @@ public void injectConstructor(net.minecraft.server.world.ServerWorld world, List ((ChunkRegion) (Object) this).setBlockState(pos, (net.minecraft.block.BlockState) data, physics ? 3 : 1042); if(physics && ((net.minecraft.block.BlockState) data).getBlock() instanceof FluidBlock) { fluidTickScheduler.scheduleTick( - OrderedTick.create(((FluidBlock) ((net.minecraft.block.BlockState) data).getBlock()).getFluidState( + OrderedTick.create((((FluidBlockInvoker) ((net.minecraft.block.BlockState) data).getBlock())).invokeGetFluidState( (net.minecraft.block.BlockState) data).getFluid(), pos)); } } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/invoke/FluidBlockInvoker.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/invoke/FluidBlockInvoker.java new file mode 100644 index 000000000..a6b50409c --- /dev/null +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/invoke/FluidBlockInvoker.java @@ -0,0 +1,14 @@ +package com.dfsek.terra.mod.mixin.invoke; + +import net.minecraft.block.BlockState; +import net.minecraft.block.FluidBlock; +import net.minecraft.fluid.FluidState; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + + +@Mixin(FluidBlock.class) +public interface FluidBlockInvoker { + @Invoker("getFluidState") + public FluidState invokeGetFluidState(BlockState state); +} diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/lifecycle/DataPackContentsMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/lifecycle/DataPackContentsMixin.java index 48ea98519..305f7f024 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/lifecycle/DataPackContentsMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/lifecycle/DataPackContentsMixin.java @@ -3,9 +3,12 @@ import net.minecraft.registry.DynamicRegistryManager; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.ReloadableRegistries; import net.minecraft.server.DataPackContents; import net.minecraft.world.biome.Biome; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -16,11 +19,15 @@ @Mixin(DataPackContents.class) public class DataPackContentsMixin { + @Shadow + @Final + private ReloadableRegistries.Lookup reloadableRegistries; /* * #refresh populates all tags in the registries */ - @Inject(method = "refresh(Lnet/minecraft/registry/DynamicRegistryManager;)V", at = @At("RETURN")) - private void injectReload(DynamicRegistryManager dynamicRegistryManager, CallbackInfo ci) { + @Inject(method = "refresh()V", at = @At("RETURN")) + private void injectReload(CallbackInfo ci) { + DynamicRegistryManager.Immutable dynamicRegistryManager = this.reloadableRegistries.getRegistryManager(); TagUtil.registerWorldPresetTags(dynamicRegistryManager.get(RegistryKeys.WORLD_PRESET)); Registry biomeRegistry = dynamicRegistryManager.get(RegistryKeys.BIOME); diff --git a/platforms/mixin-common/src/main/resources/terra.accesswidener b/platforms/mixin-common/src/main/resources/terra.accesswidener index 50cba4f7d..46f1b986e 100644 --- a/platforms/mixin-common/src/main/resources/terra.accesswidener +++ b/platforms/mixin-common/src/main/resources/terra.accesswidener @@ -1,4 +1,4 @@ accessWidener v1 named accessible class net/minecraft/world/biome/Biome$Weather accessible class net/minecraft/world/gen/WorldPresets$Registrar -accessible method net/minecraft/block/FluidBlock getFluidState (Lnet/minecraft/block/BlockState;)Lnet/minecraft/fluid/FluidState +accessible class net/minecraft/registry/RegistryLoader$Loader \ No newline at end of file diff --git a/platforms/mixin-common/src/main/resources/terra.common.mixins.json b/platforms/mixin-common/src/main/resources/terra.common.mixins.json index d4402241c..f8d0718e4 100644 --- a/platforms/mixin-common/src/main/resources/terra.common.mixins.json +++ b/platforms/mixin-common/src/main/resources/terra.common.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "com.dfsek.terra.mod.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ "access.BiomeAccessor", "access.MobSpawnerLogicAccessor", diff --git a/platforms/mixin-lifecycle/build.gradle.kts b/platforms/mixin-lifecycle/build.gradle.kts index 824d3cb46..b7d209b7f 100644 --- a/platforms/mixin-lifecycle/build.gradle.kts +++ b/platforms/mixin-lifecycle/build.gradle.kts @@ -30,10 +30,6 @@ loom { } tasks { - compileJava { - options.release.set(17) - } - remapJar { inputFile.set(shadowJar.get().archiveFile) } diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java index 781536773..65d86febf 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java @@ -1,6 +1,8 @@ package com.dfsek.terra.lifecycle; import net.minecraft.server.command.ServerCommandSource; +import org.incendo.cloud.SenderMapper; +import org.incendo.cloud.execution.ExecutionCoordinator; import org.incendo.cloud.fabric.FabricServerCommandManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -16,9 +18,10 @@ public static void initialize(String modName, LifecyclePlatform platform) { logger.info("Initializing Terra {} mod...", modName); FabricServerCommandManager manager = new FabricServerCommandManager<>( - CommandExecutionCoordinator.simpleCoordinator(), + ExecutionCoordinator.simpleCoordinator(), + SenderMapper.create( serverCommandSource -> (CommandSender) serverCommandSource, - commandSender -> (ServerCommandSource) commandSender + commandSender -> (ServerCommandSource) commandSender) ); diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecyclePlatform.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecyclePlatform.java index be845eb19..41a57b448 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecyclePlatform.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecyclePlatform.java @@ -69,7 +69,7 @@ public boolean reload() { if(server != null) { BiomeUtil.registerBiomes(server.getRegistryManager().get(RegistryKeys.BIOME)); - server.reloadResources(server.getDataPackManager().getNames()).exceptionally(throwable -> { + server.reloadResources(server.getDataPackManager().getEnabledIds()).exceptionally(throwable -> { LOGGER.warn("Failed to execute reload", throwable); return null; }).join(); diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java index 052598ac2..b54ee9a02 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java @@ -1,11 +1,14 @@ package com.dfsek.terra.lifecycle.mixin.lifecycle; import com.mojang.datafixers.util.Pair; +import net.minecraft.registry.DynamicRegistryManager; +import net.minecraft.registry.DynamicRegistryManager.Immutable; import net.minecraft.registry.MutableRegistry; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.RegistryLoader; +import net.minecraft.registry.RegistryLoader.Loader; import net.minecraft.world.biome.source.MultiNoiseBiomeSourceParameterList; import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.gen.WorldPreset; @@ -14,7 +17,9 @@ import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; import java.util.List; @@ -25,48 +30,61 @@ import com.dfsek.terra.lifecycle.util.LifecycleUtil; import com.dfsek.terra.lifecycle.util.RegistryHack; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + @Mixin(RegistryLoader.class) public class RegistryLoaderMixin { + private static boolean initialized = false; @Shadow @Final private static Logger LOGGER; - +// @Inject( +// method = "load(Lnet/minecraft/registry/RegistryLoader$RegistryLoadable;Lnet/minecraft/registry/DynamicRegistryManager;Ljava/util/List;)Lnet/minecraft/registry/DynamicRegistryManager$Immutable;", +// at = @At( +// value = "INVOKE", +// target = "Ljava/util/List;forEach(Ljava/util/function/Consumer;)V", +// ordinal = 1 // we want right after the first forEach +// ) +// ) +// private static void grabRegiestry(RegistryLoader.RegistryLoadable loadable, DynamicRegistryManager baseRegistryManager, +// List> entries, CallbackInfoReturnable cir) { +// entries.forEach((loader) -> { +// Registry registry = loader.registry(); +// } @Redirect( - method = "load(Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/registry/DynamicRegistryManager;Ljava/util/List;)" + - "Lnet/minecraft/registry/DynamicRegistryManager$Immutable;", + method = "load(Lnet/minecraft/registry/RegistryLoader$RegistryLoadable;Lnet/minecraft/registry/DynamicRegistryManager;Ljava/util/List;)Lnet/minecraft/registry/DynamicRegistryManager$Immutable;", at = @At( value = "INVOKE", target = "Ljava/util/List;forEach(Ljava/util/function/Consumer;)V", ordinal = 1 // we want right after the first forEach ) ) - private static void grabManager(List, Object>> instance, Consumer, Object>> consumer) { - instance.forEach(mutableRegistryObjectPair -> LOGGER.debug("{}: {} entries", - mutableRegistryObjectPair.getFirst().toString(), - mutableRegistryObjectPair.getFirst().size()) - ); - extractRegistry(instance, RegistryKeys.BIOME).ifPresent( - biomes -> { // this redirect triggers twice, second time only with dimension registry. don't try extraction second time - MutableRegistry dimensionTypes = extractRegistry(instance, RegistryKeys.DIMENSION_TYPE).orElseThrow(); - MutableRegistry worldPresets = extractRegistry(instance, RegistryKeys.WORLD_PRESET).orElseThrow(); - MutableRegistry chunkGeneratorSettings = extractRegistry(instance, - RegistryKeys.CHUNK_GENERATOR_SETTINGS).orElseThrow(); - MutableRegistry multiNoiseBiomeSourceParameterLists = extractRegistry(instance, - RegistryKeys.MULTI_NOISE_BIOME_SOURCE_PARAMETER_LIST).orElseThrow(); + private static void grabManager(List> instance, Consumer> consumer) { + if (!initialized) { + extractRegistry(instance, RegistryKeys.BIOME).ifPresent( + biomes -> { // this redirect triggers twice, second time only with dimension registry. don't try extraction second time + MutableRegistry dimensionTypes = extractRegistry(instance, RegistryKeys.DIMENSION_TYPE).orElseThrow(); + MutableRegistry worldPresets = extractRegistry(instance, RegistryKeys.WORLD_PRESET).orElseThrow(); + MutableRegistry chunkGeneratorSettings = extractRegistry(instance, + RegistryKeys.CHUNK_GENERATOR_SETTINGS).orElseThrow(); + MutableRegistry multiNoiseBiomeSourceParameterLists = extractRegistry(instance, + RegistryKeys.MULTI_NOISE_BIOME_SOURCE_PARAMETER_LIST).orElseThrow(); - LifecyclePlatform.setRegistries(biomes, dimensionTypes, chunkGeneratorSettings, multiNoiseBiomeSourceParameterLists); - LifecycleUtil.initialize(biomes, worldPresets); - }); + LifecyclePlatform.setRegistries(biomes, dimensionTypes, chunkGeneratorSettings, multiNoiseBiomeSourceParameterLists); + LifecycleUtil.initialize(biomes, worldPresets); + }); + initialized = true; + } instance.forEach(consumer); } + @Unique @SuppressWarnings("unchecked") - private static Optional> extractRegistry(List, Object>> instance, + private static Optional> extractRegistry(List> instance, RegistryKey> key) { List> matches = instance - .stream() - .map(Pair::getFirst) + .stream().map(RegistryLoader.Loader::registry) .filter(r -> r.getKey().equals(key)) .toList(); if(matches.size() > 1) { @@ -74,7 +92,7 @@ private static Optional> extractRegistry(List registry = (MutableRegistry) matches.get(0); + MutableRegistry registry = (MutableRegistry) matches.getFirst(); ((RegistryHack) registry).terra_bind(); return Optional.of(registry); } diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/SaveLoadingMixin.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/SaveLoadingMixin.java index 6f373130f..0bf675fc2 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/SaveLoadingMixin.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/SaveLoadingMixin.java @@ -13,18 +13,14 @@ @Mixin(SaveLoading.class) public class SaveLoadingMixin { @ModifyArg( - method = "method_42097(Lnet/minecraft/registry/DynamicRegistryManager$Immutable;" + - "Lnet/minecraft/server/SaveLoading$SaveApplierFactory;Lnet/minecraft/resource/LifecycledResourceManager;" + - "Lnet/minecraft/registry/CombinedDynamicRegistries;Lnet/minecraft/server/SaveLoading$LoadContext;" + - "Lnet/minecraft/server/DataPackContents;)Ljava/lang/Object;", + method = "load(Lnet/minecraft/server/SaveLoading$ServerConfig;Lnet/minecraft/server/SaveLoading$LoadContextSupplier;Lnet/minecraft/server/SaveLoading$SaveApplierFactory;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", at = @At( value = "INVOKE", - target = "Lnet/minecraft/server/DataPackContents;refresh(Lnet/minecraft/registry/DynamicRegistryManager;)V" - ), - index = 0 + target = "Lnet/minecraft/registry/RegistryLoader;loadFromResource(Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/registry/DynamicRegistryManager;Ljava/util/List;)Lnet/minecraft/registry/DynamicRegistryManager$Immutable;" ), + index = 1 ) - private static DynamicRegistryManager grabManager(DynamicRegistryManager in) { - MinecraftUtil.registerFlora(in.get(RegistryKeys.BIOME)); - return in; + private static DynamicRegistryManager grabManager(DynamicRegistryManager registryManager) { + MinecraftUtil.registerFlora(registryManager.get(RegistryKeys.BIOME)); + return registryManager; } } diff --git a/platforms/mixin-lifecycle/src/main/resources/terra.lifecycle.mixins.json b/platforms/mixin-lifecycle/src/main/resources/terra.lifecycle.mixins.json index 33695db0e..2e4708bd4 100644 --- a/platforms/mixin-lifecycle/src/main/resources/terra.lifecycle.mixins.json +++ b/platforms/mixin-lifecycle/src/main/resources/terra.lifecycle.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "com.dfsek.terra.lifecycle.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ "NoiseConfigMixin", "RegistryEntryReferenceInvoker", diff --git a/platforms/quilt/src/main/resources/terra.quilt.mixins.json b/platforms/quilt/src/main/resources/terra.quilt.mixins.json index 91f51b344..84ca8264a 100644 --- a/platforms/quilt/src/main/resources/terra.quilt.mixins.json +++ b/platforms/quilt/src/main/resources/terra.quilt.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "com.dfsek.terra.quilt.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ ], "client": [ From 15a298304e72938ddb5ce7017a47cb62393a7b1a Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Tue, 17 Sep 2024 17:40:56 -0600 Subject: [PATCH 094/126] working 1.21.1 --- buildSrc/src/main/kotlin/Versions.kt | 6 +++--- .../main/java/com/dfsek/terra/mod/ModPlatform.java | 5 +++++ .../generation/MinecraftChunkGeneratorWrapper.java | 5 ++--- .../terra/mod/handle/MinecraftItemHandle.java | 4 ++-- .../block/entity/MobSpawnerBlockEntityMixin.java | 6 +++--- .../implementations/terra/entity/EntityMixin.java | 4 ++-- .../terra/inventory/item/ItemStackMixin.java | 1 - .../terra/inventory/meta/EnchantmentMixin.java | 14 +++++++++++--- .../terra/inventory/meta/ItemStackMetaMixin.java | 9 +++++---- .../terra/world/ChunkRegionMixin.java | 9 +++++---- .../java/com/dfsek/terra/mod/util/PresetUtil.java | 2 +- .../dfsek/terra/lifecycle/LifecyclePlatform.java | 11 ++++++++++- .../mixin/lifecycle/RegistryLoaderMixin.java | 4 +++- .../com/dfsek/terra/lifecycle/util/BiomeUtil.java | 2 +- .../dfsek/terra/lifecycle/util/RegistryUtil.java | 4 ++-- 15 files changed, 55 insertions(+), 31 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index d1b7f4024..1e48e716a 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -29,7 +29,7 @@ object Versions { } object Fabric { - const val fabricAPI = "0.97.8+${Mod.minecraft}" + const val fabricAPI = "0.104.0+${Mod.minecraft}" } // // object Quilt { @@ -40,8 +40,8 @@ object Versions { object Mod { const val mixin = "0.15.3+mixin.0.8.7" - const val minecraft = "1.20.6" - const val yarn = "$minecraft+build.1" + const val minecraft = "1.21.1" + const val yarn = "$minecraft+build.3" const val fabricLoader = "0.16.5" const val architecuryLoom = "1.7.413" diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java index d6d35508a..308f7913c 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java @@ -3,6 +3,7 @@ import com.dfsek.tectonic.api.TypeRegistry; import com.dfsek.tectonic.api.depth.DepthTracker; import com.dfsek.tectonic.api.exception.LoadException; +import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.EntityType; import net.minecraft.entity.SpawnGroup; import net.minecraft.registry.Registry; @@ -116,6 +117,8 @@ protected Iterable platformAddon() { public abstract Registry multiNoiseBiomeSourceParameterListRegistry(); + public abstract Registry enchantmentRegistry(); + @Override public @NotNull WorldHandle getWorldHandle() { return worldHandle; @@ -125,4 +128,6 @@ protected Iterable platformAddon() { public @NotNull ItemHandle getItemHandle() { return itemHandle; } + + } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java index 8ac07a688..c73ad3f3b 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java @@ -111,10 +111,9 @@ public int getWorldHeight() { return settings.value().generationShapeConfig().height(); } - @Override - public CompletableFuture populateNoise(Executor executor, Blender blender, NoiseConfig noiseConfig, - StructureAccessor structureAccessor, Chunk chunk) { + public CompletableFuture populateNoise(Blender blender, NoiseConfig noiseConfig, StructureAccessor structureAccessor, + Chunk chunk) { return CompletableFuture.supplyAsync(() -> { ProtoWorld world = (ProtoWorld) ((StructureAccessorAccessor) structureAccessor).getWorld(); BiomeProvider biomeProvider = pack.getBiomeProvider(); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java index f260ba3f2..e9a5f5ae4 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java @@ -62,11 +62,11 @@ public Optional> getOptionalWrapper(RegistryKey getEnchantments() { - return Registries.ENCHANTMENT.stream().map(enchantment -> (Enchantment) enchantment).collect(Collectors.toSet()); + return CommonPlatform.get().enchantmentRegistry().stream().map(enchantment -> (Enchantment) (Object) enchantment).collect(Collectors.toSet()); } } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java index ccc8b738a..caf918d1d 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java @@ -48,9 +48,9 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS @Shadow public abstract MobSpawnerLogic getLogic(); - +//method_46408 @Shadow - public abstract void method_46408(net.minecraft.entity.EntityType entityType, Random random); + public abstract void setEntityType(net.minecraft.entity.EntityType entityType, Random random); public EntityType terra$getSpawnedType() { return (EntityType) Registries.ENTITY_TYPE.get( @@ -64,7 +64,7 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS } else { rand = Random.create(); } - method_46408((net.minecraft.entity.EntityType) creatureType, rand); + setEntityType((net.minecraft.entity.EntityType) creatureType, rand); } public int terra$getDelay() { diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/entity/EntityMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/entity/EntityMixin.java index 3225cd4a6..0b2f47017 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/entity/EntityMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/entity/EntityMixin.java @@ -39,14 +39,14 @@ public abstract class EntityMixin { private BlockPos blockPos; @Shadow - public abstract void teleport(double destX, double destY, double destZ); + public abstract void updatePosition(double destX, double destY, double destZ); public Vector3 terra$position() { return MinecraftAdapter.adapt(blockPos); } public void terra$position(Vector3 location) { - teleport(location.getX(), location.getY(), location.getZ()); + updatePosition(location.getX(), location.getY(), location.getZ()); } public ServerWorld terra$world() { diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java index 155836837..70177be1f 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java @@ -21,7 +21,6 @@ import net.minecraft.component.ComponentChanges; import net.minecraft.component.ComponentMap; import net.minecraft.component.ComponentMapImpl; -import net.minecraft.component.DataComponentType; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import org.jetbrains.annotations.Nullable; diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/EnchantmentMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/EnchantmentMixin.java index 24b096c85..dd7cfbce0 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/EnchantmentMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/EnchantmentMixin.java @@ -17,8 +17,13 @@ package com.dfsek.terra.mod.mixin.implementations.terra.inventory.meta; +import com.dfsek.terra.mod.CommonPlatform; + import net.minecraft.enchantment.Enchantment; import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.registry.entry.RegistryEntryList; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Implements; import org.spongepowered.asm.mixin.Interface; import org.spongepowered.asm.mixin.Mixin; @@ -28,6 +33,8 @@ import com.dfsek.terra.api.inventory.ItemStack; +import static net.minecraft.enchantment.Enchantment.canBeCombined; + @Mixin(Enchantment.class) @Implements(@Interface(iface = com.dfsek.terra.api.inventory.item.Enchantment.class, prefix = "terra$")) @@ -36,7 +43,8 @@ public abstract class EnchantmentMixin { public abstract boolean isAcceptableItem(net.minecraft.item.ItemStack stack); @Shadow - public abstract boolean canCombine(Enchantment other); + @Final + private RegistryEntryList exclusiveSet; @SuppressWarnings("ConstantConditions") public boolean terra$canEnchantItem(ItemStack itemStack) { @@ -44,10 +52,10 @@ public abstract class EnchantmentMixin { } public boolean terra$conflictsWith(com.dfsek.terra.api.inventory.item.Enchantment other) { - return !canCombine((Enchantment) other); + return canBeCombined(RegistryEntry.of((Enchantment) (Object) this), RegistryEntry.of((Enchantment) (Object) other)); } public String terra$getID() { - return Objects.requireNonNull(Registries.ENCHANTMENT.getId((Enchantment) (Object) this)).toString(); + return Objects.requireNonNull(CommonPlatform.get().enchantmentRegistry().getId((Enchantment) (Object) this)).toString(); } } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java index 5617f494c..a3bcf54df 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java @@ -22,6 +22,7 @@ import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtList; import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; import org.spongepowered.asm.mixin.Implements; import org.spongepowered.asm.mixin.Interface; import org.spongepowered.asm.mixin.Intrinsic; @@ -46,10 +47,10 @@ public abstract class ItemStackMetaMixin { public abstract ItemEnchantmentsComponent getEnchantments(); @Shadow - public abstract void addEnchantment(net.minecraft.enchantment.Enchantment enchantment, int level); + public abstract void addEnchantment(RegistryEntry enchantment, int level); - public void terra$addEnchantment(Enchantment enchantment, int level) { - addEnchantment((net.minecraft.enchantment.Enchantment) enchantment, level); + public void terra$addEnchantment(Enchantment enchantment, int level) { ; + addEnchantment(RegistryEntry.of((net.minecraft.enchantment.Enchantment) (Object) enchantment), level); } @Intrinsic(displace = true) @@ -60,7 +61,7 @@ public abstract class ItemStackMetaMixin { ItemEnchantmentsComponent enchantments = getEnchantments(); enchantments.getEnchantments().forEach(enchantment -> { net.minecraft.enchantment.Enchantment enchantmentValue = enchantment.value(); - map.put((Enchantment) enchantmentValue, enchantments.getLevel(enchantmentValue)); + map.put((Enchantment) (Object) enchantmentValue, enchantments.getLevel(RegistryEntry.of(enchantmentValue))); }); return map; } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java index 1a0e9e0df..7ae5441d0 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java @@ -21,10 +21,12 @@ import net.minecraft.block.FluidBlock; import net.minecraft.fluid.Fluid; +import net.minecraft.util.collection.BoundedRegionArray; import net.minecraft.util.math.BlockPos; import net.minecraft.world.ChunkRegion; import net.minecraft.world.WorldAccess; import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkGenerationStep; import net.minecraft.world.chunk.ChunkStatus; import net.minecraft.world.tick.MultiTickScheduler; import net.minecraft.world.tick.OrderedTick; @@ -76,10 +78,9 @@ public abstract class ChunkRegionMixin { @Inject(at = @At("RETURN"), - method = "(Lnet/minecraft/server/world/ServerWorld;Ljava/util/List;Lnet/minecraft/world/chunk/ChunkStatus;I)V") - public void injectConstructor(net.minecraft.server.world.ServerWorld world, List list, - ChunkStatus chunkStatus, int i, - CallbackInfo ci) { + method = "(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/collection/BoundedRegionArray;Lnet/minecraft/world/chunk/ChunkGenerationStep;Lnet/minecraft/world/chunk/Chunk;)V") + public void injectConstructor(net.minecraft.server.world.ServerWorld world, BoundedRegionArray chunks, + ChunkGenerationStep generationStep, Chunk centerPos, CallbackInfo ci) { this.terra$config = ((ServerWorld) world).getPack(); } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/util/PresetUtil.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/util/PresetUtil.java index 1c8627364..de147c509 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/util/PresetUtil.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/util/PresetUtil.java @@ -45,7 +45,7 @@ public static Pair createDefault(ConfigPack pack, ModPl .orElseThrow(); - Identifier generatorID = Identifier.of("terra", pack.getID().toLowerCase(Locale.ROOT) + "/" + pack.getNamespace().toLowerCase( + Identifier generatorID = Identifier.tryParse("terra:" + pack.getID().toLowerCase(Locale.ROOT) + "/" + pack.getNamespace().toLowerCase( Locale.ROOT)); PRESETS.add(generatorID); diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecyclePlatform.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecyclePlatform.java index 41a57b448..391842311 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecyclePlatform.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecyclePlatform.java @@ -4,6 +4,7 @@ import ca.solostudios.strata.parser.tokenizer.ParseException; import ca.solostudios.strata.version.Version; import net.minecraft.MinecraftVersion; +import net.minecraft.enchantment.Enchantment; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKeys; import net.minecraft.server.MinecraftServer; @@ -34,6 +35,7 @@ public abstract class LifecyclePlatform extends ModPlatform { private static final AtomicReference> DIMENSIONS = new AtomicReference<>(); private static final AtomicReference> SETTINGS = new AtomicReference<>(); private static final AtomicReference> NOISE = new AtomicReference<>(); + private static final AtomicReference> ENCHANTMENT = new AtomicReference<>(); private static MinecraftServer server; public LifecyclePlatform() { @@ -44,11 +46,13 @@ public LifecyclePlatform() { public static void setRegistries(Registry biomeRegistry, Registry dimensionTypeRegistry, Registry chunkGeneratorSettingsRegistry, - Registry multiNoiseBiomeSourceParameterListRegistry) { + Registry multiNoiseBiomeSourceParameterListRegistry, + Registry enchantmentRegistry) { BIOMES.set(biomeRegistry); DIMENSIONS.set(dimensionTypeRegistry); SETTINGS.set(chunkGeneratorSettingsRegistry); NOISE.set(multiNoiseBiomeSourceParameterListRegistry); + ENCHANTMENT.set(enchantmentRegistry); } @Override @@ -141,5 +145,10 @@ public Registry multiNoiseBiomeSourceParamet return NOISE.get(); } + @Override + public Registry enchantmentRegistry() { + return ENCHANTMENT.get(); + } + protected abstract Collection getPlatformMods(); } diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java index b54ee9a02..a5d2a9bde 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java @@ -1,6 +1,7 @@ package com.dfsek.terra.lifecycle.mixin.lifecycle; import com.mojang.datafixers.util.Pair; +import net.minecraft.enchantment.Enchantment; import net.minecraft.registry.DynamicRegistryManager; import net.minecraft.registry.DynamicRegistryManager.Immutable; import net.minecraft.registry.MutableRegistry; @@ -70,8 +71,9 @@ private static void grabManager(List> instance, Consume RegistryKeys.CHUNK_GENERATOR_SETTINGS).orElseThrow(); MutableRegistry multiNoiseBiomeSourceParameterLists = extractRegistry(instance, RegistryKeys.MULTI_NOISE_BIOME_SOURCE_PARAMETER_LIST).orElseThrow(); + MutableRegistry enchantments = extractRegistry(instance, RegistryKeys.ENCHANTMENT).orElseThrow(); - LifecyclePlatform.setRegistries(biomes, dimensionTypes, chunkGeneratorSettings, multiNoiseBiomeSourceParameterLists); + LifecyclePlatform.setRegistries(biomes, dimensionTypes, chunkGeneratorSettings, multiNoiseBiomeSourceParameterLists, enchantments); LifecycleUtil.initialize(biomes, worldPresets); }); initialized = true; diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/BiomeUtil.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/BiomeUtil.java index 5d5ab11c0..b32e12935 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/BiomeUtil.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/BiomeUtil.java @@ -58,7 +58,7 @@ private static void registerBiome(Biome biome, ConfigPack pack, net.minecraft.world.biome.Biome minecraftBiome = MinecraftUtil.createBiome(biome, Objects.requireNonNull(registry.get(vanilla)), vanillaBiomeProperties); - Identifier identifier = new Identifier("terra", MinecraftUtil.createBiomeID(pack, id)); + Identifier identifier = Identifier.of("terra", MinecraftUtil.createBiomeID(pack, id)); if(registry.containsId(identifier)) { ((ProtoPlatformBiome) biome.getPlatformBiome()).setDelegate(MinecraftUtil.getEntry(registry, identifier) diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/RegistryUtil.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/RegistryUtil.java index 03f0639c7..69bc2ce21 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/RegistryUtil.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/RegistryUtil.java @@ -13,7 +13,7 @@ private RegistryUtil() { } public static void register() { - Registry.register(Registries.CHUNK_GENERATOR, new Identifier("terra:terra"), Codecs.MINECRAFT_CHUNK_GENERATOR_WRAPPER); - Registry.register(Registries.BIOME_SOURCE, new Identifier("terra:terra"), Codecs.TERRA_BIOME_SOURCE); + Registry.register(Registries.CHUNK_GENERATOR, Identifier.of("terra:terra"), Codecs.MINECRAFT_CHUNK_GENERATOR_WRAPPER); + Registry.register(Registries.BIOME_SOURCE, Identifier.of("terra:terra"), Codecs.TERRA_BIOME_SOURCE); } } From b63f5f4a8fd72587aa0e450a7823fc1b0ffe65d8 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Wed, 18 Sep 2024 12:43:41 -0600 Subject: [PATCH 095/126] Reformat --- .../src/main/kotlin/DistributionConfig.kt | 3 +- .../v2/config/BiomePipelineTemplate.java | 2 +- .../pipeline/api/delegate/SelfDelegate.java | 4 +- .../config/BiomePipelineTemplate.java | 2 +- .../config/BiomeProviderTemplate.java | 2 +- .../generation/NoiseChunkGenerator3D.java | 6 +-- .../commands/addons/AddonsCommandAddon.java | 6 +-- .../structure/StructureCommandAddon.java | 14 ++--- .../dfsek/terra/addons/noise/NoiseAddon.java | 39 +++----------- .../templates/ImageSamplerTemplate.java | 9 ++-- .../noise/SaltedNoiseFunction2.java | 3 +- .../noise/SaltedNoiseFunction3.java | 3 +- .../feature/FeatureGenerationStage.java | 2 +- .../addons/terrascript/parser/ParserUtil.java | 8 +-- .../command/arguments/RegistryArgument.java | 25 +++++---- .../platform/CommandRegistrationEvent.java | 4 +- .../api/util/reflection/ReflectionUtil.java | 4 +- .../event/FunctionalEventHandlerImpl.java | 17 +++--- .../com/dfsek/terra/bukkit/BukkitEntity.java | 6 +-- .../dfsek/terra/bukkit/TerraBukkitPlugin.java | 10 ++-- .../bukkit/handles/BukkitWorldHandle.java | 5 +- .../dfsek/terra/bukkit/nms/Initializer.java | 5 +- .../dfsek/terra/bukkit/util/VersionUtil.java | 2 +- .../bukkit/nms/v1_21/AwfulBukkitHacks.java | 4 +- .../bukkit/nms/v1_21/NMSBiomeProvider.java | 8 +-- .../bukkit/nms/v1_21/NMSInjectListener.java | 4 +- .../java/com/dfsek/terra/mod/ModPlatform.java | 52 +++++++++---------- .../config/BiomeParticleConfigTemplate.java | 3 +- .../mod/config/SpawnSettingsTemplate.java | 2 +- .../terra/mod/config/SpawnTypeConfig.java | 6 +-- .../MinecraftChunkGeneratorWrapper.java | 2 - .../mod/generation/TerraBiomeSource.java | 1 - .../terra/mod/handle/MinecraftItemHandle.java | 5 +- .../mod/handle/MinecraftWorldHandle.java | 5 +- .../entity/MobSpawnerBlockEntityMixin.java | 5 +- .../terra/block/state/BlockStateMixin.java | 1 - .../terra/inventory/item/ItemStackMixin.java | 11 ++-- .../inventory/meta/EnchantmentMixin.java | 10 ++-- .../inventory/meta/ItemStackMetaMixin.java | 6 +-- .../terra/world/ChunkRegionMixin.java | 9 ++-- .../lifecycle/DataPackContentsMixin.java | 1 + .../com/dfsek/terra/mod/util/PresetUtil.java | 5 +- .../terra/lifecycle/LifecycleEntryPoint.java | 4 +- .../mixin/lifecycle/RegistryLoaderMixin.java | 49 ++++++----------- .../mixin/lifecycle/SaveLoadingMixin.java | 8 ++- 45 files changed, 163 insertions(+), 219 deletions(-) diff --git a/buildSrc/src/main/kotlin/DistributionConfig.kt b/buildSrc/src/main/kotlin/DistributionConfig.kt index 12ebd8376..0a1c2d060 100644 --- a/buildSrc/src/main/kotlin/DistributionConfig.kt +++ b/buildSrc/src/main/kotlin/DistributionConfig.kt @@ -27,7 +27,8 @@ fun Project.configureDistribution() { group = "terra" doFirst { file("${buildDir}/resources/main/packs/").deleteRecursively() - val defaultPackUrl = URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/" + Versions.Terra.overworldConfig + "/default.zip") + val defaultPackUrl = + URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/" + Versions.Terra.overworldConfig + "/default.zip") downloadPack(defaultPackUrl, project) } } diff --git a/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/config/BiomePipelineTemplate.java b/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/config/BiomePipelineTemplate.java index 937a1b7df..75ffb8d65 100644 --- a/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/config/BiomePipelineTemplate.java +++ b/common/addons/biome-provider-pipeline-v2/src/main/java/com/dfsek/terra/addons/biome/pipeline/v2/config/BiomePipelineTemplate.java @@ -29,7 +29,7 @@ public class BiomePipelineTemplate implements ObjectTemplate { @Default @Description(""" The resolution at which to sample biomes. - + Larger values are quadratically faster, but produce lower quality results. For example, a value of 3 would sample every 3 blocks.""") protected @Meta int resolution = 1; diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/delegate/SelfDelegate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/delegate/SelfDelegate.java index 6b62818d2..c6762334a 100644 --- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/delegate/SelfDelegate.java +++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/delegate/SelfDelegate.java @@ -1,10 +1,10 @@ package com.dfsek.terra.addons.biome.pipeline.api.delegate; +import com.dfsek.terra.api.world.biome.Biome; + import java.util.Collections; import java.util.Set; -import com.dfsek.terra.api.world.biome.Biome; - final class SelfDelegate implements BiomeDelegate { public static final SelfDelegate INSTANCE = new SelfDelegate(); diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java index 491f019ba..1566de524 100644 --- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java +++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java @@ -28,7 +28,7 @@ public class BiomePipelineTemplate extends BiomeProviderTemplate { @Description(""" The initial size of biome chunks. This value must be at least 2. This is not the final size of biome chunks. Final chunks will be much larger. - + It is recommended to keep biome chunks' final size in the range of [50, 300] to prevent performance issues. To calculate the size of biome chunks, simply take initial-size and for each expand stage, multiply the running value by 2 diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java index f42fd7c20..93f84e80a 100644 --- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java +++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java @@ -22,7 +22,7 @@ public abstract class BiomeProviderTemplate implements ObjectTemplate>> NOISE_SAMPLER_TOKEN = new TypeKey<>() { diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/ImageSamplerTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/ImageSamplerTemplate.java index c7359426c..5503533d4 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/ImageSamplerTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/ImageSamplerTemplate.java @@ -8,15 +8,16 @@ package com.dfsek.terra.addons.noise.config.templates; import com.dfsek.tectonic.api.config.template.annotations.Value; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.awt.image.BufferedImage; import com.dfsek.terra.addons.noise.samplers.ImageSampler; import com.dfsek.terra.api.config.meta.Meta; import com.dfsek.terra.api.noise.NoiseSampler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.awt.image.BufferedImage; + @SuppressWarnings({ "unused", "FieldMayBeFinal" }) public class ImageSamplerTemplate extends SamplerTemplate { diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java index 2e8f72929..41ddd1247 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction2.java @@ -3,11 +3,10 @@ import com.dfsek.paralithic.functions.dynamic.Context; import com.dfsek.paralithic.functions.dynamic.DynamicFunction; import com.dfsek.paralithic.node.Statefulness; +import org.jetbrains.annotations.NotNull; import com.dfsek.terra.api.noise.NoiseSampler; -import org.jetbrains.annotations.NotNull; - public class SaltedNoiseFunction2 implements DynamicFunction { private final NoiseSampler gen; diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction3.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction3.java index 5dc483d5c..d4549127c 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction3.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/paralithic/noise/SaltedNoiseFunction3.java @@ -3,11 +3,10 @@ import com.dfsek.paralithic.functions.dynamic.Context; import com.dfsek.paralithic.functions.dynamic.DynamicFunction; import com.dfsek.paralithic.node.Statefulness; +import org.jetbrains.annotations.NotNull; import com.dfsek.terra.api.noise.NoiseSampler; -import org.jetbrains.annotations.NotNull; - public class SaltedNoiseFunction3 implements DynamicFunction { private final NoiseSampler gen; diff --git a/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java b/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java index 123107d15..11a1e3ca7 100644 --- a/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java +++ b/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java @@ -62,7 +62,7 @@ public void populate(ProtoWorld world) { world.getBiomeProvider() .getColumn( tx + (doBlending ? (int) (blendSampler.noise(seed, tx, tz) * blendAmplitude) : 0), - tz + (doBlending ? (int) (blendSampler.noise(seed+1, tx, tz) * blendAmplitude) : 0), + tz + (doBlending ? (int) (blendSampler.noise(seed + 1, tx, tz) * blendAmplitude) : 0), world) .forRanges(resolution, (min, max, biome) -> { for(int subChunkX = 0; subChunkX < resolution; subChunkX++) { diff --git a/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/ParserUtil.java b/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/ParserUtil.java index 4fc805a8f..b982b0979 100644 --- a/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/ParserUtil.java +++ b/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/ParserUtil.java @@ -7,15 +7,15 @@ package com.dfsek.terra.addons.terrascript.parser; +import com.dfsek.terra.addons.terrascript.parser.exceptions.ParseException; +import com.dfsek.terra.addons.terrascript.parser.lang.Returnable; +import com.dfsek.terra.addons.terrascript.tokenizer.Token; + import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import com.dfsek.terra.addons.terrascript.parser.exceptions.ParseException; -import com.dfsek.terra.addons.terrascript.parser.lang.Returnable; -import com.dfsek.terra.addons.terrascript.tokenizer.Token; - public class ParserUtil { diff --git a/common/api/src/main/java/com/dfsek/terra/api/command/arguments/RegistryArgument.java b/common/api/src/main/java/com/dfsek/terra/api/command/arguments/RegistryArgument.java index 91d6b56b9..8e15c18ce 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/command/arguments/RegistryArgument.java +++ b/common/api/src/main/java/com/dfsek/terra/api/command/arguments/RegistryArgument.java @@ -2,6 +2,15 @@ import io.leangen.geantyref.TypeToken; import org.checkerframework.checker.nullness.qual.NonNull; +import org.incendo.cloud.component.CommandComponent; +import org.incendo.cloud.component.DefaultValue; +import org.incendo.cloud.context.CommandContext; +import org.incendo.cloud.context.CommandInput; +import org.incendo.cloud.parser.ArgumentParseResult; +import org.incendo.cloud.parser.ArgumentParser; +import org.incendo.cloud.parser.ParserDescriptor; +import org.incendo.cloud.suggestion.Suggestion; +import org.incendo.cloud.suggestion.SuggestionProvider; import java.util.Optional; import java.util.concurrent.CompletableFuture; @@ -13,16 +22,6 @@ import com.dfsek.terra.api.registry.key.RegistryKey; import com.dfsek.terra.api.util.reflection.TypeKey; -import org.incendo.cloud.component.CommandComponent; -import org.incendo.cloud.component.DefaultValue; -import org.incendo.cloud.context.CommandContext; -import org.incendo.cloud.context.CommandInput; -import org.incendo.cloud.parser.ArgumentParseResult; -import org.incendo.cloud.parser.ArgumentParser; -import org.incendo.cloud.parser.ParserDescriptor; -import org.incendo.cloud.suggestion.Suggestion; -import org.incendo.cloud.suggestion.SuggestionProvider; - public class RegistryArgument { @@ -49,17 +48,17 @@ public static Builder builder(String name, Function CommandComponent of(String name, Function, Registry> registryFunction, - TypeKey registryType) { + TypeKey registryType) { return RegistryArgument.builder(name, registryFunction, registryType).build(); } public static CommandComponent optional(String name, Function, Registry> registryFunction, - TypeKey registryType) { + TypeKey registryType) { return RegistryArgument.builder(name, registryFunction, registryType).optional().build(); } public static CommandComponent optional(String name, Function, Registry> registryFunction, - TypeKey registryType, DefaultValue defaultKey) { + TypeKey registryType, DefaultValue defaultKey) { return RegistryArgument.builder(name, registryFunction, registryType).optional(defaultKey).build(); } diff --git a/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java b/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java index 3ad041c9b..80088ff6d 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java +++ b/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java @@ -1,10 +1,10 @@ package com.dfsek.terra.api.event.events.platform; +import org.incendo.cloud.CommandManager; + import com.dfsek.terra.api.command.CommandSender; import com.dfsek.terra.api.event.events.Event; -import org.incendo.cloud.CommandManager; - public class CommandRegistrationEvent implements Event { private final CommandManager commandManager; diff --git a/common/api/src/main/java/com/dfsek/terra/api/util/reflection/ReflectionUtil.java b/common/api/src/main/java/com/dfsek/terra/api/util/reflection/ReflectionUtil.java index 6b0c8fd28..2583b9ab6 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/util/reflection/ReflectionUtil.java +++ b/common/api/src/main/java/com/dfsek/terra/api/util/reflection/ReflectionUtil.java @@ -30,11 +30,11 @@ public final class ReflectionUtil { private static final Unsafe UNSAFE; static { - try{ + try { final Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe"); unsafeField.setAccessible(true); UNSAFE = (Unsafe) unsafeField.get(null); - } catch(NoSuchFieldException | IllegalAccessException e){ + } catch(NoSuchFieldException | IllegalAccessException e) { throw new RuntimeException(e); } } diff --git a/common/implementation/base/src/main/java/com/dfsek/terra/event/FunctionalEventHandlerImpl.java b/common/implementation/base/src/main/java/com/dfsek/terra/event/FunctionalEventHandlerImpl.java index 67f984646..a35bf9366 100644 --- a/common/implementation/base/src/main/java/com/dfsek/terra/event/FunctionalEventHandlerImpl.java +++ b/common/implementation/base/src/main/java/com/dfsek/terra/event/FunctionalEventHandlerImpl.java @@ -17,17 +17,6 @@ package com.dfsek.terra.event; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import com.dfsek.terra.api.addon.BaseAddon; import com.dfsek.terra.api.event.events.Event; import com.dfsek.terra.api.event.events.FailThroughEvent; @@ -36,6 +25,12 @@ import com.dfsek.terra.api.event.functional.FunctionalEventHandler; import com.dfsek.terra.api.util.reflection.TypeKey; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.lang.reflect.Type; +import java.util.*; + public class FunctionalEventHandlerImpl implements FunctionalEventHandler { private static final Logger logger = LoggerFactory.getLogger(FunctionalEventHandlerImpl.class); diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/BukkitEntity.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/BukkitEntity.java index 6df268180..98f44e2ec 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/BukkitEntity.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/BukkitEntity.java @@ -17,14 +17,14 @@ package com.dfsek.terra.bukkit; -import io.papermc.lib.PaperLib; -import org.bukkit.Location; - import com.dfsek.terra.api.entity.Entity; import com.dfsek.terra.api.util.vector.Vector3; import com.dfsek.terra.api.world.ServerWorld; import com.dfsek.terra.bukkit.world.BukkitAdapter; +import io.papermc.lib.PaperLib; +import org.bukkit.Location; + public class BukkitEntity implements Entity { private final org.bukkit.entity.Entity entity; diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java index 8c392dba1..e3bc1d837 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/TerraBukkitPlugin.java @@ -79,7 +79,7 @@ public void onEnable() { } catch(Exception e) { // This should never happen. logger.error(""" TERRA HAS BEEN DISABLED - + Errors occurred while registering commands. Please report this to Terra. """.strip(), e); @@ -102,13 +102,13 @@ private LegacyPaperCommandManager getCommandSenderPaperCommandMan BukkitAdapter::adapt )); - if (commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) { + if(commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) { commandManager.registerBrigadier(); final CloudBrigadierManager brigManager = commandManager.brigadierManager(); if(brigManager != null) { brigManager.setNativeNumberSuggestions(false); } - } else if (commandManager.hasCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION)) { + } else if(commandManager.hasCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION)) { commandManager.registerAsynchronousCompletions(); } @@ -181,7 +181,7 @@ private boolean doVersionCheck() { logger.warn(""" You are using Mohist, so we will not give you any support for issues that may arise. Since you enabled the "IKnowMohistCausesLotsOfIssuesButIWillUseItAnyways" flag, we won't disable Terra. But be warned. - + > I felt a great disturbance in the JVM, as if millions of plugins suddenly cried out in stack traces and were suddenly silenced. > I fear something terrible has happened. > - Astrash @@ -194,7 +194,7 @@ private boolean doVersionCheck() { @Override public @Nullable ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id) { - if (id == null || id.trim().equals("")) { return null; } + if(id == null || id.trim().equals("")) { return null; } return new BukkitChunkGeneratorWrapper(generatorMap.computeIfAbsent(worldName, name -> { ConfigPack pack = platform.getConfigRegistry().getByID(id).orElseThrow( () -> new IllegalArgumentException("No such config pack \"" + id + "\"")); diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java index c6113bbd7..97f932c81 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java @@ -61,8 +61,9 @@ public BukkitWorldHandle() { @Override public @NotNull EntityType getEntity(@NotNull String id) { - if (!id.contains(":")) { //TODO: remove in 7.0 - String newid = "minecraft:" + id.toLowerCase();; + if(!id.contains(":")) { //TODO: remove in 7.0 + String newid = "minecraft:" + id.toLowerCase(); + ; logger.warn( "Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" + ". You are advised to perform this rename in your config backs as this translation will be removed in the next major " + diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java index 3f7375bc4..fc28e4bc3 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/nms/Initializer.java @@ -1,11 +1,10 @@ package com.dfsek.terra.bukkit.nms; -import com.dfsek.terra.bukkit.util.VersionUtil; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.dfsek.terra.bukkit.PlatformImpl; +import com.dfsek.terra.bukkit.util.VersionUtil; public interface Initializer { @@ -16,7 +15,7 @@ static boolean init(PlatformImpl platform) { Logger logger = LoggerFactory.getLogger(Initializer.class); try { String packageVersion = NMS; - if (NMS.equals("v1_21_1")) { + if(NMS.equals("v1_21_1")) { packageVersion = "v1_21"; } diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java index 6a8c662e0..3f32b6be2 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/VersionUtil.java @@ -112,7 +112,7 @@ public String toString() { if(major == -1 && minor == -1 && patch == -1) return "Unknown"; - if (patch >= 0) { + if(patch >= 0) { return String.format("v%d.%d.%d", major, minor, patch); } else { return String.format("v%d.%d", major, minor); diff --git a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java index fc5cc0367..42d683394 100644 --- a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java @@ -10,7 +10,6 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.biome.Biome; import org.bukkit.NamespacedKey; import org.slf4j.Logger; @@ -42,7 +41,8 @@ public static void registerBiomes(ConfigRegistry configRegistry) { try { BukkitPlatformBiome platformBiome = (BukkitPlatformBiome) biome.getPlatformBiome(); NamespacedKey vanillaBukkitKey = platformBiome.getHandle().getKey(); - ResourceLocation vanillaMinecraftKey = ResourceLocation.fromNamespaceAndPath(vanillaBukkitKey.getNamespace(), vanillaBukkitKey.getKey()); + ResourceLocation vanillaMinecraftKey = ResourceLocation.fromNamespaceAndPath(vanillaBukkitKey.getNamespace(), + vanillaBukkitKey.getKey()); Biome platform = NMSBiomeInjector.createBiome(biome, Objects.requireNonNull(biomeRegistry.get(vanillaMinecraftKey))); ResourceKey delegateKey = ResourceKey.create( diff --git a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeProvider.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeProvider.java index 18184144f..8abe26a51 100644 --- a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeProvider.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSBiomeProvider.java @@ -37,10 +37,10 @@ protected Stream> collectPossibleBiomes() { @Override protected @NotNull MapCodec codec() { return MapCodec.assumeMapUnsafe(BiomeSource.CODEC); -// return MapCodec.unit(null); -// BuiltInRegistries.BIOME_SOURCE.byNameCodec().dispatchMap(this::codec, Function.identity()); -// BuiltInRegistries.BIOME_SOURCE.byNameCodec().dispatchStable(BiomeSource::codec, Function.identity()); -// return BiomeSource.CODEC; + // return MapCodec.unit(null); + // BuiltInRegistries.BIOME_SOURCE.byNameCodec().dispatchMap(this::codec, Function.identity()); + // BuiltInRegistries.BIOME_SOURCE.byNameCodec().dispatchStable(BiomeSource::codec, Function.identity()); + // return BiomeSource.CODEC; } @Override diff --git a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java index b471faa88..927b019ed 100644 --- a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java @@ -1,12 +1,9 @@ package com.dfsek.terra.bukkit.nms.v1_21; -import com.dfsek.terra.api.util.reflection.ReflectionUtil; - import net.minecraft.server.level.ChunkMap; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.chunk.status.WorldGenContext; -import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.event.EventHandler; @@ -20,6 +17,7 @@ import java.util.concurrent.locks.ReentrantLock; import com.dfsek.terra.api.config.ConfigPack; +import com.dfsek.terra.api.util.reflection.ReflectionUtil; import com.dfsek.terra.bukkit.generator.BukkitChunkGeneratorWrapper; diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java index 308f7913c..09681f6b6 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/ModPlatform.java @@ -68,32 +68,32 @@ public void registerWorldTypes(BiConsumer registerFunct public void register(TypeRegistry registry) { super.register(registry); registry.registerLoader(PlatformBiome.class, (type, o, loader, depthTracker) -> parseBiome((String) o, depthTracker)) - .registerLoader(Identifier.class, (type, o, loader, depthTracker) -> { - Identifier identifier = Identifier.tryParse((String) o); - if(identifier == null) - throw new LoadException("Invalid identifier: " + o, depthTracker); - return identifier; - }) - .registerLoader(Precipitation.class, (type, o, loader, depthTracker) -> Precipitation.valueOf(((String) o).toUpperCase( - Locale.ROOT))) - .registerLoader(GrassColorModifier.class, - (type, o, loader, depthTracker) -> GrassColorModifier.valueOf(((String) o).toUpperCase( - Locale.ROOT))) - .registerLoader(GrassColorModifier.class, - (type, o, loader, depthTracker) -> TemperatureModifier.valueOf(((String) o).toUpperCase( - Locale.ROOT))) - .registerLoader(SpawnGroup.class,(type, o, loader, depthTracker) -> SpawnGroup.valueOf((String) o)) - .registerLoader(BiomeParticleConfig.class, BiomeParticleConfigTemplate::new) - .registerLoader(SoundEvent.class, SoundEventTemplate::new) - .registerLoader(BiomeMoodSound.class, BiomeMoodSoundTemplate::new) - .registerLoader(BiomeAdditionsSound.class, BiomeAdditionsSoundTemplate::new) - .registerLoader(MusicSound.class, MusicSoundTemplate::new) - .registerLoader(EntityType.class, EntityTypeTemplate::new) - .registerLoader(SpawnCostConfig.class, SpawnCostConfig::new) - .registerLoader(SpawnEntry.class, SpawnEntryTemplate::new) - .registerLoader(SpawnTypeConfig.class, SpawnTypeConfig::new) - .registerLoader(SpawnSettings.class, SpawnSettingsTemplate::new) - .registerLoader(VillagerType.class, VillagerTypeTemplate::new); + .registerLoader(Identifier.class, (type, o, loader, depthTracker) -> { + Identifier identifier = Identifier.tryParse((String) o); + if(identifier == null) + throw new LoadException("Invalid identifier: " + o, depthTracker); + return identifier; + }) + .registerLoader(Precipitation.class, (type, o, loader, depthTracker) -> Precipitation.valueOf(((String) o).toUpperCase( + Locale.ROOT))) + .registerLoader(GrassColorModifier.class, + (type, o, loader, depthTracker) -> GrassColorModifier.valueOf(((String) o).toUpperCase( + Locale.ROOT))) + .registerLoader(GrassColorModifier.class, + (type, o, loader, depthTracker) -> TemperatureModifier.valueOf(((String) o).toUpperCase( + Locale.ROOT))) + .registerLoader(SpawnGroup.class, (type, o, loader, depthTracker) -> SpawnGroup.valueOf((String) o)) + .registerLoader(BiomeParticleConfig.class, BiomeParticleConfigTemplate::new) + .registerLoader(SoundEvent.class, SoundEventTemplate::new) + .registerLoader(BiomeMoodSound.class, BiomeMoodSoundTemplate::new) + .registerLoader(BiomeAdditionsSound.class, BiomeAdditionsSoundTemplate::new) + .registerLoader(MusicSound.class, MusicSoundTemplate::new) + .registerLoader(EntityType.class, EntityTypeTemplate::new) + .registerLoader(SpawnCostConfig.class, SpawnCostConfig::new) + .registerLoader(SpawnEntry.class, SpawnEntryTemplate::new) + .registerLoader(SpawnTypeConfig.class, SpawnTypeConfig::new) + .registerLoader(SpawnSettings.class, SpawnSettingsTemplate::new) + .registerLoader(VillagerType.class, VillagerTypeTemplate::new); } private ProtoPlatformBiome parseBiome(String id, DepthTracker tracker) throws LoadException { diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/BiomeParticleConfigTemplate.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/BiomeParticleConfigTemplate.java index 3bc4474b6..457566444 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/BiomeParticleConfigTemplate.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/BiomeParticleConfigTemplate.java @@ -28,7 +28,8 @@ public BiomeParticleConfig get() { try { return new BiomeParticleConfig( - ParticleEffectArgumentType.readParameters(new StringReader(particle), (RegistryWrapper.WrapperLookup) Registries.PARTICLE_TYPE.getReadOnlyWrapper()), + ParticleEffectArgumentType.readParameters(new StringReader(particle), + (RegistryWrapper.WrapperLookup) Registries.PARTICLE_TYPE.getReadOnlyWrapper()), probability); } catch(CommandSyntaxException e) { throw new RuntimeException(e); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnSettingsTemplate.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnSettingsTemplate.java index 86e9de007..a0e8932e5 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnSettingsTemplate.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnSettingsTemplate.java @@ -28,7 +28,7 @@ public SpawnSettings get() { SpawnSettings.Builder builder = new SpawnSettings.Builder(); for(SpawnTypeConfig spawn : spawns) { SpawnGroup group = spawn.getGroup(); - for (SpawnEntry entry : spawn.getEntry()) { + for(SpawnEntry entry : spawn.getEntry()) { builder.spawn(group, entry); } } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnTypeConfig.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnTypeConfig.java index b18c87e62..0eba7ca67 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnTypeConfig.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/config/SpawnTypeConfig.java @@ -13,15 +13,15 @@ public class SpawnTypeConfig implements ObjectTemplate { @Value("group") @Default private SpawnGroup group = null; - + @Value("entries") @Default private List entry = null; - + public SpawnGroup getGroup() { return group; } - + public List getEntry() { return entry; } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java index c73ad3f3b..46f5601de 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/MinecraftChunkGeneratorWrapper.java @@ -17,7 +17,6 @@ package com.dfsek.terra.mod.generation; -import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -49,7 +48,6 @@ import java.util.List; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; import com.dfsek.terra.api.config.ConfigPack; import com.dfsek.terra.api.world.biome.generation.BiomeProvider; diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/TerraBiomeSource.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/TerraBiomeSource.java index 533a8c98b..81651ece8 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/TerraBiomeSource.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/generation/TerraBiomeSource.java @@ -17,7 +17,6 @@ package com.dfsek.terra.mod.generation; -import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.world.biome.Biome; diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java index e9a5f5ae4..c9ef02f37 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java @@ -21,10 +21,8 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import net.minecraft.command.CommandRegistryAccess; import net.minecraft.command.argument.ItemStackArgumentType; -import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryWrapper; import net.minecraft.registry.RegistryWrapper.Impl; import net.minecraft.util.Identifier; @@ -67,6 +65,7 @@ public Enchantment getEnchantment(String id) { @Override public Set getEnchantments() { - return CommonPlatform.get().enchantmentRegistry().stream().map(enchantment -> (Enchantment) (Object) enchantment).collect(Collectors.toSet()); + return CommonPlatform.get().enchantmentRegistry().stream().map(enchantment -> (Enchantment) (Object) enchantment).collect( + Collectors.toSet()); } } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java index 3b5e1fe49..c36744d18 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftWorldHandle.java @@ -64,8 +64,9 @@ public class MinecraftWorldHandle implements WorldHandle { @Override public @NotNull EntityType getEntity(@NotNull String id) { - if (!id.contains(":")) { //TODO: remove in 7.0 - String newid = "minecraft:" + id.toLowerCase();; + if(!id.contains(":")) { //TODO: remove in 7.0 + String newid = "minecraft:" + id.toLowerCase(); + ; logger.warn( "Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" + ". You are advised to perform this rename in your config packs as this translation will be removed in the next major " + diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java index caf918d1d..15e8fab34 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java @@ -48,7 +48,8 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS @Shadow public abstract MobSpawnerLogic getLogic(); -//method_46408 + + //method_46408 @Shadow public abstract void setEntityType(net.minecraft.entity.EntityType entityType, Random random); @@ -59,7 +60,7 @@ private MobSpawnerBlockEntityMixin(BlockEntityType type, BlockPos pos, BlockS public void terra$setSpawnedType(@NotNull EntityType creatureType) { Random rand; - if (hasWorld()) { + if(hasWorld()) { rand = world.getRandom(); } else { rand = Random.create(); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/state/BlockStateMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/state/BlockStateMixin.java index 9ecb3eccc..4243bf942 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/state/BlockStateMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/state/BlockStateMixin.java @@ -1,7 +1,6 @@ package com.dfsek.terra.mod.mixin.implementations.terra.block.state; -import com.google.common.collect.ImmutableMap; import com.mojang.serialization.MapCodec; import it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap; import net.minecraft.block.AbstractBlock.AbstractBlockState; diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java index 70177be1f..76121f64b 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java @@ -17,13 +17,10 @@ package com.dfsek.terra.mod.mixin.implementations.terra.inventory.item; -import net.minecraft.component.Component; import net.minecraft.component.ComponentChanges; import net.minecraft.component.ComponentMap; import net.minecraft.component.ComponentMapImpl; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Implements; import org.spongepowered.asm.mixin.Interface; @@ -38,6 +35,10 @@ @Mixin(ItemStack.class) @Implements(@Interface(iface = com.dfsek.terra.api.inventory.ItemStack.class, prefix = "terra$")) public abstract class ItemStackMixin { + @Shadow + @Final + private ComponentMapImpl components; + @Shadow public abstract int getCount(); @@ -53,10 +54,6 @@ public abstract class ItemStackMixin { @Shadow public abstract ComponentMap getComponents(); - @Shadow - @Final - private ComponentMapImpl components; - public int terra$getAmount() { return getCount(); } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/EnchantmentMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/EnchantmentMixin.java index dd7cfbce0..8f58fb9d8 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/EnchantmentMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/EnchantmentMixin.java @@ -17,10 +17,7 @@ package com.dfsek.terra.mod.mixin.implementations.terra.inventory.meta; -import com.dfsek.terra.mod.CommonPlatform; - import net.minecraft.enchantment.Enchantment; -import net.minecraft.registry.Registries; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.registry.entry.RegistryEntryList; import org.spongepowered.asm.mixin.Final; @@ -32,6 +29,7 @@ import java.util.Objects; import com.dfsek.terra.api.inventory.ItemStack; +import com.dfsek.terra.mod.CommonPlatform; import static net.minecraft.enchantment.Enchantment.canBeCombined; @@ -39,13 +37,13 @@ @Mixin(Enchantment.class) @Implements(@Interface(iface = com.dfsek.terra.api.inventory.item.Enchantment.class, prefix = "terra$")) public abstract class EnchantmentMixin { - @Shadow - public abstract boolean isAcceptableItem(net.minecraft.item.ItemStack stack); - @Shadow @Final private RegistryEntryList exclusiveSet; + @Shadow + public abstract boolean isAcceptableItem(net.minecraft.item.ItemStack stack); + @SuppressWarnings("ConstantConditions") public boolean terra$canEnchantItem(ItemStack itemStack) { return isAcceptableItem((net.minecraft.item.ItemStack) (Object) itemStack); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java index a3bcf54df..91a487d0b 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/meta/ItemStackMetaMixin.java @@ -19,9 +19,6 @@ import net.minecraft.component.type.ItemEnchantmentsComponent; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtList; -import net.minecraft.registry.Registries; import net.minecraft.registry.entry.RegistryEntry; import org.spongepowered.asm.mixin.Implements; import org.spongepowered.asm.mixin.Interface; @@ -49,7 +46,8 @@ public abstract class ItemStackMetaMixin { @Shadow public abstract void addEnchantment(RegistryEntry enchantment, int level); - public void terra$addEnchantment(Enchantment enchantment, int level) { ; + public void terra$addEnchantment(Enchantment enchantment, int level) { + ; addEnchantment(RegistryEntry.of((net.minecraft.enchantment.Enchantment) (Object) enchantment), level); } diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java index 7ae5441d0..70a62ae79 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/world/ChunkRegionMixin.java @@ -17,8 +17,6 @@ package com.dfsek.terra.mod.mixin.implementations.terra.world; -import com.dfsek.terra.mod.mixin.invoke.FluidBlockInvoker; - import net.minecraft.block.FluidBlock; import net.minecraft.fluid.Fluid; import net.minecraft.util.collection.BoundedRegionArray; @@ -27,7 +25,6 @@ import net.minecraft.world.WorldAccess; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.ChunkGenerationStep; -import net.minecraft.world.chunk.ChunkStatus; import net.minecraft.world.tick.MultiTickScheduler; import net.minecraft.world.tick.OrderedTick; import org.spongepowered.asm.mixin.Final; @@ -40,8 +37,6 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import java.util.List; - import com.dfsek.terra.api.block.entity.BlockEntity; import com.dfsek.terra.api.block.state.BlockState; import com.dfsek.terra.api.config.ConfigPack; @@ -52,6 +47,7 @@ import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator; import com.dfsek.terra.api.world.chunk.generation.ProtoWorld; import com.dfsek.terra.mod.generation.MinecraftChunkGeneratorWrapper; +import com.dfsek.terra.mod.mixin.invoke.FluidBlockInvoker; import com.dfsek.terra.mod.util.MinecraftUtil; @@ -78,7 +74,8 @@ public abstract class ChunkRegionMixin { @Inject(at = @At("RETURN"), - method = "(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/collection/BoundedRegionArray;Lnet/minecraft/world/chunk/ChunkGenerationStep;Lnet/minecraft/world/chunk/Chunk;)V") + method = "(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/collection/BoundedRegionArray;" + + "Lnet/minecraft/world/chunk/ChunkGenerationStep;Lnet/minecraft/world/chunk/Chunk;)V") public void injectConstructor(net.minecraft.server.world.ServerWorld world, BoundedRegionArray chunks, ChunkGenerationStep generationStep, Chunk centerPos, CallbackInfo ci) { this.terra$config = ((ServerWorld) world).getPack(); diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/lifecycle/DataPackContentsMixin.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/lifecycle/DataPackContentsMixin.java index 305f7f024..680c1833c 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/lifecycle/DataPackContentsMixin.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/lifecycle/DataPackContentsMixin.java @@ -22,6 +22,7 @@ public class DataPackContentsMixin { @Shadow @Final private ReloadableRegistries.Lookup reloadableRegistries; + /* * #refresh populates all tags in the registries */ diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/util/PresetUtil.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/util/PresetUtil.java index de147c509..32c19a405 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/util/PresetUtil.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/util/PresetUtil.java @@ -45,8 +45,9 @@ public static Pair createDefault(ConfigPack pack, ModPl .orElseThrow(); - Identifier generatorID = Identifier.tryParse("terra:" + pack.getID().toLowerCase(Locale.ROOT) + "/" + pack.getNamespace().toLowerCase( - Locale.ROOT)); + Identifier generatorID = Identifier.tryParse( + "terra:" + pack.getID().toLowerCase(Locale.ROOT) + "/" + pack.getNamespace().toLowerCase( + Locale.ROOT)); PRESETS.add(generatorID); diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java index 65d86febf..0cbfa77b4 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java @@ -20,8 +20,8 @@ public static void initialize(String modName, LifecyclePlatform platform) { FabricServerCommandManager manager = new FabricServerCommandManager<>( ExecutionCoordinator.simpleCoordinator(), SenderMapper.create( - serverCommandSource -> (CommandSender) serverCommandSource, - commandSender -> (ServerCommandSource) commandSender) + serverCommandSource -> (CommandSender) serverCommandSource, + commandSender -> (ServerCommandSource) commandSender) ); diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java index a5d2a9bde..b1ff48396 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java @@ -1,15 +1,13 @@ package com.dfsek.terra.lifecycle.mixin.lifecycle; -import com.mojang.datafixers.util.Pair; import net.minecraft.enchantment.Enchantment; -import net.minecraft.registry.DynamicRegistryManager; -import net.minecraft.registry.DynamicRegistryManager.Immutable; import net.minecraft.registry.MutableRegistry; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.RegistryLoader; import net.minecraft.registry.RegistryLoader.Loader; +import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.source.MultiNoiseBiomeSourceParameterList; import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.gen.WorldPreset; @@ -20,7 +18,6 @@ import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; import java.util.List; @@ -31,8 +28,6 @@ import com.dfsek.terra.lifecycle.util.LifecycleUtil; import com.dfsek.terra.lifecycle.util.RegistryHack; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - @Mixin(RegistryLoader.class) public class RegistryLoaderMixin { @@ -40,21 +35,10 @@ public class RegistryLoaderMixin { @Shadow @Final private static Logger LOGGER; -// @Inject( -// method = "load(Lnet/minecraft/registry/RegistryLoader$RegistryLoadable;Lnet/minecraft/registry/DynamicRegistryManager;Ljava/util/List;)Lnet/minecraft/registry/DynamicRegistryManager$Immutable;", -// at = @At( -// value = "INVOKE", -// target = "Ljava/util/List;forEach(Ljava/util/function/Consumer;)V", -// ordinal = 1 // we want right after the first forEach -// ) -// ) -// private static void grabRegiestry(RegistryLoader.RegistryLoadable loadable, DynamicRegistryManager baseRegistryManager, -// List> entries, CallbackInfoReturnable cir) { -// entries.forEach((loader) -> { -// Registry registry = loader.registry(); -// } + @Redirect( - method = "load(Lnet/minecraft/registry/RegistryLoader$RegistryLoadable;Lnet/minecraft/registry/DynamicRegistryManager;Ljava/util/List;)Lnet/minecraft/registry/DynamicRegistryManager$Immutable;", + method = "load(Lnet/minecraft/registry/RegistryLoader$RegistryLoadable;Lnet/minecraft/registry/DynamicRegistryManager;" + + "Ljava/util/List;)Lnet/minecraft/registry/DynamicRegistryManager$Immutable;", at = @At( value = "INVOKE", target = "Ljava/util/List;forEach(Ljava/util/function/Consumer;)V", @@ -62,20 +46,19 @@ public class RegistryLoaderMixin { ) ) private static void grabManager(List> instance, Consumer> consumer) { - if (!initialized) { - extractRegistry(instance, RegistryKeys.BIOME).ifPresent( - biomes -> { // this redirect triggers twice, second time only with dimension registry. don't try extraction second time - MutableRegistry dimensionTypes = extractRegistry(instance, RegistryKeys.DIMENSION_TYPE).orElseThrow(); - MutableRegistry worldPresets = extractRegistry(instance, RegistryKeys.WORLD_PRESET).orElseThrow(); - MutableRegistry chunkGeneratorSettings = extractRegistry(instance, - RegistryKeys.CHUNK_GENERATOR_SETTINGS).orElseThrow(); - MutableRegistry multiNoiseBiomeSourceParameterLists = extractRegistry(instance, - RegistryKeys.MULTI_NOISE_BIOME_SOURCE_PARAMETER_LIST).orElseThrow(); - MutableRegistry enchantments = extractRegistry(instance, RegistryKeys.ENCHANTMENT).orElseThrow(); + if(!initialized) { + MutableRegistry biomes = extractRegistry(instance, RegistryKeys.BIOME).orElseThrow(); + MutableRegistry dimensionTypes = extractRegistry(instance, RegistryKeys.DIMENSION_TYPE).orElseThrow(); + MutableRegistry worldPresets = extractRegistry(instance, RegistryKeys.WORLD_PRESET).orElseThrow(); + MutableRegistry chunkGeneratorSettings = extractRegistry(instance, + RegistryKeys.CHUNK_GENERATOR_SETTINGS).orElseThrow(); + MutableRegistry multiNoiseBiomeSourceParameterLists = extractRegistry(instance, + RegistryKeys.MULTI_NOISE_BIOME_SOURCE_PARAMETER_LIST).orElseThrow(); + MutableRegistry enchantments = extractRegistry(instance, RegistryKeys.ENCHANTMENT).orElseThrow(); - LifecyclePlatform.setRegistries(biomes, dimensionTypes, chunkGeneratorSettings, multiNoiseBiomeSourceParameterLists, enchantments); - LifecycleUtil.initialize(biomes, worldPresets); - }); + LifecyclePlatform.setRegistries(biomes, dimensionTypes, chunkGeneratorSettings, multiNoiseBiomeSourceParameterLists, + enchantments); + LifecycleUtil.initialize(biomes, worldPresets); initialized = true; } instance.forEach(consumer); diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/SaveLoadingMixin.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/SaveLoadingMixin.java index 0bf675fc2..89490ef41 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/SaveLoadingMixin.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/SaveLoadingMixin.java @@ -13,10 +13,14 @@ @Mixin(SaveLoading.class) public class SaveLoadingMixin { @ModifyArg( - method = "load(Lnet/minecraft/server/SaveLoading$ServerConfig;Lnet/minecraft/server/SaveLoading$LoadContextSupplier;Lnet/minecraft/server/SaveLoading$SaveApplierFactory;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", + method = "load(Lnet/minecraft/server/SaveLoading$ServerConfig;Lnet/minecraft/server/SaveLoading$LoadContextSupplier;" + + "Lnet/minecraft/server/SaveLoading$SaveApplierFactory;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)" + + "Ljava/util/concurrent/CompletableFuture;", at = @At( value = "INVOKE", - target = "Lnet/minecraft/registry/RegistryLoader;loadFromResource(Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/registry/DynamicRegistryManager;Ljava/util/List;)Lnet/minecraft/registry/DynamicRegistryManager$Immutable;" ), + target = "Lnet/minecraft/registry/RegistryLoader;loadFromResource(Lnet/minecraft/resource/ResourceManager;" + + "Lnet/minecraft/registry/DynamicRegistryManager;Ljava/util/List;)" + + "Lnet/minecraft/registry/DynamicRegistryManager$Immutable;"), index = 1 ) private static DynamicRegistryManager grabManager(DynamicRegistryManager registryManager) { From 06457bf3ced441619bc9ac0994b7842dc33ea323 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Wed, 18 Sep 2024 15:43:31 -0600 Subject: [PATCH 096/126] some fixes --- .../com/dfsek/terra/mod/mixin/invoke/FluidBlockInvoker.java | 2 +- .../src/main/resources/terra.common.mixins.json | 1 + .../lifecycle/mixin/lifecycle/MinecraftServerMixin.java | 6 ++++++ .../lifecycle/mixin/lifecycle/RegistryLoaderMixin.java | 4 +++- .../java/com/dfsek/terra/lifecycle/util/LifecycleUtil.java | 1 + 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/invoke/FluidBlockInvoker.java b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/invoke/FluidBlockInvoker.java index a6b50409c..620d03ec1 100644 --- a/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/invoke/FluidBlockInvoker.java +++ b/platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/invoke/FluidBlockInvoker.java @@ -10,5 +10,5 @@ @Mixin(FluidBlock.class) public interface FluidBlockInvoker { @Invoker("getFluidState") - public FluidState invokeGetFluidState(BlockState state); + FluidState invokeGetFluidState(BlockState state); } diff --git a/platforms/mixin-common/src/main/resources/terra.common.mixins.json b/platforms/mixin-common/src/main/resources/terra.common.mixins.json index f8d0718e4..e25cb7da4 100644 --- a/platforms/mixin-common/src/main/resources/terra.common.mixins.json +++ b/platforms/mixin-common/src/main/resources/terra.common.mixins.json @@ -36,6 +36,7 @@ "implementations.terra.inventory.meta.ItemStackMetaMixin", "implementations.terra.world.ChunkRegionMixin", "implementations.terra.world.ServerWorldMixin", + "invoke.FluidBlockInvoker", "lifecycle.DataPackContentsMixin" ], "client": [ diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/MinecraftServerMixin.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/MinecraftServerMixin.java index 25ac340d0..63a8b8170 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/MinecraftServerMixin.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/MinecraftServerMixin.java @@ -16,6 +16,7 @@ import com.dfsek.terra.lifecycle.LifecyclePlatform; +import static com.dfsek.terra.lifecycle.util.LifecycleUtil.initialized; @Mixin(MinecraftServer.class) public class MinecraftServerMixin { @@ -29,4 +30,9 @@ private void injectConstructor(Thread serverThread, LevelStorage.Session session WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory, CallbackInfo ci) { LifecyclePlatform.setServer((MinecraftServer) (Object) this); } + + @Inject(method = "shutdown()V", at = @At("RETURN")) + private void injectShutdown(CallbackInfo ci) { + initialized = false; + } } diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java index b1ff48396..739c084f3 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/RegistryLoaderMixin.java @@ -28,10 +28,12 @@ import com.dfsek.terra.lifecycle.util.LifecycleUtil; import com.dfsek.terra.lifecycle.util.RegistryHack; +import static com.dfsek.terra.lifecycle.util.LifecycleUtil.initialized; + @Mixin(RegistryLoader.class) public class RegistryLoaderMixin { - private static boolean initialized = false; + @Shadow @Final private static Logger LOGGER; diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/LifecycleUtil.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/LifecycleUtil.java index a251bedbd..28346a6eb 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/LifecycleUtil.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/LifecycleUtil.java @@ -12,6 +12,7 @@ public final class LifecycleUtil { + public static boolean initialized = false; private LifecycleUtil() { } From 3644ee7fca671dc2ca095f7c0eb6b898eb1345f7 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 16:28:34 -0600 Subject: [PATCH 097/126] Implement DerivateNoiseFunction --- .../noise/DerivativeFractalTemplate.java | 11 ++-- .../noise/DerivativeNoiseTemplate.java | 8 +++ .../noise/DerivativeNoiseFunction.java | 24 ++++++++ .../noise/simplex/DerivativeFractal.java | 57 ++++++++++++------- 4 files changed, 72 insertions(+), 28 deletions(-) create mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeNoiseTemplate.java create mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/DerivativeNoiseFunction.java diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java index 9387651a2..68e8c803d 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java @@ -7,7 +7,7 @@ import com.dfsek.terra.addons.noise.samplers.noise.simplex.DerivativeFractal; -public class DerivativeFractalTemplate extends SamplerTemplate { +public class DerivativeFractalTemplate extends DerivativeNoiseTemplate { @Value("octaves") @Default @@ -21,12 +21,11 @@ public class DerivativeFractalTemplate extends SamplerTemplate extends NoiseTemplate { + +} diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/DerivativeNoiseFunction.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/DerivativeNoiseFunction.java new file mode 100644 index 000000000..c5caa0d3a --- /dev/null +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/DerivativeNoiseFunction.java @@ -0,0 +1,24 @@ +package com.dfsek.terra.addons.noise.samplers.noise; + +import com.dfsek.terra.api.noise.DerivativeNoiseSampler; + +public abstract class DerivativeNoiseFunction extends NoiseFunction implements DerivativeNoiseSampler { + @Override + public boolean isDifferentiable() { + return true; + } + + @Override + public double[] noised(long seed, double x, double y) { + return getNoiseDerivativeRaw(seed + salt, x * frequency, y * frequency); + } + + @Override + public double[] noised(long seed, double x, double y, double z) { + return getNoiseDerivativeRaw(seed + salt, x * frequency, y * frequency, z * frequency); + } + + public abstract double[] getNoiseDerivativeRaw(long seed, double x, double y); + + public abstract double[] getNoiseDerivativeRaw(long seed, double x, double y, double z); +} diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java index 91fa69e0e..4d7edc2fe 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java @@ -1,29 +1,49 @@ package com.dfsek.terra.addons.noise.samplers.noise.simplex; -import com.dfsek.terra.api.noise.DerivativeNoiseSampler; +import com.dfsek.terra.addons.noise.samplers.noise.DerivativeNoiseFunction; import static com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion.dot; -import static com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion.hash; -import static com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion.hashX; -import static com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion.hashY; /** * Temporary sampler that provides derivatives to test pseudoerosion, should be replaced with * derivative versions of existing samplers */ -public class DerivativeFractal implements DerivativeNoiseSampler { +public class DerivativeFractal extends DerivativeNoiseFunction { private final int heightOctaves; private final double heightGain; private final double heightLacunarity; - private final double frequency; + private static final float HASH_X = 0.3183099f; + private static final float HASH_Y = 0.3678794f; - public DerivativeFractal(int octaves, double gain, double lacunarity, double frequency) { + public DerivativeFractal(int octaves, double gain, double lacunarity) { this.heightOctaves = octaves; this.heightGain = gain; this.heightLacunarity = lacunarity; - this.frequency = frequency; + } + + public static float hash(float x, float y) { + float xx = x * HASH_X + HASH_Y; + float yy = y * HASH_Y + HASH_X; + + // Swapped the components here + return 16 * (xx * yy * (xx + yy)); + } + + public static float hashX(float n) { + // Swapped the components here + float nx = HASH_X * n; + return -1.0f + 2.0f * fract(nx); + } + + public static float hashY(float n) { + float ny = HASH_Y * n; + return -1.0f + 2.0f * fract(ny); + } + + public static float fract(float x) { + return (x - (float)Math.floor(x)); } private static float[] baseNoise(float px, float py) { @@ -65,14 +85,7 @@ private static float[] baseNoise(float px, float py) { } @Override - public boolean isDifferentiable() { - return true; - } - - @Override - public double[] noised(long seed, double x, double y) { - x *= frequency; - y *= frequency; + public double[] getNoiseDerivativeRaw(long seed, double x, double y) { double[] out = { 0.0f, 0.0f, 0.0f }; float heightFreq = 1.0f; float heightAmp = 1f; @@ -93,17 +106,17 @@ public double[] noised(long seed, double x, double y) { } @Override - public double[] noised(long seed, double x, double y, double z) { - return noised(seed, x, z); + public double[] getNoiseDerivativeRaw(long seed, double x, double y, double z) { + return getNoiseDerivativeRaw(seed, x, y); } @Override - public double noise(long seed, double x, double y) { - return noised(seed, x, y)[0]; + public double getNoiseRaw(long seed, double x, double y) { + return getNoiseDerivativeRaw(seed, x, y)[0]; } @Override - public double noise(long seed, double x, double y, double z) { - return noised(seed, x, y, z)[0]; + public double getNoiseRaw(long seed, double x, double y, double z) { + return getNoiseRaw(seed, x, y); } } From b1ad820e1ca188218c08fd8d9433b9f1fe437759 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 16:37:42 -0600 Subject: [PATCH 098/126] Move pseudoerosion to NoiseFunction --- .../templates/noise/PseudoErosionTemplate.java | 13 ++++++++++--- .../samplers/noise/simplex/PseudoErosion.java | 14 +++++--------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java index f5e1ac46c..d7f6b7562 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java @@ -3,12 +3,12 @@ import com.dfsek.tectonic.api.config.template.annotations.Default; import com.dfsek.tectonic.api.config.template.annotations.Value; -import com.dfsek.terra.addons.noise.config.templates.SamplerTemplate; import com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion; +import com.dfsek.terra.api.config.meta.Meta; import com.dfsek.terra.api.noise.DerivativeNoiseSampler; -public class PseudoErosionTemplate extends SamplerTemplate { +public class PseudoErosionTemplate extends NoiseTemplate { @Value("octaves") @Default @@ -61,10 +61,17 @@ public class PseudoErosionTemplate extends SamplerTemplate { @Default private boolean averageErosionImpulses = true; + @Value("frequency") + @Default + protected @Meta double frequency = 1d; + @Override public PseudoErosion get() { - return new PseudoErosion(octaves, gain, lacunarity, + PseudoErosion pseudoErosion = new PseudoErosion(octaves, gain, lacunarity, slopeStrength, branchStrength, strength, erosionFrequency, heightSampler, slopeMask, slopeMaskFull, slopeMaskNone, jitterModifier, averageErosionImpulses); + pseudoErosion.setFrequency(frequency); + pseudoErosion.setSalt(salt); + return pseudoErosion; } } diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java index 41b1e2db8..29a6d8e8b 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java @@ -1,12 +1,13 @@ package com.dfsek.terra.addons.noise.samplers.noise.simplex; +import com.dfsek.terra.addons.noise.samplers.noise.NoiseFunction; import com.dfsek.terra.api.noise.DerivativeNoiseSampler; import com.dfsek.terra.api.noise.NoiseSampler; import com.dfsek.terra.api.util.MathUtil; -public class PseudoErosion implements NoiseSampler { +public class PseudoErosion extends NoiseFunction { public static final float TAU = (float) (2.0 * Math.PI); private static final float HASH_X = 0.3183099f; private static final float HASH_Y = 0.3678794f; @@ -106,11 +107,6 @@ public float[] erosion(float x, float y, float dirX, float dirY) { return new float[] {noise, dirOutX, dirOutY}; } - public static double exp(double val) { - final long tmp = (long) (1512775 * val + 1072632447); - return Double.longBitsToDouble(tmp << 32); - } - public static float smoothstep(float edge0, float edge1, float x) { // Scale, bias and saturate x to 0..1 range x = clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f); @@ -176,12 +172,12 @@ public static float dot(float x1, float y1, float x2, float y2) { } @Override - public double noise(long seed, double x, double y) { + public double getNoiseRaw(long seed, double x, double y) { return heightMap(seed, (float) x, (float) y); } @Override - public double noise(long seed, double x, double y, double z) { - return noise(seed, x, z); + public double getNoiseRaw(long seed, double x, double y, double z) { + return getNoiseRaw(seed, x, z); } } \ No newline at end of file From 07e3d0058d3c39e92bc0a4a19dbbba30f823e499 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 16:46:48 -0600 Subject: [PATCH 099/126] Refractor PseudoErosion --- .../templates/noise/PseudoErosionTemplate.java | 8 ++++---- .../PseudoErosion.java => PseudoErosionSampler.java} | 12 +++++------- .../samplers/noise/simplex/DerivativeFractal.java | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) rename common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/{simplex/PseudoErosion.java => PseudoErosionSampler.java} (92%) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java index d7f6b7562..f815cd40c 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java @@ -3,12 +3,12 @@ import com.dfsek.tectonic.api.config.template.annotations.Default; import com.dfsek.tectonic.api.config.template.annotations.Value; -import com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion; +import com.dfsek.terra.addons.noise.samplers.noise.PseudoErosionSampler; import com.dfsek.terra.api.config.meta.Meta; import com.dfsek.terra.api.noise.DerivativeNoiseSampler; -public class PseudoErosionTemplate extends NoiseTemplate { +public class PseudoErosionTemplate extends NoiseTemplate { @Value("octaves") @Default @@ -66,8 +66,8 @@ public class PseudoErosionTemplate extends NoiseTemplate { protected @Meta double frequency = 1d; @Override - public PseudoErosion get() { - PseudoErosion pseudoErosion = new PseudoErosion(octaves, gain, lacunarity, + public PseudoErosionSampler get() { + PseudoErosionSampler pseudoErosion = new PseudoErosionSampler(octaves, gain, lacunarity, slopeStrength, branchStrength, strength, erosionFrequency, heightSampler, slopeMask, slopeMaskFull, slopeMaskNone, jitterModifier, averageErosionImpulses); pseudoErosion.setFrequency(frequency); diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java similarity index 92% rename from common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java rename to common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java index 29a6d8e8b..7aeff49ac 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/PseudoErosion.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java @@ -1,13 +1,11 @@ -package com.dfsek.terra.addons.noise.samplers.noise.simplex; +package com.dfsek.terra.addons.noise.samplers.noise; -import com.dfsek.terra.addons.noise.samplers.noise.NoiseFunction; import com.dfsek.terra.api.noise.DerivativeNoiseSampler; -import com.dfsek.terra.api.noise.NoiseSampler; import com.dfsek.terra.api.util.MathUtil; -public class PseudoErosion extends NoiseFunction { +public class PseudoErosionSampler extends NoiseFunction { public static final float TAU = (float) (2.0 * Math.PI); private static final float HASH_X = 0.3183099f; private static final float HASH_Y = 0.3678794f; @@ -27,9 +25,9 @@ public class PseudoErosion extends NoiseFunction { private final double maxCellDistSqRecip; private final boolean averageErosionImpulses; - public PseudoErosion(int octaves, double gain, double lacunarity, double slopeStrength, double branchStrength, double erosionStrength, double erosionFrequency, DerivativeNoiseSampler sampler, - boolean slopeMask, double slopeMaskFull, double slopeMaskNone, double jitterModifier, - boolean averageErosionImpulses) { + public PseudoErosionSampler(int octaves, double gain, double lacunarity, double slopeStrength, double branchStrength, double erosionStrength, double erosionFrequency, DerivativeNoiseSampler sampler, + boolean slopeMask, double slopeMaskFull, double slopeMaskNone, double jitterModifier, + boolean averageErosionImpulses) { this.octaves = octaves; this.gain = gain; this.lacunarity = lacunarity; diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java index 4d7edc2fe..9a9e7f922 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java @@ -2,7 +2,7 @@ import com.dfsek.terra.addons.noise.samplers.noise.DerivativeNoiseFunction; -import static com.dfsek.terra.addons.noise.samplers.noise.simplex.PseudoErosion.dot; +import static com.dfsek.terra.addons.noise.samplers.noise.PseudoErosionSampler.dot; /** From 699d5d1d62dd2b4ac22afc61e31cf6912b9e2c38 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 19:42:50 -0600 Subject: [PATCH 100/126] Derivable OpenSimplex2S Impl baased on https://gist.github.com/KdotJPG/882f36b2ae5ae56a8fc91627ec1c87f4 --- .../noise/simplex/OpenSimplex2SSampler.java | 418 ++++++++++++++++++ .../noise/simplex/SimplexStyleSampler.java | 44 +- 2 files changed, 454 insertions(+), 8 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java index e3488a676..d9aec851e 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java @@ -276,4 +276,422 @@ public double getNoiseRaw(long sl, double x, double y, double z) { return value * 9.046026385208288; } + @Override + public boolean isDifferentiable() { + return true; + } + + @Override + public double[] getNoiseDerivativeRaw(long sl, double x, double y) { + int seed = (int) sl; + // 2D OpenSimplex2S case is a modified 2D simplex noise. + + final double SQRT3 = 1.7320508075688772935274463415059; + final double G2 = (3 - SQRT3) / 6; + + final double F2 = 0.5f * (SQRT3 - 1); + double s = (x + y) * F2; + x += s; + y += s; + + + int i = (int) Math.floor(x); + int j = (int) Math.floor(y); + double xi = x - i; + double yi = y - j; + + i *= PRIME_X; + j *= PRIME_Y; + int i1 = i + PRIME_X; + int j1 = j + PRIME_Y; + + double t = (xi + yi) * G2; + double x0 = xi - t; + double y0 = yi - t; + + double[] out = { 0.0f, 0.0f, 0.0f }; + + double a0 = (2.0 / 3.0) - x0 * x0 - y0 * y0; + double aa0 = a0 * a0, aaa0 = aa0 * a0, aaaa0 = aa0 * aa0; + int gi0 = gradCoordIndex(seed, i, j); + double gx0 = GRADIENTS_2_D[gi0], gy0 = GRADIENTS_2_D[gi0 | 1]; + double rampValue0 = gx0 * x0 + gy0 * y0; + out[0] = aaaa0 * rampValue0; + out[1] = gx0 * aaaa0 - 8 * rampValue0 * aaa0 * x0; + out[2] = gy0 * aaaa0 - 8 * rampValue0 * aaa0 * y0; + + + + double a1 = 2 * (1 - 2 * G2) * (1 / G2 - 2) * t + ((-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a0); + double x1 = x0 - (1 - 2 * G2); + double y1 = y0 - (1 - 2 * G2); + double aa1 = a1 * a1, aaa1 = aa1 * a1, aaaa1 = aa1 * aa1; + int gi1 = gradCoordIndex(seed, i1, j1); + double gx1 = GRADIENTS_2_D[gi1], gy1 = GRADIENTS_2_D[gi1 | 1]; + double rampValue1 = gx1 * x1 + gy1 * y1; + out[0] += aaaa1 * rampValue1; + out[1] += gx1 * aaaa1 - 8 * rampValue1 * aaa1 * x1; + out[2] += gy1 * aaaa1 - 8 * rampValue1 * aaa1 * y1; + + // Nested conditionals were faster than compact bit logic/arithmetic. + double xmyi = xi - yi; + if(t > G2) { + if(xi + xmyi > 1) { + double x2 = x0 + (3 * G2 - 2); + double y2 = y0 + (3 * G2 - 1); + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i + (PRIME_X << 1), j + PRIME_Y); + double gx2 = GRADIENTS_2_D[gi2 | 0], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; + } + } else { + double x2 = x0 + G2; + double y2 = y0 + (G2 - 1); + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i, j + PRIME_Y); + double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; + } + } + + if(yi - xmyi > 1) { + double x3 = x0 + (3 * G2 - 1); + double y3 = y0 + (3 * G2 - 2); + double a3 = (2.0 / 3.0) - x3 * x3 - y3 * y3; + if(a3 > 0) { + double aa3 = a3 * a3, aaa3 = aa3 * a3, aaaa3 = aa3 * aa3; + int gi3 = gradCoordIndex(seed, i + PRIME_X, j + (PRIME_Y << 1)); + double gx3 = GRADIENTS_2_D[gi3], gy3 = GRADIENTS_2_D[gi3 | 1]; + double rampValue3 = gx3 * x3 + gy3 * y3; + out[0] += aaaa3 * rampValue3; + out[1] += gx3 * aaaa3 - 8 * rampValue3 * aaa3 * x3; + out[2] += gy3 * aaaa3 - 8 * rampValue3 * aaa3 * y3; + } + } else { + double x3 = x0 + (G2 - 1); + double y3 = y0 + G2; + double a3 = (2.0 / 3.0) - x3 * x3 - y3 * y3; + if(a3 > 0) { + double aa3 = a3 * a3, aaa3 = aa3 * a3, aaaa3 = aa3 * aa3; + int gi3 = gradCoordIndex(seed, i + PRIME_X, j); + double gx3 = GRADIENTS_2_D[gi3], gy3 = GRADIENTS_2_D[gi3 | 1]; + double rampValue3 = gx3 * x3 + gy3 * y3; + out[0] += aaaa3 * rampValue3; + out[1] += gx3 * aaaa3 - 8 * rampValue3 * aaa3 * x3; + out[2] += gy3 * aaaa3 - 8 * rampValue3 * aaa3 * y3; + } + } + } else { + if(xi + xmyi < 0) { + double x2 = x0 + (1 - G2); + double y2 = y0 - G2; + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i - PRIME_X, j); + double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; } + } else { + double x2 = x0 + (G2 - 1); + double y2 = y0 + G2; + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i + PRIME_X, j); + double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; + } + } + + if(yi < xmyi) { + double x2 = x0 - G2; + double y2 = y0 - (G2 - 1); + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i, j - PRIME_Y); + double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; } + } else { + double x2 = x0 + G2; + double y2 = y0 + (G2 - 1); + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i, j + PRIME_Y); + double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; + } + } + } + out[0] *= 18.24196194486065; + out[1] *= 18.24196194486065; + out[2] *= 18.24196194486065; + return out; + } + + @Override + public double[] getNoiseDerivativeRaw(long sl, double x, double y, double z) { + int seed = (int) sl; + // 3D OpenSimplex2S case uses two offset rotated cube grids. + final double R3 = (2.0 / 3.0); + double r = (x + y + z) * R3; // Rotation, not skew + x = r - x; + y = r - y; + z = r - z; + + + int i = (int) Math.floor(x); + int j = (int) Math.floor(y); + int k = (int) Math.floor(z); + double xi = x - i; + double yi = y - j; + double zi = z - k; + + i *= PRIME_X; + j *= PRIME_Y; + k *= PRIME_Z; + int seed2 = seed + 1293373; + + int xNMask = (int) (-0.5 - xi); + int yNMask = (int) (-0.5 - yi); + int zNMask = (int) (-0.5 - zi); + + double[] out = { 0.0f, 0.0f, 0.0f }; + + double x0 = xi + xNMask; + double y0 = yi + yNMask; + double z0 = zi + zNMask; + double a0 = 0.75 - x0 * x0 - y0 * y0 - z0 * z0; + double aa0 = a0 * a0, aaa0 = aa0 * a0, aaaa0 = aa0 * aa0; + int gi0 = gradCoordIndex(seed, i + (xNMask & PRIME_X), j + (yNMask & PRIME_Y), k + (zNMask & PRIME_Z)); + double gx0 = GRADIENTS_3D[gi0], gy0 = GRADIENTS_3D[gi0 | 1], gz0 = GRADIENTS_3D[gi0 | 2]; + double rampValue0 = gx0 * x0 + gy0 * y0 + gz0 * z0; + out[0] = aaaa0 * rampValue0; + out[1] = gx0 * aaaa0 - 8 * rampValue0 * aaa0 * x0; + out[2] = gy0 * aaaa0 - 8 * rampValue0 * aaa0 * y0; + out[3] = gz0 * aaaa0 - 8 * rampValue0 * aaa0 * z0; + + double x1 = xi - 0.5; + double y1 = yi - 0.5; + double z1 = zi - 0.5; + double a1 = 0.75 - x1 * x1 - y1 * y1 - z1 * z1; + double aa1 = a1 * a1, aaa1 = aa1 * a1, aaaa1 = aa1 * aa1; + int gi1 = gradCoordIndex(seed2, i + PRIME_X, j + PRIME_Y, k + PRIME_Z); + double gx1 = GRADIENTS_3D[gi1], gy1 = GRADIENTS_3D[gi1 | 1], gz1 = GRADIENTS_3D[gi1 | 2]; + double rampValue1 = gx1 * x1 + gy1 * y1 + gz1 * z1; + out[0] += aaaa1 * rampValue1; + out[1] += gx1 * aaaa1 - 8 * rampValue1 * aaa1 * x1; + out[2] += gy1 * aaaa1 - 8 * rampValue1 * aaa1 * y1; + out[3] += gz1 * aaaa1 - 8 * rampValue1 * aaa1 * z1; + + double xAFlipMask0 = ((xNMask | 1) << 1) * x1; + double yAFlipMask0 = ((yNMask | 1) << 1) * y1; + double zAFlipMask0 = ((zNMask | 1) << 1) * z1; + double xAFlipMask1 = (-2 - (xNMask << 2)) * x1 - 1.0; + double yAFlipMask1 = (-2 - (yNMask << 2)) * y1 - 1.0; + double zAFlipMask1 = (-2 - (zNMask << 2)) * z1 - 1.0; + + boolean skip5 = false; + double a2 = xAFlipMask0 + a0; + if(a2 > 0) { + double x2 = x0 - (xNMask | 1); + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i + (~xNMask & PRIME_X), j + (yNMask & PRIME_Y), k + (zNMask & PRIME_Z)); + double gx2 = GRADIENTS_3D[gi2], gy2 = GRADIENTS_3D[gi2 | 1], gz2 = GRADIENTS_3D[gi2 | 2]; + double rampValue2 = gx2 * x2 + gy2 * y0 + gz2 * z0; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y0; + out[3] += gz2 * aaaa2 - 8 * rampValue2 * aaa2 * z0; + } else { + double a3 = yAFlipMask0 + zAFlipMask0 + a0; + if(a3 > 0) { + double y3 = y0 - (yNMask | 1); + double z3 = z0 - (zNMask | 1); + double aa3 = a3 * a3, aaa3 = aa3 * a3, aaaa3 = aa3 * aa3; + int gi3 = gradCoordIndex(seed, i + (xNMask & PRIME_X), j + (~yNMask & PRIME_Y), k + (~zNMask & PRIME_Z)); + double gx3 = GRADIENTS_3D[gi3], gy3 = GRADIENTS_3D[gi3 | 1], gz3 = GRADIENTS_3D[gi3 | 2]; + double rampValue3 = gx3 * x0 + gy3 * y3 + gz3 * z3; + out[0] += aaaa3 * rampValue3; + out[1] += gx3 * aaaa3 - 8 * rampValue3 * aaa3 * x0; + out[2] += gy3 * aaaa3 - 8 * rampValue3 * aaa3 * y3; + out[3] += gz3 * aaaa3 - 8 * rampValue3 * aaa3 * z3; + } + + double a4 = xAFlipMask1 + a1; + if(a4 > 0) { + double x4 = (xNMask | 1) + x1; + double aa4 = a4 * a4, aaa4 = aa4 * a4, aaaa4 = aa4 * aa4; + int gi4 = gradCoordIndex(seed2, i + (xNMask & (PRIME_X << 1)), j + PRIME_Y, k + PRIME_Z); + double gx4 = GRADIENTS_3D[gi4], gy4 = GRADIENTS_3D[gi4 | 1], gz4 = GRADIENTS_3D[gi4 | 2]; + double rampValue4 = gx4 * x4 + gy4 * y1 + gz4 * z1; + out[0] += aaaa4 * rampValue4; + out[1] += gx4 * aaaa4 - 8 * rampValue4 * aaa4 * x4; + out[2] += gy4 * aaaa4 - 8 * rampValue4 * aaa4 * y1; + out[3] += gz4 * aaaa4 - 8 * rampValue4 * aaa4 * z1; + skip5 = true; + } + } + + boolean skip9 = false; + double a6 = yAFlipMask0 + a0; + if(a6 > 0) { + double y6 = y0 - (yNMask | 1); + double aa6 = a6 * a6, aaa6 = aa6 * a6, aaaa6 = aa6 * aa6; + int gi6 = gradCoordIndex(seed, i + (xNMask & PRIME_X), j + (~yNMask & PRIME_Y), k + (zNMask & PRIME_Z)); + double gx6 = GRADIENTS_3D[gi6], gy6 = GRADIENTS_3D[gi6 | 1], gz6 = GRADIENTS_3D[gi6 | 2]; + double rampValue6 = gx6 * x0 + gy6 * y6 + gz6 * z0; + out[0] += aaaa6 * rampValue6; + out[1] += gx6 * aaaa6 - 8 * rampValue6 * aaa6 * x0; + out[2] += gy6 * aaaa6 - 8 * rampValue6 * aaa6 * y6; + out[3] += gz6 * aaaa6 - 8 * rampValue6 * aaa6 * z0; + } else { + double a7 = xAFlipMask0 + zAFlipMask0 + a0; + if(a7 > 0) { + double x7 = x0 - (xNMask | 1); + double z7 = z0 - (zNMask | 1); + double aa7 = a7 * a7, aaa7 = aa7 * a7, aaaa7 = aa7 * aa7; + int gi7 = gradCoordIndex(seed, i + (~xNMask & PRIME_X), j + (yNMask & PRIME_Y), k + (~zNMask & PRIME_Z)); + double gx7 = GRADIENTS_3D[gi7], gy7 = GRADIENTS_3D[gi7 | 1], gz7 = GRADIENTS_3D[gi7 | 2]; + double rampValue7 = gx7 * x7 + gy7 * y0 + gz7 * z7; + out[0] += aaaa7 * rampValue7; + out[1] += gx7 * aaaa7 - 8 * rampValue7 * aaa7 * x7; + out[2] += gy7 * aaaa7 - 8 * rampValue7 * aaa7 * y0; + out[3] += gz7 * aaaa7 - 8 * rampValue7 * aaa7 * z7; + } + + double a8 = yAFlipMask1 + a1; + if(a8 > 0) { + double y8 = (yNMask | 1) + y1; + double aa8 = a8 * a8, aaa8 = aa8 * a8, aaaa8 = aa8 * aa8; + int gi8 = gradCoordIndex(seed2, i + PRIME_X, j + (yNMask & (PRIME_Y << 1)), k + PRIME_Z); + double gx8 = GRADIENTS_3D[gi8], gy8 = GRADIENTS_3D[gi8 | 1], gz8 = GRADIENTS_3D[gi8 | 2]; + double rampValue8 = gx8 * x1 + gy8 * y8 + gz8 * z1; + out[0] += aaaa8 * rampValue8; + out[1] += gx8 * aaaa8 - 8 * rampValue8 * aaa8 * x1; + out[2] += gy8 * aaaa8 - 8 * rampValue8 * aaa8 * y8; + out[3] += gz8 * aaaa8 - 8 * rampValue8 * aaa8 * z1; + skip9 = true; + } + } + + boolean skipD = false; + double aA = zAFlipMask0 + a0; + if(aA > 0) { + double zA = z0 - (zNMask | 1); + double aaA = aA * aA, aaaA = aaA * aA, aaaaA = aaA * aaA; + int giA = gradCoordIndex(seed, i + (xNMask & PRIME_X), j + (yNMask & PRIME_Y), k + (~zNMask & PRIME_Z)); + double gxA = GRADIENTS_3D[giA], gyA = GRADIENTS_3D[giA | 1], gzA = GRADIENTS_3D[giA | 2]; + double rampValueA = gxA * x0 + gyA * y0 + gzA * zA; + out[0] += aaaaA * rampValueA; + out[1] += gxA * aaaaA - 8 * rampValueA * aaaA * x0; + out[2] += gyA * aaaaA - 8 * rampValueA * aaaA * y0; + out[3] += gzA * aaaaA - 8 * rampValueA * aaaA * zA; + } else { + double aB = xAFlipMask0 + yAFlipMask0 + a0; + if(aB > 0) { + double xB = x0 - (xNMask | 1); + double yB = y0 - (yNMask | 1); + double aaB = aB * aB, aaaB = aaB * aB, aaaaB = aaB * aaB; + int giB = gradCoordIndex(seed, i + (~xNMask & PRIME_X), j + (~yNMask & PRIME_Y), k + (zNMask & PRIME_Z)); + double gxB = GRADIENTS_3D[giB], gyB = GRADIENTS_3D[giB | 1], gzB = GRADIENTS_3D[giB | 2]; + double rampValueB = gxB * xB + gyB * yB + gzB * z0; + out[0] += aaaaB * rampValueB; + out[1] += gxB * aaaaB - 8 * rampValueB * aaaB * xB; + out[2] += gyB * aaaaB - 8 * rampValueB * aaaB * yB; + out[3] += gzB * aaaaB - 8 * rampValueB * aaaB * z0; + } + + double aC = zAFlipMask1 + a1; + if(aC > 0) { + double zC = (zNMask | 1) + z1; + double aaC = aC * aC, aaaC = aaC * aC, aaaaC = aaC * aaC; + int giC = gradCoordIndex(seed2, i + PRIME_X, j + PRIME_Y, k + (zNMask & (PRIME_Z << 1))); + double gxC = GRADIENTS_3D[giC], gyC = GRADIENTS_3D[giC | 1], gzC = GRADIENTS_3D[giC | 2]; + double rampValueC = gxC * x1 + gyC * y1 + gzC * zC; + out[0] += aaaaC * rampValueC; + out[1] += gxC * aaaaC - 8 * rampValueC * aaaC * x1; + out[2] += gyC * aaaaC - 8 * rampValueC * aaaC * y1; + out[3] += gzC * aaaaC - 8 * rampValueC * aaaC * zC; + skipD = true; + } + } + + if(!skip5) { + double a5 = yAFlipMask1 + zAFlipMask1 + a1; + if(a5 > 0) { + double y5 = (yNMask | 1) + y1; + double z5 = (zNMask | 1) + z1; + double aa5 = a5 * a5, aaa5 = aa5 * a5, aaaa5 = aa5 * aa5; + int gi5 = gradCoordIndex(seed2, i + PRIME_X, j + (yNMask & (PRIME_Y << 1)), k + (zNMask & (PRIME_Z << 1))); + double gx5 = GRADIENTS_3D[gi5], gy5 = GRADIENTS_3D[gi5 | 1], gz5 = GRADIENTS_3D[gi5 | 2]; + double rampValue5 = gx5 * x1 + gy5 * y5 + gz5 * z5; + out[0] += aaaa5 * rampValue5; + out[1] += gx5 * aaaa5 - 8 * rampValue5 * aaa5 * x1; + out[2] += gy5 * aaaa5 - 8 * rampValue5 * aaa5 * y5; + out[3] += gz5 * aaaa5 - 8 * rampValue5 * aaa5 * z5; + } + } + + if(!skip9) { + double a9 = xAFlipMask1 + zAFlipMask1 + a1; + if(a9 > 0) { + double x9 = (xNMask | 1) + x1; + double z9 = (zNMask | 1) + z1; + double aa9 = a9 * a9, aaa9 = aa9 * a9, aaaa9 = aa9 * aa9; + int gi9 = gradCoordIndex(seed2, i + (xNMask & (PRIME_X << 1)), j + PRIME_Y, k + (zNMask & (PRIME_Z << 1))); + double gx9 = GRADIENTS_3D[gi9], gy9 = GRADIENTS_3D[gi9 | 1], gz9 = GRADIENTS_3D[gi9 | 2]; + double rampValue9 = gx9 * x9 + gy9 * y1 + gz9 * z9; + out[0] += aaaa9 * rampValue9; + out[1] += gx9 * aaaa9 - 8 * rampValue9 * aaa9 * x9; + out[2] += gy9 * aaaa9 - 8 * rampValue9 * aaa9 * y1; + out[3] += gz9 * aaaa9 - 8 * rampValue9 * aaa9 * z9; + } + } + + if(!skipD) { + double aD = xAFlipMask1 + yAFlipMask1 + a1; + if(aD > 0) { + double xD = (xNMask | 1) + x1; + double yD = (yNMask | 1) + y1; + double aaD = aD * aD, aaaD = aaD * aD, aaaaD = aaD * aaD; + int giD = gradCoordIndex(seed2, i + (xNMask & (PRIME_X << 1)), j + (yNMask & (PRIME_Y << 1)), k + PRIME_Z); + double gxD = GRADIENTS_3D[giD], gyD = GRADIENTS_3D[giD | 1], gzD = GRADIENTS_3D[giD | 2]; + double rampValueD = gxD * xD + gyD * yD + gzD * z1; + out[0] += aaaaD * rampValueD; + out[1] += gxD * aaaaD - 8 * rampValueD * aaaD * xD; + out[2] += gyD * aaaaD - 8 * rampValueD * aaaD * yD; + out[3] += gzD * aaaaD - 8 * rampValueD * aaaD * z1; + } + } + + out[0] *= 9.046026385208288; + out[1] *= 9.046026385208288; + out[2] *= 9.046026385208288; + out[3] *= 9.046026385208288; + return out; + } } diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/SimplexStyleSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/SimplexStyleSampler.java index eda599a34..a5fd3f3bf 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/SimplexStyleSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/SimplexStyleSampler.java @@ -7,13 +7,14 @@ package com.dfsek.terra.addons.noise.samplers.noise.simplex; +import com.dfsek.terra.addons.noise.samplers.noise.DerivativeNoiseFunction; import com.dfsek.terra.addons.noise.samplers.noise.NoiseFunction; /** * Abstract NoiseSampler implementation for simplex-style noise functions. */ -public abstract class SimplexStyleSampler extends NoiseFunction { +public abstract class SimplexStyleSampler extends DerivativeNoiseFunction { protected static final double[] GRADIENTS_2_D = { 0.130526192220052d, 0.99144486137381d, 0.38268343236509d, 0.923879532511287d, 0.608761429008721d, 0.793353340291235d, 0.793353340291235d, 0.608761429008721d, 0.923879532511287d, 0.38268343236509d, 0.99144486137381d, 0.130526192220051d, @@ -79,26 +80,53 @@ public abstract class SimplexStyleSampler extends NoiseFunction { 1, 1, 0, 0, 0, -1, 1, 0, -1, 1, 0, 0, 0, -1, -1, 0 }; - protected static double gradCoord(int seed, int xPrimed, int yPrimed, double xd, double yd) { + protected static int gradCoordIndex(int seed, int xPrimed, int yPrimed) { int hash = hash(seed, xPrimed, yPrimed); hash ^= hash >> 15; hash &= 127 << 1; - double xg = GRADIENTS_2_D[hash]; - double yg = GRADIENTS_2_D[hash | 1]; + return hash; + } + + protected static double gradCoord(int seed, int xPrimed, int yPrimed, double xd, double yd) { + int index = gradCoordIndex(seed, xPrimed, yPrimed); + + double xg = GRADIENTS_2_D[index]; + double yg = GRADIENTS_2_D[index | 1]; return xd * xg + yd * yg; } - protected static double gradCoord(int seed, int xPrimed, int yPrimed, int zPrimed, double xd, double yd, double zd) { + protected static int gradCoordIndex(int seed, int xPrimed, int yPrimed, int zPrimed) { int hash = hash(seed, xPrimed, yPrimed, zPrimed); hash ^= hash >> 15; hash &= 63 << 2; - double xg = GRADIENTS_3D[hash]; - double yg = GRADIENTS_3D[hash | 1]; - double zg = GRADIENTS_3D[hash | 2]; + return hash; + } + + protected static double gradCoord(int seed, int xPrimed, int yPrimed, int zPrimed, double xd, double yd, double zd) { + int index = gradCoordIndex(seed, xPrimed, yPrimed, zPrimed); + + double xg = GRADIENTS_3D[index]; + double yg = GRADIENTS_3D[index | 1]; + double zg = GRADIENTS_3D[index | 2]; return xd * xg + yd * yg + zd * zg; } + + @Override + public double[] getNoiseDerivativeRaw(long seed, double x, double y) { + return new double[]{0, 0, 0}; + } + + @Override + public double[] getNoiseDerivativeRaw(long seed, double x, double y, double z) { + return new double[]{0, 0, 0, 0}; + } + + @Override + public boolean isDifferentiable() { + return false; + } } From 5b35eb041b286eb0c910fe79ca7525fdc6389b32 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 19:43:56 -0600 Subject: [PATCH 101/126] Remove temp DerivativeFractl nose --- .../noise/DerivativeFractalTemplate.java | 31 ----- .../noise/simplex/DerivativeFractal.java | 122 ------------------ 2 files changed, 153 deletions(-) delete mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java delete mode 100644 common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java deleted file mode 100644 index 68e8c803d..000000000 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/DerivativeFractalTemplate.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.dfsek.terra.addons.noise.config.templates.noise; - -import com.dfsek.tectonic.api.config.template.annotations.Default; -import com.dfsek.tectonic.api.config.template.annotations.Value; - -import com.dfsek.terra.addons.noise.config.templates.SamplerTemplate; -import com.dfsek.terra.addons.noise.samplers.noise.simplex.DerivativeFractal; - - -public class DerivativeFractalTemplate extends DerivativeNoiseTemplate { - - @Value("octaves") - @Default - private int octaves = 3; - - @Value("gain") - @Default - private double gain = 0.5; - - @Value("lacunarity") - @Default - private double lacunarity = 2.0; - - @Override - public DerivativeFractal get() { - DerivativeFractal derivativeFractal = new DerivativeFractal(octaves, gain, lacunarity); - derivativeFractal.setFrequency(frequency); - derivativeFractal.setSalt(salt); - return derivativeFractal; - } -} diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java deleted file mode 100644 index 9a9e7f922..000000000 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/DerivativeFractal.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.dfsek.terra.addons.noise.samplers.noise.simplex; - -import com.dfsek.terra.addons.noise.samplers.noise.DerivativeNoiseFunction; - -import static com.dfsek.terra.addons.noise.samplers.noise.PseudoErosionSampler.dot; - - -/** - * Temporary sampler that provides derivatives to test pseudoerosion, should be replaced with - * derivative versions of existing samplers - */ -public class DerivativeFractal extends DerivativeNoiseFunction { - - private final int heightOctaves; - private final double heightGain; - private final double heightLacunarity; - private static final float HASH_X = 0.3183099f; - private static final float HASH_Y = 0.3678794f; - - public DerivativeFractal(int octaves, double gain, double lacunarity) { - this.heightOctaves = octaves; - this.heightGain = gain; - this.heightLacunarity = lacunarity; - } - - public static float hash(float x, float y) { - float xx = x * HASH_X + HASH_Y; - float yy = y * HASH_Y + HASH_X; - - // Swapped the components here - return 16 * (xx * yy * (xx + yy)); - } - - public static float hashX(float n) { - // Swapped the components here - float nx = HASH_X * n; - return -1.0f + 2.0f * fract(nx); - } - - public static float hashY(float n) { - float ny = HASH_Y * n; - return -1.0f + 2.0f * fract(ny); - } - - public static float fract(float x) { - return (x - (float)Math.floor(x)); - } - - private static float[] baseNoise(float px, float py) { - float ix = (float)Math.floor(px); - float iy = (float)Math.floor(py); - float fx = px - ix; - float fy = py - iy; - - float ux = fx * fx * fx * (fx * (fx * 6.0f - 15.0f) + 10.0f); - float uy = fy * fy * fy * (fy * (fy * 6.0f - 15.0f) + 10.0f); - float dux = fx * fx * 30.0f * (fx * (fx - 2.0f) + 1.0f); - float duy = fy * fy * 30.0f * (fy * (fy - 2.0f) + 1.0f); - - float gan = hash(ix, iy); - float gax = hashX(gan); - float gay = hashY(gan); - - float gbn = hash(ix + 1, iy); - float gbx = hashX(gbn); - float gby = hashY(gbn); - - float gcn = hash(ix, iy + 1); - float gcx = hashX(gcn); - float gcy = hashY(gcn); - - float gdn = hash(ix + 1, iy + 1); - float gdx = hashX(gdn); - float gdy = hashY(gdn); - - float va = dot(gax, gay, fx, fy); - float vb = dot(gbx, gby, fx - 1, fy); - float vc = dot(gcx, gcy, fx, fy - 1); - float vd = dot(gdx, gdy, fx - 1, fy - 1); - - float u2x = gax + (gbx - gax) * ux + (gcx - gax) * uy + (gax - gbx - gcx + gdx) * ux * uy + dux * (uy * (va - vb - vc + vd) + vb - va); - float u2y = gay + (gby - gay) * ux + (gcy - gay) * uy + (gay - gby - gcy + gdy) * ux * uy + duy * (ux * (va - vb - vc + vd) + vc - va); - - return new float[] { va + ux * (vb - va) + uy * (vc - va) + ux * uy * (va - vb - vc + vd), u2x, u2y }; - } - - @Override - public double[] getNoiseDerivativeRaw(long seed, double x, double y) { - double[] out = { 0.0f, 0.0f, 0.0f }; - float heightFreq = 1.0f; - float heightAmp = 1f; - float cumAmp = 0.0f; - for (int i = 0; i < heightOctaves; i++) { - float[] noise = baseNoise((float) (x * heightFreq), (float) (y * heightFreq)); - out[0] += noise[0] * heightAmp; - out[1] += noise[1] * heightAmp * heightFreq; - out[2] += noise[2] * heightAmp * heightFreq; - cumAmp += heightAmp; - heightAmp *= heightGain; - heightFreq *= heightLacunarity; - } - out[0] /= cumAmp; - out[1] /= cumAmp; - out[2] /= cumAmp; - return out; - } - - @Override - public double[] getNoiseDerivativeRaw(long seed, double x, double y, double z) { - return getNoiseDerivativeRaw(seed, x, y); - } - - @Override - public double getNoiseRaw(long seed, double x, double y) { - return getNoiseDerivativeRaw(seed, x, y)[0]; - } - - @Override - public double getNoiseRaw(long seed, double x, double y, double z) { - return getNoiseRaw(seed, x, y); - } -} From 5f340f8ffdbf26253b6a42604a5b80f66230f00d Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 19:48:22 -0600 Subject: [PATCH 102/126] slight open simplex 2s op\pt --- .../noise/simplex/OpenSimplex2Sampler.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java index e4da85a5b..d3e80cc7e 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java @@ -37,41 +37,37 @@ public double getNoiseRaw(long sl, double x, double y) { i *= PRIME_X; j *= PRIME_Y; - double n0, n1, n2; + double value = 0; double a = 0.5 - x0 * x0 - y0 * y0; - if(a <= 0) n0 = 0; - else { - n0 = (a * a) * (a * a) * gradCoord(seed, i, j, x0, y0); + if(a > 0) { + value = (a * a) * (a * a) * gradCoord(seed, i, j, x0, y0); } double c = 2 * (1 - 2 * G2) * (1 / G2 - 2) * t + ((-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); - if(c <= 0) n2 = 0; - else { + if(c > 0) { double x2 = x0 + (2 * G2 - 1); double y2 = y0 + (2 * G2 - 1); - n2 = (c * c) * (c * c) * gradCoord(seed, i + PRIME_X, j + PRIME_Y, x2, y2); + value += (c * c) * (c * c) * gradCoord(seed, i + PRIME_X, j + PRIME_Y, x2, y2); } if(y0 > x0) { double x1 = x0 + G2; double y1 = y0 + (G2 - 1); double b = 0.5 - x1 * x1 - y1 * y1; - if(b <= 0) n1 = 0; - else { - n1 = (b * b) * (b * b) * gradCoord(seed, i, j + PRIME_Y, x1, y1); + if(b > 0) { + value += (b * b) * (b * b) * gradCoord(seed, i, j + PRIME_Y, x1, y1); } } else { double x1 = x0 + (G2 - 1); double y1 = y0 + G2; double b = 0.5 - x1 * x1 - y1 * y1; - if(b <= 0) n1 = 0; - else { - n1 = (b * b) * (b * b) * gradCoord(seed, i + PRIME_X, j, x1, y1); + if(b <= 0) { + value += (b * b) * (b * b) * gradCoord(seed, i + PRIME_X, j, x1, y1); } } - return (n0 + n1 + n2) * 99.83685446303647f; + return value * 99.83685446303647f; } @Override From 017b4608bcb149221d61992c053c43aacfac190f Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 19:49:16 -0600 Subject: [PATCH 103/126] Fix build --- .../src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java index 59fc635a6..16e1d8040 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java @@ -97,8 +97,7 @@ public void initialize() { noiseRegistry.register(addon.key("SIMPLEX"), () -> new SimpleNoiseTemplate(SimplexSampler::new)); noiseRegistry.register(addon.key("GABOR"), GaborNoiseTemplate::new); noiseRegistry.register(addon.key("PSEUDOEROSION"), PseudoErosionTemplate::new); - noiseRegistry.register(addon.key("DERIVATIVE"), DerivativeFractalTemplate::new); - + noiseRegistry.register(addon.key("VALUE"), () -> new SimpleNoiseTemplate(ValueSampler::new)); noiseRegistry.register(addon.key("VALUE_CUBIC"), () -> new SimpleNoiseTemplate(ValueCubicSampler::new)); From bd73427072ad5a23fb8eb13041711cfbbb95a1c3 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 20:29:41 -0600 Subject: [PATCH 104/126] OpenSimplex 2 Derivative Impl --- .../noise/simplex/OpenSimplex2SSampler.java | 2 +- .../noise/simplex/OpenSimplex2Sampler.java | 199 ++++++++++++++++++ 2 files changed, 200 insertions(+), 1 deletion(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java index d9aec851e..ef81ff139 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java @@ -479,7 +479,7 @@ public double[] getNoiseDerivativeRaw(long sl, double x, double y, double z) { int yNMask = (int) (-0.5 - yi); int zNMask = (int) (-0.5 - zi); - double[] out = { 0.0f, 0.0f, 0.0f }; + double[] out = { 0.0f, 0.0f, 0.0f, 0.0f }; double x0 = xi + xNMask; double y0 = yi + yNMask; diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java index d3e80cc7e..443146a9b 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java @@ -153,4 +153,203 @@ public double getNoiseRaw(long sl, double x, double y, double z) { return value * 32.69428253173828125; } + + @Override + public boolean isDifferentiable() { + return true; + } + + @Override + public double[] getNoiseDerivativeRaw(long sl, double x, double y) { + int seed = (int) sl; + // 2D OpenSimplex2 case uses the same algorithm as ordinary Simplex. + final double G2 = (3 - SQRT3) / 6; + + final double F2 = 0.5f * (SQRT3 - 1); + double s = (x + y) * F2; + x += s; + y += s; + + + int i = (int) Math.floor(x); + int j = (int) Math.floor(y); + double xi = x - i; + double yi = y - j; + + double t = (xi + yi) * G2; + double x0 = xi - t; + double y0 = yi - t; + + i *= PRIME_X; + j *= PRIME_Y; + + double[] out = { 0.0f, 0.0f, 0.0f }; + + double a = 0.5 - x0 * x0 - y0 * y0; + if(a > 0) { + double aa = a * a, aaa = aa * a, aaaa = aa * aa; + int gi = gradCoordIndex(seed, i, j); + double gx = GRADIENTS_2_D[gi], gy = GRADIENTS_2_D[gi | 1]; + double rampValue = gx * x0 + gy * y0; + out[0] += aaaa * rampValue; + out[1] += gx * aaaa - 8 * rampValue * aaa * x0; + out[2] += gy * aaaa - 8 * rampValue * aaa * y0; + } + + double c = 2 * (1 - 2 * G2) * (1 / G2 - 2) * t + ((-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a); + if(c > 0) { + double x2 = x0 + (2 * G2 - 1); + double y2 = y0 + (2 * G2 - 1); + double cc = c * c, ccc = cc * c, cccc = cc * cc; + int gi = gradCoordIndex(seed, i + PRIME_X, j + PRIME_Y); + double gx = GRADIENTS_2_D[gi], gy = GRADIENTS_2_D[gi | 1]; + double rampValue = gx * x2 + gy * y2; + out[0] += cccc * rampValue; + out[1] += gx * cccc - 8 * rampValue * ccc * x2; + out[2] += gy * cccc - 8 * rampValue * ccc * y2; } + + if(y0 > x0) { + double x1 = x0 + G2; + double y1 = y0 + (G2 - 1); + double b = 0.5 - x1 * x1 - y1 * y1; + if(b > 0) { + double bb = b * b, bbb = bb * b, bbbb = bb * bb; + int gi = gradCoordIndex(seed, i, j + PRIME_Y); + double gx = GRADIENTS_2_D[gi], gy = GRADIENTS_2_D[gi | 1]; + double rampValue = gx * x1 + gy * y1; + out[0] += bbbb * rampValue; + out[1] += gx * bbbb - 8 * rampValue * bbb * x1; + out[2] += gy * bbbb - 8 * rampValue * bbb * y1; } + } else { + double x1 = x0 + (G2 - 1); + double y1 = y0 + G2; + double b = 0.5 - x1 * x1 - y1 * y1; + if(b > 0) { + double bb = b * b, bbb = bb * b, bbbb = bb * bb; + int gi = gradCoordIndex(seed, i + PRIME_X, j); + double gx = GRADIENTS_2_D[gi], gy = GRADIENTS_2_D[gi | 1]; + double rampValue = gx * x1 + gy * y1; + out[0] += bbbb * rampValue; + out[1] += gx * bbbb - 8 * rampValue * bbb * x1; + out[2] += gy * bbbb - 8 * rampValue * bbb * y1; } + } + + out[0] *= 99.83685446303647f; + out[1] *= 99.83685446303647f; + out[2] *= 99.83685446303647f; + return out; + } + + @Override + public double[] getNoiseDerivativeRaw(long sl, double x, double y, double z) { + int seed = (int) sl; + // 3D OpenSimplex2Sampler case uses two offset rotated cube grids. + final double R3 = (2.0 / 3.0); + double r = (x + y + z) * R3; // Rotation, not skew + x = r - x; + y = r - y; + z = r - z; + + + int i = (int) Math.round(x); + int j = (int) Math.round(y); + int k = (int) Math.round(z); + double x0 = x - i; + double y0 = y - j; + double z0 = z - k; + + int xNSign = (int) (-1.0 - x0) | 1; + int yNSign = (int) (-1.0 - y0) | 1; + int zNSign = (int) (-1.0 - z0) | 1; + + double ax0 = xNSign * -x0; + double ay0 = yNSign * -y0; + double az0 = zNSign * -z0; + + i *= PRIME_X; + j *= PRIME_Y; + k *= PRIME_Z; + + double[] out = { 0.0f, 0.0f, 0.0f, 0.0f }; + double a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); + + for(int l = 0; ; l++) { + if(a > 0) { + double aa = a * a, aaa = aa * a, aaaa = aa * aa; + int gi = gradCoordIndex(seed, i, j, k); + double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; + double rampValue = gx * x0 + gy * y0 + gz * z0; + out[0] += aaaa * rampValue; + out[1] += gx * aaaa - 8 * rampValue * aaa * x0; + out[1] += gy * aaaa - 8 * rampValue * aaa * y0; + out[2] += gz * aaaa - 8 * rampValue * aaa * z0; + } + + if(ax0 >= ay0 && ax0 >= az0) { + double b = a + ax0 + ax0; + if(b > 1) { + b -= 1; + double bb = b * b, bbb = bb * b, bbbb = bb * bb; + int gi = gradCoordIndex(seed, i - xNSign * PRIME_X, j, k); + double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; + double rampValue = gx * (x0 + xNSign) + gy * y0 + gz * z0; + out[0] += bbbb * rampValue; + out[1] += gx * bbbb - 8 * rampValue * bbb * (x0 + xNSign); + out[1] += gy * bbbb - 8 * rampValue * bbb * y0; + out[2] += gz * bbbb - 8 * rampValue * bbb * z0; + } + } else if(ay0 > ax0 && ay0 >= az0) { + double b = a + ay0 + ay0; + if(b > 1) { + b -= 1; + double bb = b * b, bbb = bb * b, bbbb = bb * bb; + int gi = gradCoordIndex(seed, i, j - yNSign * PRIME_Y, k); + double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; + double rampValue = gx * x0 + gy * (y0 + yNSign) + gz * z0; + out[0] += bbbb * rampValue; + out[1] += gx * bbbb - 8 * rampValue * bbb * x0; + out[1] += gy * bbbb - 8 * rampValue * bbb * (y0 + yNSign); + out[2] += gz * bbbb - 8 * rampValue * bbb * z0; } + } else { + double b = a + az0 + az0; + if(b > 1) { + b -= 1; + double bb = b * b, bbb = bb * b, bbbb = bb * bb; + int gi = gradCoordIndex(seed, i, j, k - zNSign * PRIME_Z); + double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; + double rampValue = gx * x0 + gy * y0 + gz * (z0 + zNSign); + out[0] += bbbb * rampValue; + out[1] += gx * bbbb - 8 * rampValue * bbb * x0; + out[1] += gy * bbbb - 8 * rampValue * bbb * y0; + out[2] += gz * bbbb - 8 * rampValue * bbb * (z0 + zNSign); } + } + + if(l == 1) break; + + ax0 = 0.5 - ax0; + ay0 = 0.5 - ay0; + az0 = 0.5 - az0; + + x0 = xNSign * ax0; + y0 = yNSign * ay0; + z0 = zNSign * az0; + + a += (0.75 - ax0) - (ay0 + az0); + + i += (xNSign >> 1) & PRIME_X; + j += (yNSign >> 1) & PRIME_Y; + k += (zNSign >> 1) & PRIME_Z; + + xNSign = -xNSign; + yNSign = -yNSign; + zNSign = -zNSign; + + seed = ~seed; + } + out[0] *= 32.69428253173828125; + out[1] *= 32.69428253173828125; + out[2] *= 32.69428253173828125; + out[3] *= 32.69428253173828125; + return out; + } } From 1d05f95f746639fdbc4c242d84aa4fcd93d666f4 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 20:38:22 -0600 Subject: [PATCH 105/126] Sin/Cos Opts --- .../com/dfsek/terra/api/util/MathUtil.java | 58 +++++++++++-------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java index e57765f2e..87ad9159d 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java +++ b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java @@ -18,41 +18,51 @@ public final class MathUtil { * Epsilon for fuzzy floating point comparisons. */ public static final double EPSILON = 1.0E-5; - private static final int SIN_BITS, SIN_MASK, SIN_COUNT; - private static final double radFull, radToIndex; - private static final double degFull, degToIndex; - private static final double[] sin, cos; - static { - SIN_BITS = 12; - SIN_MASK = ~(-1 << SIN_BITS); - SIN_COUNT = SIN_MASK + 1; + private static final int lookupBits = 14; - radFull = Math.PI * 2.0; - degFull = 360.0; - radToIndex = SIN_COUNT / radFull; - degToIndex = SIN_COUNT / degFull; + static final int lookupTableSize = 1 << lookupBits; - sin = new double[SIN_COUNT]; - cos = new double[SIN_COUNT]; + private static final int lookupTableSizeWithMargin = lookupTableSize + 1; + private static final double tauOverLookupSize = TrigonometryConstants.TAU / lookupTableSize; + static final double radianToIndex = (~(-1 << lookupBits) + 1) / TrigonometryConstants.TAU; + private static final long[] sinTable; - for(int i = 0; i < SIN_COUNT; i++) { - sin[i] = Math.sin((i + 0.5f) / SIN_COUNT * radFull); - cos[i] = Math.cos((i + 0.5f) / SIN_COUNT * radFull); + static { + sinTable = new long[lookupTableSizeWithMargin]; + for (int i = 0; i < lookupTableSizeWithMargin; i++) { + double d = i * tauOverLookupSize; + sinTable[i] = Double.doubleToRawLongBits(StrictMath.sin(d)); } + } - // Four cardinal directions (credits: Nate) - for(int i = 0; i < 360; i += 90) { - sin[(int) (i * degToIndex) & SIN_MASK] = Math.sin(i * Math.PI / 180.0); - cos[(int) (i * degToIndex) & SIN_MASK] = Math.cos(i * Math.PI / 180.0); - } + static double sinLookup(long index) { + // Trigonometric identity: sin(-x) = -sin(x) + // Given a domain of 0 <= x <= 2*pi, just negate the value if x > pi. + // This allows the sin table size to be halved. + long neg = (index & 0x8000000000000000L) << 32; + + // All bits set if (pi/2 <= x), none set otherwise + // Extracts the 31st bit from 'half' + long mask = (index << 33) >> 63; + + // Trigonometric identity: sin(x) = sin(pi/2 - x) + long pos = (0x8000000000000001L & mask) + (index ^ mask); + + // Wrap the position in the table. Moving this down to immediately before the array access + // seems to help the Hotspot compiler optimize the bit math better. + pos &= 0x7fffffffffffffffL; + + // Fetch the corresponding value from the LUT and invert the sign bit as needed + // This directly manipulate the sign bit on the double bits to simplify logic + return Double.longBitsToDouble(sinTable[(int) pos] ^ neg); } public static double sin(double rad) { - return sin[(int) (rad * radToIndex) & SIN_MASK]; + return sinLookup((long) (rad * radianToIndex) & 0xFFFFFFFFL); } public static double cos(double rad) { - return cos[(int) (rad * radToIndex) & SIN_MASK]; + return sinLookup((long) (rad * radianToIndex + lookupTableSize) & 0xFFFFFFFFL); } public static double tan(double rad) { From 10d723372daf14bc551159d050412c71c7f69a76 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 20:45:47 -0600 Subject: [PATCH 106/126] Fix build --- .../api/src/main/java/com/dfsek/terra/api/util/MathUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java index 87ad9159d..0dbe5bb23 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java +++ b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java @@ -23,8 +23,8 @@ public final class MathUtil { static final int lookupTableSize = 1 << lookupBits; private static final int lookupTableSizeWithMargin = lookupTableSize + 1; - private static final double tauOverLookupSize = TrigonometryConstants.TAU / lookupTableSize; - static final double radianToIndex = (~(-1 << lookupBits) + 1) / TrigonometryConstants.TAU; + private static final double tauOverLookupSize = Math.TAU / lookupTableSize; + static final double radianToIndex = (~(-1 << lookupBits) + 1) / Math.TAU; private static final long[] sinTable; static { From f469193909f4d540e5f0d778359114daf392ac18 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 20:51:00 -0600 Subject: [PATCH 107/126] Make seed affect pseudoerosion hasing --- .../samplers/noise/PseudoErosionSampler.java | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java index 7aeff49ac..0b96ea517 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java @@ -47,22 +47,14 @@ public PseudoErosionSampler(int octaves, double gain, double lacunarity, double this.maxCellDistSqRecip = 1 / maxCellDistSq; } - public static float hash(float x, float y) { - float xx = x * HASH_X + HASH_Y; - float yy = y * HASH_Y + HASH_X; - - // Swapped the components here - return 16 * (xx * yy * (xx + yy)); - } - - public static float hashX(float n) { + public static float hashX(float seed, float n) { // Swapped the components here - float nx = HASH_X * n; + float nx = HASH_X * n * seed; return -1.0f + 2.0f * fract(nx); } - public static float hashY(float n) { - float ny = HASH_Y * n; + public static float hashY(float seed, float n) { + float ny = HASH_Y * n * seed; return -1.0f + 2.0f * fract(ny); } @@ -70,7 +62,7 @@ public static float fract(float x) { return (x - (float)Math.floor(x)); } - public float[] erosion(float x, float y, float dirX, float dirY) { + public float[] erosion(int seed, float x, float y, float dirX, float dirY) { int gridX = Math.round(x); int gridY = Math.round(y); float noise = 0.0f; @@ -80,10 +72,9 @@ public float[] erosion(float x, float y, float dirX, float dirY) { for (int cellX = gridX - 1; cellX <= gridX + 1; cellX++) { for (int cellY = gridY - 1; cellY <= gridY + 1; cellY++) { - // TODO - Make seed affect hashing - float cellHash = hash(cellX, cellY); - float cellOffsetX = (float) (hashX(cellHash) * jitter); - float cellOffsetY = (float) (hashY(cellHash) * jitter); + float cellHash = hash(seed, cellX, cellY); + float cellOffsetX = (float) (hashX(seed, cellHash) * jitter); + float cellOffsetY = (float) (hashY(seed, cellHash) * jitter); float cellOriginDeltaX = (x - cellX) + cellOffsetX; float cellOriginDeltaY = (y - cellY) + cellOffsetY; float cellOriginDistSq = cellOriginDeltaX * cellOriginDeltaX + cellOriginDeltaY * cellOriginDeltaY; @@ -135,7 +126,7 @@ public float heightMap(long seed, float x, float y) { // Stack erosion octaves for (int i = 0; i < octaves; i++) { - float[] erosionResult = erosion( + float[] erosionResult = erosion((int) seed, x * freq * (float) erosionFrequency, y * freq * (float) erosionFrequency, baseDirX + dirY * (float) branchStrength, From d6772f51eaa7c5c039accdcc000a7fd0f18706c6 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 20:56:13 -0600 Subject: [PATCH 108/126] Reformat --- .../addons/biome/extrusion/api/Extrusion.java | 4 +- .../pipeline/api/delegate/SelfDelegate.java | 4 +- .../biome/holder/PaletteHolderBuilder.java | 4 +- .../distributors/PointSetDistributor.java | 4 +- .../dfsek/terra/addons/noise/NoiseAddon.java | 43 ++- .../addons/noise/NoiseConfigPackTemplate.java | 6 +- .../DerivativeNoiseSamplerTemplate.java | 3 +- .../templates/ImageSamplerTemplate.java | 9 +- .../noise/PseudoErosionTemplate.java | 19 +- .../noise/DerivativeNoiseFunction.java | 1 + .../samplers/noise/PseudoErosionSampler.java | 55 +-- .../noise/simplex/OpenSimplex2SSampler.java | 334 +++++++++--------- .../noise/simplex/OpenSimplex2Sampler.java | 209 +++++------ .../noise/simplex/SimplexStyleSampler.java | 5 +- .../feature/FeatureGenerationAddon.java | 10 +- .../feature/FeatureGenerationStage.java | 6 +- .../structure/mutator/MutatedStructure.java | 4 +- .../addons/terrascript/parser/ParserUtil.java | 8 +- .../builders/CheckBlockFunctionBuilder.java | 4 +- .../api/noise/DerivativeNoiseSampler.java | 6 +- .../com/dfsek/terra/api/util/MathUtil.java | 2 +- .../world/biome/generation/BiomeProvider.java | 12 +- .../preprocessor/MetaNumberPreprocessor.java | 7 +- .../event/FunctionalEventHandlerImpl.java | 17 +- .../com/dfsek/terra/bukkit/BukkitEntity.java | 6 +- .../bukkit/world/BukkitWorldProperties.java | 4 +- .../terra/lifecycle/LifecycleEntryPoint.java | 6 +- .../mixin/lifecycle/MinecraftServerMixin.java | 1 + .../terra/lifecycle/util/LifecycleUtil.java | 1 + 29 files changed, 411 insertions(+), 383 deletions(-) diff --git a/common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/api/Extrusion.java b/common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/api/Extrusion.java index 4c4ca972a..c1d5f5524 100644 --- a/common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/api/Extrusion.java +++ b/common/addons/biome-provider-extrusion/src/main/java/com/dfsek/terra/addons/biome/extrusion/api/Extrusion.java @@ -1,9 +1,9 @@ package com.dfsek.terra.addons.biome.extrusion.api; -import java.util.Collection; - import com.dfsek.terra.api.world.biome.Biome; +import java.util.Collection; + public interface Extrusion { Biome extrude(Biome original, int x, int y, int z, long seed); diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/delegate/SelfDelegate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/delegate/SelfDelegate.java index c6762334a..6b62818d2 100644 --- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/delegate/SelfDelegate.java +++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/delegate/SelfDelegate.java @@ -1,10 +1,10 @@ package com.dfsek.terra.addons.biome.pipeline.api.delegate; -import com.dfsek.terra.api.world.biome.Biome; - import java.util.Collections; import java.util.Set; +import com.dfsek.terra.api.world.biome.Biome; + final class SelfDelegate implements BiomeDelegate { public static final SelfDelegate INSTANCE = new SelfDelegate(); diff --git a/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/holder/PaletteHolderBuilder.java b/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/holder/PaletteHolderBuilder.java index e840f9817..a96cbcc48 100644 --- a/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/holder/PaletteHolderBuilder.java +++ b/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/holder/PaletteHolderBuilder.java @@ -7,11 +7,11 @@ package com.dfsek.terra.addons.biome.holder; +import com.dfsek.terra.api.world.chunk.generation.util.Palette; + import java.util.Map; import java.util.TreeMap; -import com.dfsek.terra.api.world.chunk.generation.util.Palette; - public class PaletteHolderBuilder { private final TreeMap paletteMap = new TreeMap<>(); diff --git a/common/addons/config-distributors/src/main/java/com/dfsek/terra/addons/feature/distributor/distributors/PointSetDistributor.java b/common/addons/config-distributors/src/main/java/com/dfsek/terra/addons/feature/distributor/distributors/PointSetDistributor.java index f85d41e5f..4285af486 100644 --- a/common/addons/config-distributors/src/main/java/com/dfsek/terra/addons/feature/distributor/distributors/PointSetDistributor.java +++ b/common/addons/config-distributors/src/main/java/com/dfsek/terra/addons/feature/distributor/distributors/PointSetDistributor.java @@ -7,11 +7,11 @@ package com.dfsek.terra.addons.feature.distributor.distributors; -import java.util.Set; - import com.dfsek.terra.addons.feature.distributor.util.Point; import com.dfsek.terra.api.structure.feature.Distributor; +import java.util.Set; + public class PointSetDistributor implements Distributor { private final Set points; diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java index 16e1d8040..3fd52950c 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseAddon.java @@ -9,17 +9,46 @@ import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.function.Supplier; + import com.dfsek.terra.addons.manifest.api.AddonInitializer; import com.dfsek.terra.addons.noise.config.CubicSplinePointTemplate; import com.dfsek.terra.addons.noise.config.DimensionApplicableNoiseSampler; -import com.dfsek.terra.addons.noise.config.templates.*; -import com.dfsek.terra.addons.noise.config.templates.noise.*; +import com.dfsek.terra.addons.noise.config.templates.BinaryArithmeticTemplate; +import com.dfsek.terra.addons.noise.config.templates.DerivativeNoiseSamplerTemplate; +import com.dfsek.terra.addons.noise.config.templates.DomainWarpTemplate; +import com.dfsek.terra.addons.noise.config.templates.FunctionTemplate; +import com.dfsek.terra.addons.noise.config.templates.ImageSamplerTemplate; +import com.dfsek.terra.addons.noise.config.templates.KernelTemplate; +import com.dfsek.terra.addons.noise.config.templates.LinearHeightmapSamplerTemplate; +import com.dfsek.terra.addons.noise.config.templates.TranslateSamplerTemplate; +import com.dfsek.terra.addons.noise.config.templates.noise.CellularNoiseTemplate; +import com.dfsek.terra.addons.noise.config.templates.noise.ConstantNoiseTemplate; +import com.dfsek.terra.addons.noise.config.templates.noise.DistanceSamplerTemplate; +import com.dfsek.terra.addons.noise.config.templates.noise.ExpressionFunctionTemplate; +import com.dfsek.terra.addons.noise.config.templates.noise.GaborNoiseTemplate; +import com.dfsek.terra.addons.noise.config.templates.noise.PseudoErosionTemplate; +import com.dfsek.terra.addons.noise.config.templates.noise.SimpleNoiseTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.fractal.BrownianMotionTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.fractal.PingPongTemplate; import com.dfsek.terra.addons.noise.config.templates.noise.fractal.RidgedFractalTemplate; -import com.dfsek.terra.addons.noise.config.templates.normalizer.*; +import com.dfsek.terra.addons.noise.config.templates.normalizer.ClampNormalizerTemplate; +import com.dfsek.terra.addons.noise.config.templates.normalizer.CubicSplineNormalizerTemplate; +import com.dfsek.terra.addons.noise.config.templates.normalizer.ExpressionNormalizerTemplate; +import com.dfsek.terra.addons.noise.config.templates.normalizer.LinearNormalizerTemplate; +import com.dfsek.terra.addons.noise.config.templates.normalizer.NormalNormalizerTemplate; +import com.dfsek.terra.addons.noise.config.templates.normalizer.PosterizationNormalizerTemplate; +import com.dfsek.terra.addons.noise.config.templates.normalizer.ProbabilityNormalizerTemplate; +import com.dfsek.terra.addons.noise.config.templates.normalizer.ScaleNormalizerTemplate; import com.dfsek.terra.addons.noise.math.CubicSpline; -import com.dfsek.terra.addons.noise.samplers.arithmetic.*; +import com.dfsek.terra.addons.noise.samplers.arithmetic.AdditionSampler; +import com.dfsek.terra.addons.noise.samplers.arithmetic.DivisionSampler; +import com.dfsek.terra.addons.noise.samplers.arithmetic.MaxSampler; +import com.dfsek.terra.addons.noise.samplers.arithmetic.MinSampler; +import com.dfsek.terra.addons.noise.samplers.arithmetic.MultiplicationSampler; +import com.dfsek.terra.addons.noise.samplers.arithmetic.SubtractionSampler; import com.dfsek.terra.addons.noise.samplers.noise.CellularSampler; import com.dfsek.terra.addons.noise.samplers.noise.DistanceSampler; import com.dfsek.terra.addons.noise.samplers.noise.random.GaussianNoiseSampler; @@ -41,10 +70,6 @@ import com.dfsek.terra.api.registry.CheckedRegistry; import com.dfsek.terra.api.util.reflection.TypeKey; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.function.Supplier; - public class NoiseAddon implements AddonInitializer { public static final TypeKey>> NOISE_SAMPLER_TOKEN = new TypeKey<>() { @@ -97,7 +122,7 @@ public void initialize() { noiseRegistry.register(addon.key("SIMPLEX"), () -> new SimpleNoiseTemplate(SimplexSampler::new)); noiseRegistry.register(addon.key("GABOR"), GaborNoiseTemplate::new); noiseRegistry.register(addon.key("PSEUDOEROSION"), PseudoErosionTemplate::new); - + noiseRegistry.register(addon.key("VALUE"), () -> new SimpleNoiseTemplate(ValueSampler::new)); noiseRegistry.register(addon.key("VALUE_CUBIC"), () -> new SimpleNoiseTemplate(ValueCubicSampler::new)); diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseConfigPackTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseConfigPackTemplate.java index c41af1763..d6ac6c00c 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseConfigPackTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/NoiseConfigPackTemplate.java @@ -11,14 +11,14 @@ import com.dfsek.tectonic.api.config.template.annotations.Default; import com.dfsek.tectonic.api.config.template.annotations.Value; -import java.util.LinkedHashMap; -import java.util.Map; - import com.dfsek.terra.addons.noise.config.DimensionApplicableNoiseSampler; import com.dfsek.terra.addons.noise.config.templates.FunctionTemplate; import com.dfsek.terra.api.config.meta.Meta; import com.dfsek.terra.api.properties.Properties; +import java.util.LinkedHashMap; +import java.util.Map; + @SuppressWarnings("FieldMayBeFinal") public class NoiseConfigPackTemplate implements ConfigTemplate, Properties { diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java index d93054ac9..9e66b23ea 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/DerivativeNoiseSamplerTemplate.java @@ -14,7 +14,8 @@ public class DerivativeNoiseSamplerTemplate extends SamplerTemplate { diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java index f815cd40c..03f2252e1 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java @@ -10,61 +10,48 @@ public class PseudoErosionTemplate extends NoiseTemplate { + @Value("frequency") + @Default + protected @Meta double frequency = 1d; @Value("octaves") @Default private int octaves = 4; - @Value("lacunarity") @Default private double lacunarity = 2.0; - @Value("gain") @Default private double gain = 0.5; - @Value("slope-strength") @Default private double slopeStrength = 1.0; - @Value("branch-strength") @Default private double branchStrength = 1.0; - @Value("strength") @Default private double strength = 0.04; - @Value("erosion-frequency") @Default private double erosionFrequency = 0.02; - @Value("sampler") private DerivativeNoiseSampler heightSampler; - @Value("slope-mask.enable") @Default private boolean slopeMask = true; - @Value("slope-mask.none") @Default private double slopeMaskNone = -0.5; - @Value("slope-mask.full") @Default private double slopeMaskFull = 1; - @Value("jitter") @Default private double jitterModifier = 1; - @Value("average-impulses") @Default private boolean averageErosionImpulses = true; - @Value("frequency") - @Default - protected @Meta double frequency = 1d; - @Override public PseudoErosionSampler get() { PseudoErosionSampler pseudoErosion = new PseudoErosionSampler(octaves, gain, lacunarity, diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/DerivativeNoiseFunction.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/DerivativeNoiseFunction.java index c5caa0d3a..0d654eb64 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/DerivativeNoiseFunction.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/DerivativeNoiseFunction.java @@ -2,6 +2,7 @@ import com.dfsek.terra.api.noise.DerivativeNoiseSampler; + public abstract class DerivativeNoiseFunction extends NoiseFunction implements DerivativeNoiseSampler { @Override public boolean isDifferentiable() { diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java index 0b96ea517..c761d2e80 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java @@ -9,12 +9,12 @@ public class PseudoErosionSampler extends NoiseFunction { public static final float TAU = (float) (2.0 * Math.PI); private static final float HASH_X = 0.3183099f; private static final float HASH_Y = 0.3678794f; - private final int octaves; public final double gain; public final double lacunarity; public final double slopeStrength; public final double branchStrength; public final double erosionStrength; + private final int octaves; private final double erosionFrequency; private final DerivativeNoiseSampler sampler; private final boolean slopeMask; @@ -25,7 +25,8 @@ public class PseudoErosionSampler extends NoiseFunction { private final double maxCellDistSqRecip; private final boolean averageErosionImpulses; - public PseudoErosionSampler(int octaves, double gain, double lacunarity, double slopeStrength, double branchStrength, double erosionStrength, double erosionFrequency, DerivativeNoiseSampler sampler, + public PseudoErosionSampler(int octaves, double gain, double lacunarity, double slopeStrength, double branchStrength, + double erosionStrength, double erosionFrequency, DerivativeNoiseSampler sampler, boolean slopeMask, double slopeMaskFull, double slopeMaskNone, double jitterModifier, boolean averageErosionImpulses) { this.octaves = octaves; @@ -59,7 +60,22 @@ public static float hashY(float seed, float n) { } public static float fract(float x) { - return (x - (float)Math.floor(x)); + return (x - (float) Math.floor(x)); + } + + public static float smoothstep(float edge0, float edge1, float x) { + // Scale, bias and saturate x to 0..1 range + x = clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f); + // Evaluate polynomial + return x * x * (3 - 2 * x); + } + + public static float clamp(float x, float minVal, float maxVal) { + return Math.max(minVal, Math.min(maxVal, x)); + } + + public static float dot(float x1, float y1, float x2, float y2) { + return x1 * x2 + y1 * y2; } public float[] erosion(int seed, float x, float y, float dirX, float dirY) { @@ -70,16 +86,17 @@ public float[] erosion(int seed, float x, float y, float dirX, float dirY) { float dirOutY = 0.0f; float cumAmp = 0.0f; - for (int cellX = gridX - 1; cellX <= gridX + 1; cellX++) { - for (int cellY = gridY - 1; cellY <= gridY + 1; cellY++) { + for(int cellX = gridX - 1; cellX <= gridX + 1; cellX++) { + for(int cellY = gridY - 1; cellY <= gridY + 1; cellY++) { float cellHash = hash(seed, cellX, cellY); float cellOffsetX = (float) (hashX(seed, cellHash) * jitter); float cellOffsetY = (float) (hashY(seed, cellHash) * jitter); float cellOriginDeltaX = (x - cellX) + cellOffsetX; float cellOriginDeltaY = (y - cellY) + cellOffsetY; float cellOriginDistSq = cellOriginDeltaX * cellOriginDeltaX + cellOriginDeltaY * cellOriginDeltaY; - if (cellOriginDistSq > maxCellDistSq) continue; // Skip calculating cells too far away - float ampTmp = (float) ((cellOriginDistSq * maxCellDistSqRecip) - 1); float amp = ampTmp * ampTmp; // Decrease cell amplitude further away + if(cellOriginDistSq > maxCellDistSq) continue; // Skip calculating cells too far away + float ampTmp = (float) ((cellOriginDistSq * maxCellDistSqRecip) - 1); + float amp = ampTmp * ampTmp; // Decrease cell amplitude further away cumAmp += amp; float directionalStrength = dot(cellOriginDeltaX, cellOriginDeltaY, dirX, dirY) * TAU; noise += (float) (MathUtil.cos(directionalStrength) * amp); @@ -88,23 +105,12 @@ public float[] erosion(int seed, float x, float y, float dirX, float dirY) { dirOutY -= sinAngle * (cellOriginDeltaY + dirY); } } - if (averageErosionImpulses && cumAmp != 0) { + if(averageErosionImpulses && cumAmp != 0) { noise /= cumAmp; dirOutX /= cumAmp; dirOutY /= cumAmp; } - return new float[] {noise, dirOutX, dirOutY}; - } - - public static float smoothstep(float edge0, float edge1, float x) { - // Scale, bias and saturate x to 0..1 range - x = clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f); - // Evaluate polynomial - return x * x * (3 - 2 * x); - } - - public static float clamp(float x, float minVal, float maxVal) { - return Math.max(minVal, Math.min(maxVal, x)); + return new float[]{ noise, dirOutX, dirOutY }; } public float heightMap(long seed, float x, float y) { @@ -125,7 +131,7 @@ public float heightMap(long seed, float x, float y) { float freq = 1.0f; // Stack erosion octaves - for (int i = 0; i < octaves; i++) { + for(int i = 0; i < octaves; i++) { float[] erosionResult = erosion((int) seed, x * freq * (float) erosionFrequency, y * freq * (float) erosionFrequency, @@ -139,7 +145,6 @@ public float heightMap(long seed, float x, float y) { freq *= lacunarity; } - // TODO - Test different output ranges, see how they affect visuals // Normalize erosion noise erosion /= cumAmp; // [-1, 1] -> [0, 1] @@ -147,7 +152,7 @@ public float heightMap(long seed, float x, float y) { // Without masking, erosion noise in areas with small gradients tend to produce mounds, // this reduces erosion amplitude towards smaller gradients to avoid this - if (slopeMask) { + if(slopeMask) { float dirMagSq = dot(baseDirX, baseDirY, baseDirX, baseDirY); float flatness = smoothstep((float) slopeMaskNoneSq, (float) slopeMaskFullSq, dirMagSq); erosion *= flatness; @@ -156,10 +161,6 @@ public float heightMap(long seed, float x, float y) { return (float) (height + erosion * erosionStrength); } - public static float dot(float x1, float y1, float x2, float y2) { - return x1 * x2 + y1 * y2; - } - @Override public double getNoiseRaw(long seed, double x, double y) { return heightMap(seed, (float) x, (float) y); diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java index ef81ff139..86adcee3b 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2SSampler.java @@ -276,6 +276,7 @@ public double getNoiseRaw(long sl, double x, double y, double z) { return value * 9.046026385208288; } + @Override public boolean isDifferentiable() { return true; @@ -283,173 +284,174 @@ public boolean isDifferentiable() { @Override public double[] getNoiseDerivativeRaw(long sl, double x, double y) { - int seed = (int) sl; - // 2D OpenSimplex2S case is a modified 2D simplex noise. - - final double SQRT3 = 1.7320508075688772935274463415059; - final double G2 = (3 - SQRT3) / 6; - - final double F2 = 0.5f * (SQRT3 - 1); - double s = (x + y) * F2; - x += s; - y += s; - - - int i = (int) Math.floor(x); - int j = (int) Math.floor(y); - double xi = x - i; - double yi = y - j; - - i *= PRIME_X; - j *= PRIME_Y; - int i1 = i + PRIME_X; - int j1 = j + PRIME_Y; - - double t = (xi + yi) * G2; - double x0 = xi - t; - double y0 = yi - t; - - double[] out = { 0.0f, 0.0f, 0.0f }; - - double a0 = (2.0 / 3.0) - x0 * x0 - y0 * y0; - double aa0 = a0 * a0, aaa0 = aa0 * a0, aaaa0 = aa0 * aa0; - int gi0 = gradCoordIndex(seed, i, j); - double gx0 = GRADIENTS_2_D[gi0], gy0 = GRADIENTS_2_D[gi0 | 1]; - double rampValue0 = gx0 * x0 + gy0 * y0; - out[0] = aaaa0 * rampValue0; - out[1] = gx0 * aaaa0 - 8 * rampValue0 * aaa0 * x0; - out[2] = gy0 * aaaa0 - 8 * rampValue0 * aaa0 * y0; - - - - double a1 = 2 * (1 - 2 * G2) * (1 / G2 - 2) * t + ((-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a0); - double x1 = x0 - (1 - 2 * G2); - double y1 = y0 - (1 - 2 * G2); - double aa1 = a1 * a1, aaa1 = aa1 * a1, aaaa1 = aa1 * aa1; - int gi1 = gradCoordIndex(seed, i1, j1); - double gx1 = GRADIENTS_2_D[gi1], gy1 = GRADIENTS_2_D[gi1 | 1]; - double rampValue1 = gx1 * x1 + gy1 * y1; - out[0] += aaaa1 * rampValue1; - out[1] += gx1 * aaaa1 - 8 * rampValue1 * aaa1 * x1; - out[2] += gy1 * aaaa1 - 8 * rampValue1 * aaa1 * y1; - - // Nested conditionals were faster than compact bit logic/arithmetic. - double xmyi = xi - yi; - if(t > G2) { - if(xi + xmyi > 1) { - double x2 = x0 + (3 * G2 - 2); - double y2 = y0 + (3 * G2 - 1); - double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; - if(a2 > 0) { - double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; - int gi2 = gradCoordIndex(seed, i + (PRIME_X << 1), j + PRIME_Y); - double gx2 = GRADIENTS_2_D[gi2 | 0], gy2 = GRADIENTS_2_D[gi2 | 1]; - double rampValue2 = gx2 * x2 + gy2 * y2; - out[0] += aaaa2 * rampValue2; - out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; - out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; - } - } else { - double x2 = x0 + G2; - double y2 = y0 + (G2 - 1); - double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; - if(a2 > 0) { - double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; - int gi2 = gradCoordIndex(seed, i, j + PRIME_Y); - double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; - double rampValue2 = gx2 * x2 + gy2 * y2; - out[0] += aaaa2 * rampValue2; - out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; - out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; - } - } - - if(yi - xmyi > 1) { - double x3 = x0 + (3 * G2 - 1); - double y3 = y0 + (3 * G2 - 2); - double a3 = (2.0 / 3.0) - x3 * x3 - y3 * y3; - if(a3 > 0) { - double aa3 = a3 * a3, aaa3 = aa3 * a3, aaaa3 = aa3 * aa3; - int gi3 = gradCoordIndex(seed, i + PRIME_X, j + (PRIME_Y << 1)); - double gx3 = GRADIENTS_2_D[gi3], gy3 = GRADIENTS_2_D[gi3 | 1]; - double rampValue3 = gx3 * x3 + gy3 * y3; - out[0] += aaaa3 * rampValue3; - out[1] += gx3 * aaaa3 - 8 * rampValue3 * aaa3 * x3; - out[2] += gy3 * aaaa3 - 8 * rampValue3 * aaa3 * y3; - } - } else { - double x3 = x0 + (G2 - 1); - double y3 = y0 + G2; - double a3 = (2.0 / 3.0) - x3 * x3 - y3 * y3; - if(a3 > 0) { - double aa3 = a3 * a3, aaa3 = aa3 * a3, aaaa3 = aa3 * aa3; - int gi3 = gradCoordIndex(seed, i + PRIME_X, j); - double gx3 = GRADIENTS_2_D[gi3], gy3 = GRADIENTS_2_D[gi3 | 1]; - double rampValue3 = gx3 * x3 + gy3 * y3; - out[0] += aaaa3 * rampValue3; - out[1] += gx3 * aaaa3 - 8 * rampValue3 * aaa3 * x3; - out[2] += gy3 * aaaa3 - 8 * rampValue3 * aaa3 * y3; - } - } - } else { - if(xi + xmyi < 0) { - double x2 = x0 + (1 - G2); - double y2 = y0 - G2; - double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; - if(a2 > 0) { - double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; - int gi2 = gradCoordIndex(seed, i - PRIME_X, j); - double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; - double rampValue2 = gx2 * x2 + gy2 * y2; - out[0] += aaaa2 * rampValue2; - out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; - out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; } - } else { - double x2 = x0 + (G2 - 1); - double y2 = y0 + G2; - double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; - if(a2 > 0) { - double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; - int gi2 = gradCoordIndex(seed, i + PRIME_X, j); - double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; - double rampValue2 = gx2 * x2 + gy2 * y2; - out[0] += aaaa2 * rampValue2; - out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; - out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; - } - } - - if(yi < xmyi) { - double x2 = x0 - G2; - double y2 = y0 - (G2 - 1); - double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; - if(a2 > 0) { - double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; - int gi2 = gradCoordIndex(seed, i, j - PRIME_Y); - double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; - double rampValue2 = gx2 * x2 + gy2 * y2; - out[0] += aaaa2 * rampValue2; - out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; - out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; } - } else { - double x2 = x0 + G2; - double y2 = y0 + (G2 - 1); - double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; - if(a2 > 0) { - double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; - int gi2 = gradCoordIndex(seed, i, j + PRIME_Y); - double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; - double rampValue2 = gx2 * x2 + gy2 * y2; - out[0] += aaaa2 * rampValue2; - out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; - out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; - } - } + int seed = (int) sl; + // 2D OpenSimplex2S case is a modified 2D simplex noise. + + final double SQRT3 = 1.7320508075688772935274463415059; + final double G2 = (3 - SQRT3) / 6; + + final double F2 = 0.5f * (SQRT3 - 1); + double s = (x + y) * F2; + x += s; + y += s; + + + int i = (int) Math.floor(x); + int j = (int) Math.floor(y); + double xi = x - i; + double yi = y - j; + + i *= PRIME_X; + j *= PRIME_Y; + int i1 = i + PRIME_X; + int j1 = j + PRIME_Y; + + double t = (xi + yi) * G2; + double x0 = xi - t; + double y0 = yi - t; + + double[] out = { 0.0f, 0.0f, 0.0f }; + + double a0 = (2.0 / 3.0) - x0 * x0 - y0 * y0; + double aa0 = a0 * a0, aaa0 = aa0 * a0, aaaa0 = aa0 * aa0; + int gi0 = gradCoordIndex(seed, i, j); + double gx0 = GRADIENTS_2_D[gi0], gy0 = GRADIENTS_2_D[gi0 | 1]; + double rampValue0 = gx0 * x0 + gy0 * y0; + out[0] = aaaa0 * rampValue0; + out[1] = gx0 * aaaa0 - 8 * rampValue0 * aaa0 * x0; + out[2] = gy0 * aaaa0 - 8 * rampValue0 * aaa0 * y0; + + + double a1 = 2 * (1 - 2 * G2) * (1 / G2 - 2) * t + ((-2 * (1 - 2 * G2) * (1 - 2 * G2)) + a0); + double x1 = x0 - (1 - 2 * G2); + double y1 = y0 - (1 - 2 * G2); + double aa1 = a1 * a1, aaa1 = aa1 * a1, aaaa1 = aa1 * aa1; + int gi1 = gradCoordIndex(seed, i1, j1); + double gx1 = GRADIENTS_2_D[gi1], gy1 = GRADIENTS_2_D[gi1 | 1]; + double rampValue1 = gx1 * x1 + gy1 * y1; + out[0] += aaaa1 * rampValue1; + out[1] += gx1 * aaaa1 - 8 * rampValue1 * aaa1 * x1; + out[2] += gy1 * aaaa1 - 8 * rampValue1 * aaa1 * y1; + + // Nested conditionals were faster than compact bit logic/arithmetic. + double xmyi = xi - yi; + if(t > G2) { + if(xi + xmyi > 1) { + double x2 = x0 + (3 * G2 - 2); + double y2 = y0 + (3 * G2 - 1); + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i + (PRIME_X << 1), j + PRIME_Y); + double gx2 = GRADIENTS_2_D[gi2 | 0], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; } - out[0] *= 18.24196194486065; - out[1] *= 18.24196194486065; - out[2] *= 18.24196194486065; - return out; + } else { + double x2 = x0 + G2; + double y2 = y0 + (G2 - 1); + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i, j + PRIME_Y); + double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; + } + } + + if(yi - xmyi > 1) { + double x3 = x0 + (3 * G2 - 1); + double y3 = y0 + (3 * G2 - 2); + double a3 = (2.0 / 3.0) - x3 * x3 - y3 * y3; + if(a3 > 0) { + double aa3 = a3 * a3, aaa3 = aa3 * a3, aaaa3 = aa3 * aa3; + int gi3 = gradCoordIndex(seed, i + PRIME_X, j + (PRIME_Y << 1)); + double gx3 = GRADIENTS_2_D[gi3], gy3 = GRADIENTS_2_D[gi3 | 1]; + double rampValue3 = gx3 * x3 + gy3 * y3; + out[0] += aaaa3 * rampValue3; + out[1] += gx3 * aaaa3 - 8 * rampValue3 * aaa3 * x3; + out[2] += gy3 * aaaa3 - 8 * rampValue3 * aaa3 * y3; + } + } else { + double x3 = x0 + (G2 - 1); + double y3 = y0 + G2; + double a3 = (2.0 / 3.0) - x3 * x3 - y3 * y3; + if(a3 > 0) { + double aa3 = a3 * a3, aaa3 = aa3 * a3, aaaa3 = aa3 * aa3; + int gi3 = gradCoordIndex(seed, i + PRIME_X, j); + double gx3 = GRADIENTS_2_D[gi3], gy3 = GRADIENTS_2_D[gi3 | 1]; + double rampValue3 = gx3 * x3 + gy3 * y3; + out[0] += aaaa3 * rampValue3; + out[1] += gx3 * aaaa3 - 8 * rampValue3 * aaa3 * x3; + out[2] += gy3 * aaaa3 - 8 * rampValue3 * aaa3 * y3; + } + } + } else { + if(xi + xmyi < 0) { + double x2 = x0 + (1 - G2); + double y2 = y0 - G2; + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i - PRIME_X, j); + double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; + } + } else { + double x2 = x0 + (G2 - 1); + double y2 = y0 + G2; + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i + PRIME_X, j); + double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; + } + } + + if(yi < xmyi) { + double x2 = x0 - G2; + double y2 = y0 - (G2 - 1); + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i, j - PRIME_Y); + double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; + } + } else { + double x2 = x0 + G2; + double y2 = y0 + (G2 - 1); + double a2 = (2.0 / 3.0) - x2 * x2 - y2 * y2; + if(a2 > 0) { + double aa2 = a2 * a2, aaa2 = aa2 * a2, aaaa2 = aa2 * aa2; + int gi2 = gradCoordIndex(seed, i, j + PRIME_Y); + double gx2 = GRADIENTS_2_D[gi2], gy2 = GRADIENTS_2_D[gi2 | 1]; + double rampValue2 = gx2 * x2 + gy2 * y2; + out[0] += aaaa2 * rampValue2; + out[1] += gx2 * aaaa2 - 8 * rampValue2 * aaa2 * x2; + out[2] += gy2 * aaaa2 - 8 * rampValue2 * aaa2 * y2; + } + } + } + out[0] *= 18.24196194486065; + out[1] *= 18.24196194486065; + out[2] *= 18.24196194486065; + return out; } @Override diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java index 443146a9b..862a665c8 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java @@ -206,7 +206,8 @@ public double[] getNoiseDerivativeRaw(long sl, double x, double y) { double rampValue = gx * x2 + gy * y2; out[0] += cccc * rampValue; out[1] += gx * cccc - 8 * rampValue * ccc * x2; - out[2] += gy * cccc - 8 * rampValue * ccc * y2; } + out[2] += gy * cccc - 8 * rampValue * ccc * y2; + } if(y0 > x0) { double x1 = x0 + G2; @@ -219,7 +220,8 @@ public double[] getNoiseDerivativeRaw(long sl, double x, double y) { double rampValue = gx * x1 + gy * y1; out[0] += bbbb * rampValue; out[1] += gx * bbbb - 8 * rampValue * bbb * x1; - out[2] += gy * bbbb - 8 * rampValue * bbb * y1; } + out[2] += gy * bbbb - 8 * rampValue * bbb * y1; + } } else { double x1 = x0 + (G2 - 1); double y1 = y0 + G2; @@ -231,7 +233,8 @@ public double[] getNoiseDerivativeRaw(long sl, double x, double y) { double rampValue = gx * x1 + gy * y1; out[0] += bbbb * rampValue; out[1] += gx * bbbb - 8 * rampValue * bbb * x1; - out[2] += gy * bbbb - 8 * rampValue * bbb * y1; } + out[2] += gy * bbbb - 8 * rampValue * bbb * y1; + } } out[0] *= 99.83685446303647f; @@ -242,114 +245,116 @@ public double[] getNoiseDerivativeRaw(long sl, double x, double y) { @Override public double[] getNoiseDerivativeRaw(long sl, double x, double y, double z) { - int seed = (int) sl; - // 3D OpenSimplex2Sampler case uses two offset rotated cube grids. - final double R3 = (2.0 / 3.0); - double r = (x + y + z) * R3; // Rotation, not skew - x = r - x; - y = r - y; - z = r - z; - - - int i = (int) Math.round(x); - int j = (int) Math.round(y); - int k = (int) Math.round(z); - double x0 = x - i; - double y0 = y - j; - double z0 = z - k; - - int xNSign = (int) (-1.0 - x0) | 1; - int yNSign = (int) (-1.0 - y0) | 1; - int zNSign = (int) (-1.0 - z0) | 1; - - double ax0 = xNSign * -x0; - double ay0 = yNSign * -y0; - double az0 = zNSign * -z0; - - i *= PRIME_X; - j *= PRIME_Y; - k *= PRIME_Z; - - double[] out = { 0.0f, 0.0f, 0.0f, 0.0f }; - double a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); - - for(int l = 0; ; l++) { - if(a > 0) { - double aa = a * a, aaa = aa * a, aaaa = aa * aa; - int gi = gradCoordIndex(seed, i, j, k); + int seed = (int) sl; + // 3D OpenSimplex2Sampler case uses two offset rotated cube grids. + final double R3 = (2.0 / 3.0); + double r = (x + y + z) * R3; // Rotation, not skew + x = r - x; + y = r - y; + z = r - z; + + + int i = (int) Math.round(x); + int j = (int) Math.round(y); + int k = (int) Math.round(z); + double x0 = x - i; + double y0 = y - j; + double z0 = z - k; + + int xNSign = (int) (-1.0 - x0) | 1; + int yNSign = (int) (-1.0 - y0) | 1; + int zNSign = (int) (-1.0 - z0) | 1; + + double ax0 = xNSign * -x0; + double ay0 = yNSign * -y0; + double az0 = zNSign * -z0; + + i *= PRIME_X; + j *= PRIME_Y; + k *= PRIME_Z; + + double[] out = { 0.0f, 0.0f, 0.0f, 0.0f }; + double a = (0.6f - x0 * x0) - (y0 * y0 + z0 * z0); + + for(int l = 0; ; l++) { + if(a > 0) { + double aa = a * a, aaa = aa * a, aaaa = aa * aa; + int gi = gradCoordIndex(seed, i, j, k); + double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; + double rampValue = gx * x0 + gy * y0 + gz * z0; + out[0] += aaaa * rampValue; + out[1] += gx * aaaa - 8 * rampValue * aaa * x0; + out[1] += gy * aaaa - 8 * rampValue * aaa * y0; + out[2] += gz * aaaa - 8 * rampValue * aaa * z0; + } + + if(ax0 >= ay0 && ax0 >= az0) { + double b = a + ax0 + ax0; + if(b > 1) { + b -= 1; + double bb = b * b, bbb = bb * b, bbbb = bb * bb; + int gi = gradCoordIndex(seed, i - xNSign * PRIME_X, j, k); double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; - double rampValue = gx * x0 + gy * y0 + gz * z0; - out[0] += aaaa * rampValue; - out[1] += gx * aaaa - 8 * rampValue * aaa * x0; - out[1] += gy * aaaa - 8 * rampValue * aaa * y0; - out[2] += gz * aaaa - 8 * rampValue * aaa * z0; + double rampValue = gx * (x0 + xNSign) + gy * y0 + gz * z0; + out[0] += bbbb * rampValue; + out[1] += gx * bbbb - 8 * rampValue * bbb * (x0 + xNSign); + out[1] += gy * bbbb - 8 * rampValue * bbb * y0; + out[2] += gz * bbbb - 8 * rampValue * bbb * z0; } - - if(ax0 >= ay0 && ax0 >= az0) { - double b = a + ax0 + ax0; - if(b > 1) { - b -= 1; - double bb = b * b, bbb = bb * b, bbbb = bb * bb; - int gi = gradCoordIndex(seed, i - xNSign * PRIME_X, j, k); - double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; - double rampValue = gx * (x0 + xNSign) + gy * y0 + gz * z0; - out[0] += bbbb * rampValue; - out[1] += gx * bbbb - 8 * rampValue * bbb * (x0 + xNSign); - out[1] += gy * bbbb - 8 * rampValue * bbb * y0; - out[2] += gz * bbbb - 8 * rampValue * bbb * z0; - } - } else if(ay0 > ax0 && ay0 >= az0) { - double b = a + ay0 + ay0; - if(b > 1) { - b -= 1; - double bb = b * b, bbb = bb * b, bbbb = bb * bb; - int gi = gradCoordIndex(seed, i, j - yNSign * PRIME_Y, k); - double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; - double rampValue = gx * x0 + gy * (y0 + yNSign) + gz * z0; - out[0] += bbbb * rampValue; - out[1] += gx * bbbb - 8 * rampValue * bbb * x0; - out[1] += gy * bbbb - 8 * rampValue * bbb * (y0 + yNSign); - out[2] += gz * bbbb - 8 * rampValue * bbb * z0; } - } else { - double b = a + az0 + az0; - if(b > 1) { - b -= 1; - double bb = b * b, bbb = bb * b, bbbb = bb * bb; - int gi = gradCoordIndex(seed, i, j, k - zNSign * PRIME_Z); - double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; - double rampValue = gx * x0 + gy * y0 + gz * (z0 + zNSign); - out[0] += bbbb * rampValue; - out[1] += gx * bbbb - 8 * rampValue * bbb * x0; - out[1] += gy * bbbb - 8 * rampValue * bbb * y0; - out[2] += gz * bbbb - 8 * rampValue * bbb * (z0 + zNSign); } + } else if(ay0 > ax0 && ay0 >= az0) { + double b = a + ay0 + ay0; + if(b > 1) { + b -= 1; + double bb = b * b, bbb = bb * b, bbbb = bb * bb; + int gi = gradCoordIndex(seed, i, j - yNSign * PRIME_Y, k); + double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; + double rampValue = gx * x0 + gy * (y0 + yNSign) + gz * z0; + out[0] += bbbb * rampValue; + out[1] += gx * bbbb - 8 * rampValue * bbb * x0; + out[1] += gy * bbbb - 8 * rampValue * bbb * (y0 + yNSign); + out[2] += gz * bbbb - 8 * rampValue * bbb * z0; } + } else { + double b = a + az0 + az0; + if(b > 1) { + b -= 1; + double bb = b * b, bbb = bb * b, bbbb = bb * bb; + int gi = gradCoordIndex(seed, i, j, k - zNSign * PRIME_Z); + double gx = GRADIENTS_3D[gi], gy = GRADIENTS_3D[gi | 1], gz = GRADIENTS_3D[gi | 2]; + double rampValue = gx * x0 + gy * y0 + gz * (z0 + zNSign); + out[0] += bbbb * rampValue; + out[1] += gx * bbbb - 8 * rampValue * bbb * x0; + out[1] += gy * bbbb - 8 * rampValue * bbb * y0; + out[2] += gz * bbbb - 8 * rampValue * bbb * (z0 + zNSign); + } + } - if(l == 1) break; + if(l == 1) break; - ax0 = 0.5 - ax0; - ay0 = 0.5 - ay0; - az0 = 0.5 - az0; + ax0 = 0.5 - ax0; + ay0 = 0.5 - ay0; + az0 = 0.5 - az0; - x0 = xNSign * ax0; - y0 = yNSign * ay0; - z0 = zNSign * az0; + x0 = xNSign * ax0; + y0 = yNSign * ay0; + z0 = zNSign * az0; - a += (0.75 - ax0) - (ay0 + az0); + a += (0.75 - ax0) - (ay0 + az0); - i += (xNSign >> 1) & PRIME_X; - j += (yNSign >> 1) & PRIME_Y; - k += (zNSign >> 1) & PRIME_Z; + i += (xNSign >> 1) & PRIME_X; + j += (yNSign >> 1) & PRIME_Y; + k += (zNSign >> 1) & PRIME_Z; - xNSign = -xNSign; - yNSign = -yNSign; - zNSign = -zNSign; + xNSign = -xNSign; + yNSign = -yNSign; + zNSign = -zNSign; - seed = ~seed; - } - out[0] *= 32.69428253173828125; - out[1] *= 32.69428253173828125; - out[2] *= 32.69428253173828125; - out[3] *= 32.69428253173828125; - return out; + seed = ~seed; } + out[0] *= 32.69428253173828125; + out[1] *= 32.69428253173828125; + out[2] *= 32.69428253173828125; + out[3] *= 32.69428253173828125; + return out; + } } diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/SimplexStyleSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/SimplexStyleSampler.java index a5fd3f3bf..f9c3f65a7 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/SimplexStyleSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/SimplexStyleSampler.java @@ -8,7 +8,6 @@ package com.dfsek.terra.addons.noise.samplers.noise.simplex; import com.dfsek.terra.addons.noise.samplers.noise.DerivativeNoiseFunction; -import com.dfsek.terra.addons.noise.samplers.noise.NoiseFunction; /** @@ -117,12 +116,12 @@ protected static double gradCoord(int seed, int xPrimed, int yPrimed, int zPrime @Override public double[] getNoiseDerivativeRaw(long seed, double x, double y) { - return new double[]{0, 0, 0}; + return new double[]{ 0, 0, 0 }; } @Override public double[] getNoiseDerivativeRaw(long seed, double x, double y, double z) { - return new double[]{0, 0, 0, 0}; + return new double[]{ 0, 0, 0, 0 }; } @Override diff --git a/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationAddon.java b/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationAddon.java index 41009ed0b..f1ca7d945 100644 --- a/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationAddon.java +++ b/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationAddon.java @@ -11,13 +11,6 @@ import com.dfsek.tectonic.api.config.template.dynamic.DynamicValue; import com.dfsek.tectonic.api.config.template.object.ObjectTemplate; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Supplier; - import com.dfsek.terra.addons.generation.feature.config.BiomeFeatures; import com.dfsek.terra.addons.generation.feature.config.FeatureStageTemplate; import com.dfsek.terra.addons.manifest.api.AddonInitializer; @@ -35,6 +28,9 @@ import com.dfsek.terra.api.world.biome.Biome; import com.dfsek.terra.api.world.chunk.generation.stage.GenerationStage; +import java.util.*; +import java.util.function.Supplier; + public class FeatureGenerationAddon implements AddonInitializer { public static final TypeKey>> STAGE_TYPE_KEY = new TypeKey<>() { diff --git a/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java b/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java index 11a1e3ca7..132889d23 100644 --- a/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java +++ b/common/addons/generation-stage-feature/src/main/java/com/dfsek/terra/addons/generation/feature/FeatureGenerationStage.java @@ -7,9 +7,6 @@ package com.dfsek.terra.addons.generation.feature; -import java.util.Collections; -import java.util.Random; - import com.dfsek.terra.addons.generation.feature.config.BiomeFeatures; import com.dfsek.terra.api.Platform; import com.dfsek.terra.api.noise.NoiseSampler; @@ -22,6 +19,9 @@ import com.dfsek.terra.api.world.chunk.generation.stage.GenerationStage; import com.dfsek.terra.api.world.chunk.generation.util.Column; +import java.util.Collections; +import java.util.Random; + public class FeatureGenerationStage implements GenerationStage, StringIdentifiable { private final Platform platform; diff --git a/common/addons/structure-mutator/src/main/java/com/dfsek/terra/addons/structure/mutator/MutatedStructure.java b/common/addons/structure-mutator/src/main/java/com/dfsek/terra/addons/structure/mutator/MutatedStructure.java index 30b2d5984..5b18dd063 100644 --- a/common/addons/structure-mutator/src/main/java/com/dfsek/terra/addons/structure/mutator/MutatedStructure.java +++ b/common/addons/structure-mutator/src/main/java/com/dfsek/terra/addons/structure/mutator/MutatedStructure.java @@ -1,7 +1,5 @@ package com.dfsek.terra.addons.structure.mutator; -import java.util.Random; - import com.dfsek.terra.api.registry.key.Keyed; import com.dfsek.terra.api.registry.key.RegistryKey; import com.dfsek.terra.api.structure.Structure; @@ -11,6 +9,8 @@ import com.dfsek.terra.api.world.util.ReadInterceptor; import com.dfsek.terra.api.world.util.WriteInterceptor; +import java.util.Random; + public class MutatedStructure implements Structure, Keyed { private final RegistryKey key; diff --git a/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/ParserUtil.java b/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/ParserUtil.java index b982b0979..4fc805a8f 100644 --- a/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/ParserUtil.java +++ b/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/parser/ParserUtil.java @@ -7,15 +7,15 @@ package com.dfsek.terra.addons.terrascript.parser; -import com.dfsek.terra.addons.terrascript.parser.exceptions.ParseException; -import com.dfsek.terra.addons.terrascript.parser.lang.Returnable; -import com.dfsek.terra.addons.terrascript.tokenizer.Token; - import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import com.dfsek.terra.addons.terrascript.parser.exceptions.ParseException; +import com.dfsek.terra.addons.terrascript.parser.lang.Returnable; +import com.dfsek.terra.addons.terrascript.tokenizer.Token; + public class ParserUtil { diff --git a/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/script/builders/CheckBlockFunctionBuilder.java b/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/script/builders/CheckBlockFunctionBuilder.java index 588b99f53..cfef3f572 100644 --- a/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/script/builders/CheckBlockFunctionBuilder.java +++ b/common/addons/structure-terrascript-loader/src/main/java/com/dfsek/terra/addons/terrascript/script/builders/CheckBlockFunctionBuilder.java @@ -7,13 +7,13 @@ package com.dfsek.terra.addons.terrascript.script.builders; -import java.util.List; - import com.dfsek.terra.addons.terrascript.parser.lang.Returnable; import com.dfsek.terra.addons.terrascript.parser.lang.functions.FunctionBuilder; import com.dfsek.terra.addons.terrascript.script.functions.CheckBlockFunction; import com.dfsek.terra.addons.terrascript.tokenizer.Position; +import java.util.List; + public class CheckBlockFunctionBuilder implements FunctionBuilder { @SuppressWarnings("unchecked") diff --git a/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java b/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java index 0e178130b..f9e40f0ea 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java +++ b/common/api/src/main/java/com/dfsek/terra/api/noise/DerivativeNoiseSampler.java @@ -6,7 +6,7 @@ public interface DerivativeNoiseSampler extends NoiseSampler { static boolean isDifferentiable(NoiseSampler sampler) { - if (sampler instanceof DerivativeNoiseSampler dSampler) { + if(sampler instanceof DerivativeNoiseSampler dSampler) { return dSampler.isDifferentiable(); } return false; @@ -22,19 +22,23 @@ static boolean isDifferentiable(NoiseSampler sampler) { /** * Derivative return version of standard 2D noise evaluation + * * @param seed * @param x * @param y + * * @return 3 element array, in index order: noise value, partial x derivative, partial y derivative */ double[] noised(long seed, double x, double y); /** * Derivative return version of standard 3D noise evaluation + * * @param seed * @param x * @param y * @param z + * * @return 4 element array, in index order: noise value, partial x derivative, partial y derivative, partial z derivative */ double[] noised(long seed, double x, double y, double z); diff --git a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java index 0dbe5bb23..d12f31c47 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java +++ b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java @@ -29,7 +29,7 @@ public final class MathUtil { static { sinTable = new long[lookupTableSizeWithMargin]; - for (int i = 0; i < lookupTableSizeWithMargin; i++) { + for(int i = 0; i < lookupTableSizeWithMargin; i++) { double d = i * tauOverLookupSize; sinTable[i] = Double.doubleToRawLongBits(StrictMath.sin(d)); } diff --git a/common/api/src/main/java/com/dfsek/terra/api/world/biome/generation/BiomeProvider.java b/common/api/src/main/java/com/dfsek/terra/api/world/biome/generation/BiomeProvider.java index d049cd43b..3aed2b9ac 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/world/biome/generation/BiomeProvider.java +++ b/common/api/src/main/java/com/dfsek/terra/api/world/biome/generation/BiomeProvider.java @@ -7,18 +7,18 @@ package com.dfsek.terra.api.world.biome.generation; -import org.jetbrains.annotations.Contract; - -import java.util.Optional; -import java.util.stream.Stream; -import java.util.stream.StreamSupport; - import com.dfsek.terra.api.util.Column; import com.dfsek.terra.api.util.vector.Vector3; import com.dfsek.terra.api.util.vector.Vector3Int; import com.dfsek.terra.api.world.biome.Biome; import com.dfsek.terra.api.world.info.WorldProperties; +import org.jetbrains.annotations.Contract; + +import java.util.Optional; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + /** * Provides locations of biomes in a world. diff --git a/common/implementation/base/src/main/java/com/dfsek/terra/config/preprocessor/MetaNumberPreprocessor.java b/common/implementation/base/src/main/java/com/dfsek/terra/config/preprocessor/MetaNumberPreprocessor.java index 9197adeb1..c823d7ec4 100644 --- a/common/implementation/base/src/main/java/com/dfsek/terra/config/preprocessor/MetaNumberPreprocessor.java +++ b/common/implementation/base/src/main/java/com/dfsek/terra/config/preprocessor/MetaNumberPreprocessor.java @@ -24,14 +24,15 @@ import com.dfsek.tectonic.api.exception.LoadException; import com.dfsek.tectonic.api.loader.ConfigLoader; import com.dfsek.tectonic.api.preprocessor.Result; + +import com.dfsek.terra.api.config.meta.Meta; +import com.dfsek.terra.api.util.reflection.TypeKey; + import org.jetbrains.annotations.NotNull; import java.lang.reflect.AnnotatedType; import java.util.Map; -import com.dfsek.terra.api.config.meta.Meta; -import com.dfsek.terra.api.util.reflection.TypeKey; - public class MetaNumberPreprocessor extends MetaPreprocessor { public static final TypeKey META_STRING_KEY = new TypeKey<@Meta String>() { diff --git a/common/implementation/base/src/main/java/com/dfsek/terra/event/FunctionalEventHandlerImpl.java b/common/implementation/base/src/main/java/com/dfsek/terra/event/FunctionalEventHandlerImpl.java index a35bf9366..67f984646 100644 --- a/common/implementation/base/src/main/java/com/dfsek/terra/event/FunctionalEventHandlerImpl.java +++ b/common/implementation/base/src/main/java/com/dfsek/terra/event/FunctionalEventHandlerImpl.java @@ -17,6 +17,17 @@ package com.dfsek.terra.event; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import com.dfsek.terra.api.addon.BaseAddon; import com.dfsek.terra.api.event.events.Event; import com.dfsek.terra.api.event.events.FailThroughEvent; @@ -25,12 +36,6 @@ import com.dfsek.terra.api.event.functional.FunctionalEventHandler; import com.dfsek.terra.api.util.reflection.TypeKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.Type; -import java.util.*; - public class FunctionalEventHandlerImpl implements FunctionalEventHandler { private static final Logger logger = LoggerFactory.getLogger(FunctionalEventHandlerImpl.class); diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/BukkitEntity.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/BukkitEntity.java index 98f44e2ec..6df268180 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/BukkitEntity.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/BukkitEntity.java @@ -17,14 +17,14 @@ package com.dfsek.terra.bukkit; +import io.papermc.lib.PaperLib; +import org.bukkit.Location; + import com.dfsek.terra.api.entity.Entity; import com.dfsek.terra.api.util.vector.Vector3; import com.dfsek.terra.api.world.ServerWorld; import com.dfsek.terra.bukkit.world.BukkitAdapter; -import io.papermc.lib.PaperLib; -import org.bukkit.Location; - public class BukkitEntity implements Entity { private final org.bukkit.entity.Entity entity; diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/BukkitWorldProperties.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/BukkitWorldProperties.java index f9763df90..7ece9ac7b 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/BukkitWorldProperties.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/BukkitWorldProperties.java @@ -1,9 +1,9 @@ package com.dfsek.terra.bukkit.world; -import org.bukkit.generator.WorldInfo; - import com.dfsek.terra.api.world.info.WorldProperties; +import org.bukkit.generator.WorldInfo; + public class BukkitWorldProperties implements WorldProperties { private final WorldInfo delegate; diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java index 0cbfa77b4..48dc88249 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/LifecycleEntryPoint.java @@ -1,5 +1,8 @@ package com.dfsek.terra.lifecycle; +import com.dfsek.terra.api.command.CommandSender; +import com.dfsek.terra.api.event.events.platform.CommandRegistrationEvent; + import net.minecraft.server.command.ServerCommandSource; import org.incendo.cloud.SenderMapper; import org.incendo.cloud.execution.ExecutionCoordinator; @@ -7,9 +10,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.dfsek.terra.api.command.CommandSender; -import com.dfsek.terra.api.event.events.platform.CommandRegistrationEvent; - public final class LifecycleEntryPoint { private static final Logger logger = LoggerFactory.getLogger(LifecycleEntryPoint.class); diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/MinecraftServerMixin.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/MinecraftServerMixin.java index 63a8b8170..0f04c0963 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/MinecraftServerMixin.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/mixin/lifecycle/MinecraftServerMixin.java @@ -18,6 +18,7 @@ import static com.dfsek.terra.lifecycle.util.LifecycleUtil.initialized; + @Mixin(MinecraftServer.class) public class MinecraftServerMixin { @Inject(method = "(Ljava/lang/Thread;Lnet/minecraft/world/level/storage/LevelStorage$Session;" + diff --git a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/LifecycleUtil.java b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/LifecycleUtil.java index 28346a6eb..9ba81f864 100644 --- a/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/LifecycleUtil.java +++ b/platforms/mixin-lifecycle/src/main/java/com/dfsek/terra/lifecycle/util/LifecycleUtil.java @@ -13,6 +13,7 @@ public final class LifecycleUtil { public static boolean initialized = false; + private LifecycleUtil() { } From 42166d5239ad9d6d6fe0906b54bd8837fd333b14 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 20:59:02 -0600 Subject: [PATCH 109/126] bump version number --- common/addons/config-noise-function/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/addons/config-noise-function/build.gradle.kts b/common/addons/config-noise-function/build.gradle.kts index af2284b48..83d927a01 100644 --- a/common/addons/config-noise-function/build.gradle.kts +++ b/common/addons/config-noise-function/build.gradle.kts @@ -1,4 +1,4 @@ -version = version("1.1.0") +version = version("1.2.0") dependencies { compileOnlyApi(project(":common:addons:manifest-addon-loader")) From d69b0dba90000408a1f7d5d548f3bbd5a68dbdf8 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 21:06:07 -0600 Subject: [PATCH 110/126] reformat 2 --- .../noise/PseudoErosionTemplate.java | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java index 03f2252e1..4e2823271 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java @@ -9,48 +9,61 @@ public class PseudoErosionTemplate extends NoiseTemplate { - @Value("frequency") @Default protected @Meta double frequency = 1d; + @Value("octaves") @Default - private int octaves = 4; + private final int octaves = 4; + @Value("lacunarity") @Default - private double lacunarity = 2.0; + private final double lacunarity = 2.0; + @Value("gain") @Default - private double gain = 0.5; + private final double gain = 0.5; + @Value("slope-strength") @Default - private double slopeStrength = 1.0; + private final double slopeStrength = 1.0; + + @Value("branch-strength") @Default - private double branchStrength = 1.0; + private final double branchStrength = 1.0; + @Value("strength") @Default - private double strength = 0.04; + private final double strength = 0.04; + @Value("erosion-frequency") @Default - private double erosionFrequency = 0.02; + private final double erosionFrequency = 0.02; + @Value("sampler") private DerivativeNoiseSampler heightSampler; + @Value("slope-mask.enable") @Default - private boolean slopeMask = true; + private final boolean slopeMask = true; + @Value("slope-mask.none") @Default - private double slopeMaskNone = -0.5; + private final double slopeMaskNone = -0.5; + @Value("slope-mask.full") @Default - private double slopeMaskFull = 1; + private final double slopeMaskFull = 1; + @Value("jitter") @Default - private double jitterModifier = 1; + private final double jitterModifier = 1; + @Value("average-impulses") @Default - private boolean averageErosionImpulses = true; + private final boolean averageErosionImpulses = true; @Override public PseudoErosionSampler get() { From 9c8298fe530d09b8ad2da12dfbe704804e00edd2 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 21:09:19 -0600 Subject: [PATCH 111/126] convert pseudoerosion to double --- .../samplers/noise/PseudoErosionSampler.java | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java index c761d2e80..ecb566ca7 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/PseudoErosionSampler.java @@ -6,9 +6,9 @@ public class PseudoErosionSampler extends NoiseFunction { - public static final float TAU = (float) (2.0 * Math.PI); - private static final float HASH_X = 0.3183099f; - private static final float HASH_Y = 0.3678794f; + public static final double TAU = 2.0 * Math.PI; + private static final double HASH_X = 0.3183099f; + private static final double HASH_Y = 0.3678794f; public final double gain; public final double lacunarity; public final double slopeStrength; @@ -48,59 +48,59 @@ public PseudoErosionSampler(int octaves, double gain, double lacunarity, double this.maxCellDistSqRecip = 1 / maxCellDistSq; } - public static float hashX(float seed, float n) { + public static double hashX(double seed, double n) { // Swapped the components here - float nx = HASH_X * n * seed; + double nx = HASH_X * n * seed; return -1.0f + 2.0f * fract(nx); } - public static float hashY(float seed, float n) { - float ny = HASH_Y * n * seed; + public static double hashY(double seed, double n) { + double ny = HASH_Y * n * seed; return -1.0f + 2.0f * fract(ny); } - public static float fract(float x) { - return (x - (float) Math.floor(x)); + public static double fract(double x) { + return (x - Math.floor(x)); } - public static float smoothstep(float edge0, float edge1, float x) { + public static double smoothstep(double edge0, double edge1, double x) { // Scale, bias and saturate x to 0..1 range x = clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f); // Evaluate polynomial return x * x * (3 - 2 * x); } - public static float clamp(float x, float minVal, float maxVal) { + public static double clamp(double x, double minVal, double maxVal) { return Math.max(minVal, Math.min(maxVal, x)); } - public static float dot(float x1, float y1, float x2, float y2) { + public static double dot(double x1, double y1, double x2, double y2) { return x1 * x2 + y1 * y2; } - public float[] erosion(int seed, float x, float y, float dirX, float dirY) { - int gridX = Math.round(x); - int gridY = Math.round(y); - float noise = 0.0f; - float dirOutX = 0.0f; - float dirOutY = 0.0f; - float cumAmp = 0.0f; + public double[] erosion(int seed, double x, double y, double dirX, double dirY) { + int gridX = (int) Math.round(x); + int gridY = (int) Math.round(y); + double noise = 0.0f; + double dirOutX = 0.0f; + double dirOutY = 0.0f; + double cumAmp = 0.0f; for(int cellX = gridX - 1; cellX <= gridX + 1; cellX++) { for(int cellY = gridY - 1; cellY <= gridY + 1; cellY++) { - float cellHash = hash(seed, cellX, cellY); - float cellOffsetX = (float) (hashX(seed, cellHash) * jitter); - float cellOffsetY = (float) (hashY(seed, cellHash) * jitter); - float cellOriginDeltaX = (x - cellX) + cellOffsetX; - float cellOriginDeltaY = (y - cellY) + cellOffsetY; - float cellOriginDistSq = cellOriginDeltaX * cellOriginDeltaX + cellOriginDeltaY * cellOriginDeltaY; + double cellHash = hash(seed, cellX, cellY); + double cellOffsetX = hashX(seed, cellHash) * jitter; + double cellOffsetY = hashY(seed, cellHash) * jitter; + double cellOriginDeltaX = (x - cellX) + cellOffsetX; + double cellOriginDeltaY = (y - cellY) + cellOffsetY; + double cellOriginDistSq = cellOriginDeltaX * cellOriginDeltaX + cellOriginDeltaY * cellOriginDeltaY; if(cellOriginDistSq > maxCellDistSq) continue; // Skip calculating cells too far away - float ampTmp = (float) ((cellOriginDistSq * maxCellDistSqRecip) - 1); - float amp = ampTmp * ampTmp; // Decrease cell amplitude further away + double ampTmp = (cellOriginDistSq * maxCellDistSqRecip) - 1; + double amp = ampTmp * ampTmp; // Decrease cell amplitude further away cumAmp += amp; - float directionalStrength = dot(cellOriginDeltaX, cellOriginDeltaY, dirX, dirY) * TAU; - noise += (float) (MathUtil.cos(directionalStrength) * amp); - float sinAngle = (float) MathUtil.sin(directionalStrength) * amp; + double directionalStrength = dot(cellOriginDeltaX, cellOriginDeltaY, dirX, dirY) * TAU; + noise += MathUtil.cos(directionalStrength) * amp; + double sinAngle = MathUtil.sin(directionalStrength) * amp; dirOutX -= sinAngle * (cellOriginDeltaX + dirX); dirOutY -= sinAngle * (cellOriginDeltaY + dirY); } @@ -110,33 +110,33 @@ public float[] erosion(int seed, float x, float y, float dirX, float dirY) { dirOutX /= cumAmp; dirOutY /= cumAmp; } - return new float[]{ noise, dirOutX, dirOutY }; + return new double[]{ noise, dirOutX, dirOutY }; } - public float heightMap(long seed, float x, float y) { + public double heightMap(long seed, double x, double y) { double[] sample = sampler.noised(seed, x, y); - float height = (float) sample[0]; - float heightDirX = (float) sample[1]; - float heightDirY = (float) sample[2]; + double height = sample[0]; + double heightDirX = sample[1]; + double heightDirY = sample[2]; // Take the curl of the normal to get the gradient facing down the slope - float baseDirX = heightDirY * (float) slopeStrength; - float baseDirY = -heightDirX * (float) slopeStrength; + double baseDirX = heightDirY * slopeStrength; + double baseDirY = -heightDirX * slopeStrength; - float erosion = 0.0f; - float dirX = 0.0f; - float dirY = 0.0f; - float amp = 1.0f; - float cumAmp = 0.0f; - float freq = 1.0f; + double erosion = 0.0f; + double dirX = 0.0f; + double dirY = 0.0f; + double amp = 1.0f; + double cumAmp = 0.0f; + double freq = 1.0f; // Stack erosion octaves for(int i = 0; i < octaves; i++) { - float[] erosionResult = erosion((int) seed, - x * freq * (float) erosionFrequency, - y * freq * (float) erosionFrequency, - baseDirX + dirY * (float) branchStrength, - baseDirY - dirX * (float) branchStrength); + double[] erosionResult = erosion((int) seed, + x * freq * erosionFrequency, + y * freq * erosionFrequency, + baseDirX + dirY * branchStrength, + baseDirY - dirX * branchStrength); erosion += erosionResult[0] * amp; dirX += erosionResult[1] * amp * freq; dirY += erosionResult[2] * amp * freq; @@ -153,17 +153,17 @@ public float heightMap(long seed, float x, float y) { // Without masking, erosion noise in areas with small gradients tend to produce mounds, // this reduces erosion amplitude towards smaller gradients to avoid this if(slopeMask) { - float dirMagSq = dot(baseDirX, baseDirY, baseDirX, baseDirY); - float flatness = smoothstep((float) slopeMaskNoneSq, (float) slopeMaskFullSq, dirMagSq); + double dirMagSq = dot(baseDirX, baseDirY, baseDirX, baseDirY); + double flatness = smoothstep((double) slopeMaskNoneSq, slopeMaskFullSq, dirMagSq); erosion *= flatness; } - return (float) (height + erosion * erosionStrength); + return height + erosion * erosionStrength; } @Override public double getNoiseRaw(long seed, double x, double y) { - return heightMap(seed, (float) x, (float) y); + return heightMap(seed, x, y); } @Override From f1124aae6bcf1a5079674599cce6b53f9078dbeb Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 21:18:47 -0600 Subject: [PATCH 112/126] Update platform mod file versions and authors --- platforms/bukkit/common/src/main/resources/plugin.yml | 4 ++-- platforms/fabric/src/main/resources/fabric.mod.json | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/platforms/bukkit/common/src/main/resources/plugin.yml b/platforms/bukkit/common/src/main/resources/plugin.yml index e965d7dee..7c0ed151a 100644 --- a/platforms/bukkit/common/src/main/resources/plugin.yml +++ b/platforms/bukkit/common/src/main/resources/plugin.yml @@ -2,8 +2,8 @@ name: "Terra" main: "com.dfsek.terra.bukkit.TerraBukkitPlugin" version: "@VERSION@" load: "STARTUP" -author: dfsek +authors: ["dfsek", "duplexsystem", "Astrash", "solonovamax", "Sancires", "Aureus", "RogueShade"] website: "@WIKI@" -api-version: "1.20" +api-version: "1.21.1" description: "@DESCRIPTION@" folia-supported: true diff --git a/platforms/fabric/src/main/resources/fabric.mod.json b/platforms/fabric/src/main/resources/fabric.mod.json index bc5319452..592d4021a 100644 --- a/platforms/fabric/src/main/resources/fabric.mod.json +++ b/platforms/fabric/src/main/resources/fabric.mod.json @@ -5,7 +5,13 @@ "name": "Terra", "description": "@DESCRIPTION@", "authors": [ - "dfsek" + "dfsek", + "duplexsystem", + "Astrash", + "solonovamax", + "Sancires", + "Aureus", + "RogueShade" ], "contact": { "homepage": "@WIKI@", @@ -28,7 +34,7 @@ "depends": { "fabricloader": ">=0.16.5", "java": ">=21", - "minecraft": ">=1.20.6", + "minecraft": ">=1.21.1", "fabric": "*" } } \ No newline at end of file From f87b7c07d99f7ae1468890e36edfd559a1b8c6fb Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 22:27:53 -0600 Subject: [PATCH 113/126] Reformat --- platforms/bukkit/common/src/main/resources/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/bukkit/common/src/main/resources/plugin.yml b/platforms/bukkit/common/src/main/resources/plugin.yml index 7c0ed151a..782861cfe 100644 --- a/platforms/bukkit/common/src/main/resources/plugin.yml +++ b/platforms/bukkit/common/src/main/resources/plugin.yml @@ -2,7 +2,7 @@ name: "Terra" main: "com.dfsek.terra.bukkit.TerraBukkitPlugin" version: "@VERSION@" load: "STARTUP" -authors: ["dfsek", "duplexsystem", "Astrash", "solonovamax", "Sancires", "Aureus", "RogueShade"] +authors: [ "dfsek", "duplexsystem", "Astrash", "solonovamax", "Sancires", "Aureus", "RogueShade" ] website: "@WIKI@" api-version: "1.21.1" description: "@DESCRIPTION@" From f605ee1937f936617358732815776ad6561ec123 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 22:35:01 -0600 Subject: [PATCH 114/126] Remove Final from psuedoerosion template --- .../noise/PseudoErosionTemplate.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java index 4e2823271..f6d5706d8 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java @@ -15,55 +15,55 @@ public class PseudoErosionTemplate extends NoiseTemplate { @Value("octaves") @Default - private final int octaves = 4; + private int octaves = 4; @Value("lacunarity") @Default - private final double lacunarity = 2.0; + private double lacunarity = 2.0; @Value("gain") @Default - private final double gain = 0.5; + private double gain = 0.5; @Value("slope-strength") @Default - private final double slopeStrength = 1.0; + private double slopeStrength = 1.0; @Value("branch-strength") @Default - private final double branchStrength = 1.0; + private double branchStrength = 1.0; @Value("strength") @Default - private final double strength = 0.04; + private double strength = 0.04; @Value("erosion-frequency") @Default - private final double erosionFrequency = 0.02; + private double erosionFrequency = 0.02; @Value("sampler") private DerivativeNoiseSampler heightSampler; @Value("slope-mask.enable") @Default - private final boolean slopeMask = true; + private boolean slopeMask = true; @Value("slope-mask.none") @Default - private final double slopeMaskNone = -0.5; + private double slopeMaskNone = -0.5; @Value("slope-mask.full") @Default - private final double slopeMaskFull = 1; + private double slopeMaskFull = 1; @Value("jitter") @Default - private final double jitterModifier = 1; + private double jitterModifier = 1; @Value("average-impulses") @Default - private final boolean averageErosionImpulses = true; + private boolean averageErosionImpulses = true; @Override public PseudoErosionSampler get() { From 59d943b3eaaf95f91e33d3aa39b24bcef49b2ee5 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 22:38:17 -0600 Subject: [PATCH 115/126] Revert "Fix build" This reverts commit 10d723372daf14bc551159d050412c71c7f69a76. --- .../api/src/main/java/com/dfsek/terra/api/util/MathUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java index d12f31c47..6bf9b360d 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java +++ b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java @@ -23,8 +23,8 @@ public final class MathUtil { static final int lookupTableSize = 1 << lookupBits; private static final int lookupTableSizeWithMargin = lookupTableSize + 1; - private static final double tauOverLookupSize = Math.TAU / lookupTableSize; - static final double radianToIndex = (~(-1 << lookupBits) + 1) / Math.TAU; + private static final double tauOverLookupSize = TrigonometryConstants.TAU / lookupTableSize; + static final double radianToIndex = (~(-1 << lookupBits) + 1) / TrigonometryConstants.TAU; private static final long[] sinTable; static { From 6244ffca6368f94e4d8a73aab87794544edf4fb3 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 22:38:45 -0600 Subject: [PATCH 116/126] Revert "Sin/Cos Opts" This reverts commit 1d05f95f746639fdbc4c242d84aa4fcd93d666f4. --- .../com/dfsek/terra/api/util/MathUtil.java | 50 ++++++++----------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java index 6bf9b360d..2dd593b21 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java +++ b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java @@ -18,14 +18,22 @@ public final class MathUtil { * Epsilon for fuzzy floating point comparisons. */ public static final double EPSILON = 1.0E-5; - private static final int lookupBits = 14; + private static final int SIN_BITS, SIN_MASK, SIN_COUNT; + private static final double radFull, radToIndex; + private static final double degFull, degToIndex; + private static final double[] sin, cos; + static { + SIN_BITS = 12; + SIN_MASK = ~(-1 << SIN_BITS); + SIN_COUNT = SIN_MASK + 1; - static final int lookupTableSize = 1 << lookupBits; + radFull = Math.PI * 2.0; + degFull = 360.0; + radToIndex = SIN_COUNT / radFull; + degToIndex = SIN_COUNT / degFull; - private static final int lookupTableSizeWithMargin = lookupTableSize + 1; - private static final double tauOverLookupSize = TrigonometryConstants.TAU / lookupTableSize; - static final double radianToIndex = (~(-1 << lookupBits) + 1) / TrigonometryConstants.TAU; - private static final long[] sinTable; + sin = new double[SIN_COUNT]; + cos = new double[SIN_COUNT]; static { sinTable = new long[lookupTableSizeWithMargin]; @@ -33,36 +41,20 @@ public final class MathUtil { double d = i * tauOverLookupSize; sinTable[i] = Double.doubleToRawLongBits(StrictMath.sin(d)); } - } - - static double sinLookup(long index) { - // Trigonometric identity: sin(-x) = -sin(x) - // Given a domain of 0 <= x <= 2*pi, just negate the value if x > pi. - // This allows the sin table size to be halved. - long neg = (index & 0x8000000000000000L) << 32; - - // All bits set if (pi/2 <= x), none set otherwise - // Extracts the 31st bit from 'half' - long mask = (index << 33) >> 63; - // Trigonometric identity: sin(x) = sin(pi/2 - x) - long pos = (0x8000000000000001L & mask) + (index ^ mask); - - // Wrap the position in the table. Moving this down to immediately before the array access - // seems to help the Hotspot compiler optimize the bit math better. - pos &= 0x7fffffffffffffffL; - - // Fetch the corresponding value from the LUT and invert the sign bit as needed - // This directly manipulate the sign bit on the double bits to simplify logic - return Double.longBitsToDouble(sinTable[(int) pos] ^ neg); + // Four cardinal directions (credits: Nate) + for(int i = 0; i < 360; i += 90) { + sin[(int) (i * degToIndex) & SIN_MASK] = Math.sin(i * Math.PI / 180.0); + cos[(int) (i * degToIndex) & SIN_MASK] = Math.cos(i * Math.PI / 180.0); + } } public static double sin(double rad) { - return sinLookup((long) (rad * radianToIndex) & 0xFFFFFFFFL); + return sin[(int) (rad * radToIndex) & SIN_MASK]; } public static double cos(double rad) { - return sinLookup((long) (rad * radianToIndex + lookupTableSize) & 0xFFFFFFFFL); + return cos[(int) (rad * radToIndex) & SIN_MASK]; } public static double tan(double rad) { From 2c45ba91aafe3d453be74b67fd287b78e9a3dda2 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 22:40:37 -0600 Subject: [PATCH 117/126] Fix up commit --- .../src/main/java/com/dfsek/terra/api/util/MathUtil.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java index 2dd593b21..f972e7106 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java +++ b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java @@ -35,13 +35,6 @@ public final class MathUtil { sin = new double[SIN_COUNT]; cos = new double[SIN_COUNT]; - static { - sinTable = new long[lookupTableSizeWithMargin]; - for(int i = 0; i < lookupTableSizeWithMargin; i++) { - double d = i * tauOverLookupSize; - sinTable[i] = Double.doubleToRawLongBits(StrictMath.sin(d)); - } - // Four cardinal directions (credits: Nate) for(int i = 0; i < 360; i += 90) { sin[(int) (i * degToIndex) & SIN_MASK] = Math.sin(i * Math.PI / 180.0); From 6cc53beecbdd35731b076c18c3a0f4bee4bb0fa8 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Mon, 23 Sep 2024 23:14:35 -0600 Subject: [PATCH 118/126] Fix Sin/Cos --- .../api/src/main/java/com/dfsek/terra/api/util/MathUtil.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java index f972e7106..e57765f2e 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java +++ b/common/api/src/main/java/com/dfsek/terra/api/util/MathUtil.java @@ -35,6 +35,11 @@ public final class MathUtil { sin = new double[SIN_COUNT]; cos = new double[SIN_COUNT]; + for(int i = 0; i < SIN_COUNT; i++) { + sin[i] = Math.sin((i + 0.5f) / SIN_COUNT * radFull); + cos[i] = Math.cos((i + 0.5f) / SIN_COUNT * radFull); + } + // Four cardinal directions (credits: Nate) for(int i = 0; i < 360; i += 90) { sin[(int) (i * degToIndex) & SIN_MASK] = Math.sin(i * Math.PI / 180.0); From 1aa3ef813c3497a9999961a8c99172d444f1ea07 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Tue, 24 Sep 2024 09:05:33 -0600 Subject: [PATCH 119/126] add default sampler to pseudoerosion --- .../noise/config/templates/noise/PseudoErosionTemplate.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java index f6d5706d8..cda91ec32 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/config/templates/noise/PseudoErosionTemplate.java @@ -4,6 +4,7 @@ import com.dfsek.tectonic.api.config.template.annotations.Value; import com.dfsek.terra.addons.noise.samplers.noise.PseudoErosionSampler; +import com.dfsek.terra.addons.noise.samplers.noise.simplex.OpenSimplex2Sampler; import com.dfsek.terra.api.config.meta.Meta; import com.dfsek.terra.api.noise.DerivativeNoiseSampler; @@ -43,7 +44,8 @@ public class PseudoErosionTemplate extends NoiseTemplate { private double erosionFrequency = 0.02; @Value("sampler") - private DerivativeNoiseSampler heightSampler; + @Default + private DerivativeNoiseSampler heightSampler = new OpenSimplex2Sampler(); @Value("slope-mask.enable") @Default From 13782bb51e72a15426190526ecb2a2653513e8bc Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Tue, 24 Sep 2024 09:11:43 -0600 Subject: [PATCH 120/126] Remforamt --- .../events/platform/CommandRegistrationEvent.java | 4 ++-- .../api/world/biome/generation/BiomeProvider.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java b/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java index 80088ff6d..3ad041c9b 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java +++ b/common/api/src/main/java/com/dfsek/terra/api/event/events/platform/CommandRegistrationEvent.java @@ -1,10 +1,10 @@ package com.dfsek.terra.api.event.events.platform; -import org.incendo.cloud.CommandManager; - import com.dfsek.terra.api.command.CommandSender; import com.dfsek.terra.api.event.events.Event; +import org.incendo.cloud.CommandManager; + public class CommandRegistrationEvent implements Event { private final CommandManager commandManager; diff --git a/common/api/src/main/java/com/dfsek/terra/api/world/biome/generation/BiomeProvider.java b/common/api/src/main/java/com/dfsek/terra/api/world/biome/generation/BiomeProvider.java index 3aed2b9ac..d049cd43b 100644 --- a/common/api/src/main/java/com/dfsek/terra/api/world/biome/generation/BiomeProvider.java +++ b/common/api/src/main/java/com/dfsek/terra/api/world/biome/generation/BiomeProvider.java @@ -7,18 +7,18 @@ package com.dfsek.terra.api.world.biome.generation; -import com.dfsek.terra.api.util.Column; -import com.dfsek.terra.api.util.vector.Vector3; -import com.dfsek.terra.api.util.vector.Vector3Int; -import com.dfsek.terra.api.world.biome.Biome; -import com.dfsek.terra.api.world.info.WorldProperties; - import org.jetbrains.annotations.Contract; import java.util.Optional; import java.util.stream.Stream; import java.util.stream.StreamSupport; +import com.dfsek.terra.api.util.Column; +import com.dfsek.terra.api.util.vector.Vector3; +import com.dfsek.terra.api.util.vector.Vector3Int; +import com.dfsek.terra.api.world.biome.Biome; +import com.dfsek.terra.api.world.info.WorldProperties; + /** * Provides locations of biomes in a world. From 589cf83c38fbb71209987df9a773ac3878ae7a0a Mon Sep 17 00:00:00 2001 From: astrsh Date: Wed, 25 Sep 2024 14:02:54 +1000 Subject: [PATCH 121/126] Flip comparison As per request from @duplexsystem --- .../noise/samplers/noise/simplex/OpenSimplex2Sampler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java index 862a665c8..e86ec2234 100644 --- a/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java +++ b/common/addons/config-noise-function/src/main/java/com/dfsek/terra/addons/noise/samplers/noise/simplex/OpenSimplex2Sampler.java @@ -62,7 +62,7 @@ public double getNoiseRaw(long sl, double x, double y) { double x1 = x0 + (G2 - 1); double y1 = y0 + G2; double b = 0.5 - x1 * x1 - y1 * y1; - if(b <= 0) { + if(b > 0) { value += (b * b) * (b * b) * gradCoord(seed, i + PRIME_X, j, x1, y1); } } From f70a83aec3583a2f21b63422f00c05e036958a61 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Tue, 24 Sep 2024 23:26:49 -0600 Subject: [PATCH 122/126] fix spawners on bukkit --- .../bukkit/handles/BukkitWorldHandle.java | 22 ++------------ .../dfsek/terra/bukkit/util/BukkitUtils.java | 29 +++++++++++++++++++ .../terra/bukkit/world/BukkitAdapter.java | 16 ---------- .../world/block/state/BukkitMobSpawner.java | 3 +- 4 files changed, 33 insertions(+), 37 deletions(-) diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java index 97f932c81..35922cab5 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/handles/BukkitWorldHandle.java @@ -23,13 +23,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Locale; - import com.dfsek.terra.api.block.state.BlockState; import com.dfsek.terra.api.entity.EntityType; import com.dfsek.terra.api.handle.WorldHandle; +import com.dfsek.terra.bukkit.util.BukkitUtils; import com.dfsek.terra.bukkit.world.block.data.BukkitBlockState; -import com.dfsek.terra.bukkit.world.entity.BukkitEntityType; public class BukkitWorldHandle implements WorldHandle { @@ -61,22 +59,6 @@ public BukkitWorldHandle() { @Override public @NotNull EntityType getEntity(@NotNull String id) { - if(!id.contains(":")) { //TODO: remove in 7.0 - String newid = "minecraft:" + id.toLowerCase(); - ; - logger.warn( - "Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" + - ". You are advised to perform this rename in your config backs as this translation will be removed in the next major " + - "version of Terra."); - } - if(!id.startsWith("minecraft:")) throw new IllegalArgumentException("Invalid entity identifier " + id); - String entityID = id.toUpperCase(Locale.ROOT).substring(10); - - return new BukkitEntityType(switch(entityID) { - case "END_CRYSTAL" -> org.bukkit.entity.EntityType.END_CRYSTAL; - case "ENDER_CRYSTAL" -> throw new IllegalArgumentException( - "Invalid entity identifier " + id); // make sure this issue can't happen the other way around. - default -> org.bukkit.entity.EntityType.valueOf(entityID); - }); + return BukkitUtils.getEntityType(id); } } diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/BukkitUtils.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/BukkitUtils.java index cc2fa78ef..6c0a9c7f4 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/BukkitUtils.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/util/BukkitUtils.java @@ -2,11 +2,40 @@ import org.bukkit.Material; import org.bukkit.block.data.BlockData; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Locale; + +import com.dfsek.terra.api.entity.EntityType; +import com.dfsek.terra.bukkit.world.entity.BukkitEntityType; public class BukkitUtils { + private static final Logger logger = LoggerFactory.getLogger(BukkitUtils.class); + public static boolean isLiquid(BlockData blockState) { Material material = blockState.getMaterial(); return material == Material.WATER || material == Material.LAVA; } + + public static EntityType getEntityType(String id) { + if(!id.contains(":")) { //TODO: remove in 7.0 + String newid = "minecraft:" + id.toLowerCase(); + ; + logger.warn( + "Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" + + ". You are advised to perform this rename in your config backs as this translation will be removed in the next major " + + "version of Terra."); + } + if(!id.startsWith("minecraft:")) throw new IllegalArgumentException("Invalid entity identifier " + id); + String entityID = id.toUpperCase(Locale.ROOT).substring(10); + + return new BukkitEntityType(switch(entityID) { + case "END_CRYSTAL" -> org.bukkit.entity.EntityType.END_CRYSTAL; + case "ENDER_CRYSTAL" -> throw new IllegalArgumentException( + "Invalid entity identifier " + id); // make sure this issue can't happen the other way around. + default -> org.bukkit.entity.EntityType.valueOf(entityID); + }); + } } diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/BukkitAdapter.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/BukkitAdapter.java index f2d446de7..408265821 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/BukkitAdapter.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/BukkitAdapter.java @@ -20,7 +20,6 @@ import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.TreeType; import org.bukkit.entity.Player; import org.bukkit.generator.WorldInfo; import org.bukkit.util.Vector; @@ -46,27 +45,12 @@ import com.dfsek.terra.bukkit.world.block.data.BukkitBlockState; import com.dfsek.terra.bukkit.world.inventory.BukkitItemStack; import com.dfsek.terra.bukkit.world.inventory.meta.BukkitEnchantment; -import com.dfsek.terra.transform.MapTransform; -import com.dfsek.terra.transform.TransformerImpl; /** * Utility class to adapt Bukkit enums to Terra enums. */ public final class BukkitAdapter { - public static TransformerImpl TREE_TRANSFORMER = new TransformerImpl.Builder() - .addTransform(new MapTransform() - .add(TreeType.COCOA_TREE, "JUNGLE_COCOA") - .add(TreeType.BIG_TREE, "LARGE_OAK") - .add(TreeType.TALL_REDWOOD, "LARGE_SPRUCE") - .add(TreeType.REDWOOD, "SPRUCE") - .add(TreeType.TREE, "OAK") - .add(TreeType.MEGA_REDWOOD, "MEGA_SPRUCE") - .add(TreeType.SWAMP, "SWAMP_OAK")) - .addTransform(TreeType::toString) - .build(); - - public static BlockState adapt(org.bukkit.block.data.BlockData data) { return BukkitBlockState.newInstance(data); } diff --git a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/block/state/BukkitMobSpawner.java b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/block/state/BukkitMobSpawner.java index 7bdc75d96..dc9d1ecb6 100644 --- a/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/block/state/BukkitMobSpawner.java +++ b/platforms/bukkit/common/src/main/java/com/dfsek/terra/bukkit/world/block/state/BukkitMobSpawner.java @@ -23,6 +23,7 @@ import com.dfsek.terra.api.block.entity.MobSpawner; import com.dfsek.terra.api.block.entity.SerialState; import com.dfsek.terra.api.entity.EntityType; +import com.dfsek.terra.bukkit.util.BukkitUtils; import com.dfsek.terra.bukkit.world.entity.BukkitEntityType; @@ -115,7 +116,7 @@ public void setSpawnRange(int spawnRange) { public void applyState(String state) { SerialState.parse(state).forEach((k, v) -> { switch(k) { - case "type" -> setSpawnedType(new BukkitEntityType(org.bukkit.entity.EntityType.valueOf(v.toUpperCase()))); + case "type" -> setSpawnedType(BukkitUtils.getEntityType(v)); case "delay" -> setDelay(Integer.parseInt(v)); case "min_delay" -> setMinSpawnDelay(Integer.parseInt(v)); case "max_delay" -> setMaxSpawnDelay(Integer.parseInt(v)); From 060cbfd0c439cce2060cb7a7baa9021a0a34c711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sat, 12 Oct 2024 13:44:02 -0600 Subject: [PATCH 123/126] Update CODEOWNERS --- .github/CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 732a59b1d..7bf7091b6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,13 +1,13 @@ # Global owners, automatically request review when pull request is submitted -* @dfsek @solonovamax @duplexsystem @Astrashh @justaureus +* @dfsek @solonovamax @duplexsystem @astrsh @justaureus # Platforms /platforms/ @dfsek @solonovamax @duplexsystem @justaureus # Common -/common/ @dfsek @solonovamax @duplexsystem @Astrashh +/common/ @dfsek @solonovamax @duplexsystem @astrsh # Gradle Stuff /buildSrc/ @dfsek @solonovamax @duplexsystem *.gradle.kts @dfsek @solonovamax @duplexsystem -/gradle/ @dfsek @solonovamax @duplexsystem \ No newline at end of file +/gradle/ @dfsek @solonovamax @duplexsystem From 592788450cae723d86918eb90d04eee6c6febc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Gidiere?= Date: Sat, 12 Oct 2024 13:45:55 -0600 Subject: [PATCH 124/126] Update CODEOWNERS --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7bf7091b6..f40b5cfd8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,6 +3,7 @@ # Platforms /platforms/ @dfsek @solonovamax @duplexsystem @justaureus +/platforms/bukkit @dfsek @solonovamax @duplexsystem @justaureus @OakLoaf # Common /common/ @dfsek @solonovamax @duplexsystem @astrsh From 12faae8fd52fd27a2991d410e02d22200f93aa68 Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Sun, 13 Oct 2024 15:55:29 -0600 Subject: [PATCH 125/126] Use reflection remapper for worldGenContext on bukkit How this even worked before astounds me --- .../bukkit/nms/v1_21/NMSInjectListener.java | 19 +++++++------------ .../terra/bukkit/nms/v1_21/Reflection.java | 11 +++++++++++ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java index 927b019ed..a25638594 100644 --- a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/NMSInjectListener.java @@ -42,18 +42,13 @@ public void onWorldInit(WorldInitEvent event) { NMSBiomeProvider provider = new NMSBiomeProvider(pack.getBiomeProvider(), craftWorld.getSeed()); ChunkMap chunkMap = serverWorld.getChunkSource().chunkMap; WorldGenContext worldGenContext = chunkMap.worldGenContext; - - try { - ReflectionUtil.setFinalField(chunkMap, "worldGenContext", new WorldGenContext( - worldGenContext.level(), - new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()), - worldGenContext.structureManager(), - worldGenContext.lightEngine(), - worldGenContext.mainThreadMailBox() - )); - } catch(NoSuchFieldException e) { - throw new RuntimeException(e); - } + Reflection.CHUNKMAP.setWorldGenContext(chunkMap, new WorldGenContext( + worldGenContext.level(), + new NMSChunkGeneratorDelegate(vanilla, pack, provider, craftWorld.getSeed()), + worldGenContext.structureManager(), + worldGenContext.lightEngine(), + worldGenContext.mainThreadMailBox() + )); LOGGER.info("Successfully injected into world."); diff --git a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/Reflection.java b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/Reflection.java index 57e1b8c9c..a6f4ea9ba 100644 --- a/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/Reflection.java +++ b/platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/Reflection.java @@ -3,8 +3,10 @@ import net.minecraft.core.Holder; import net.minecraft.core.Holder.Reference; import net.minecraft.core.MappedRegistry; +import net.minecraft.server.level.ChunkMap; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.StructureManager; +import net.minecraft.world.level.chunk.status.WorldGenContext; import xyz.jpenilla.reflectionremapper.ReflectionRemapper; import xyz.jpenilla.reflectionremapper.proxy.ReflectionProxyFactory; import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldGetter; @@ -19,6 +21,8 @@ public class Reflection { public static final ReferenceProxy REFERENCE; + public static final ChunkMapProxy CHUNKMAP; + static { ReflectionRemapper reflectionRemapper = ReflectionRemapper.forReobfMappingsInPaperJar(); ReflectionProxyFactory reflectionProxyFactory = ReflectionProxyFactory.create(reflectionRemapper, @@ -27,6 +31,7 @@ public class Reflection { MAPPED_REGISTRY = reflectionProxyFactory.reflectionProxy(MappedRegistryProxy.class); STRUCTURE_MANAGER = reflectionProxyFactory.reflectionProxy(StructureManagerProxy.class); REFERENCE = reflectionProxyFactory.reflectionProxy(ReferenceProxy.class); + CHUNKMAP = reflectionProxyFactory.reflectionProxy(ChunkMapProxy.class); } @@ -49,4 +54,10 @@ public interface ReferenceProxy { @MethodName("bindValue") void invokeBindValue(Reference instance, T value); } + + @Proxies(ChunkMap.class) + public interface ChunkMapProxy { + @FieldSetter("worldGenContext") + void setWorldGenContext(ChunkMap instance, WorldGenContext worldGenContext); + } } From 0a952cff4c3eea8bc0a49205643e0c225d12304c Mon Sep 17 00:00:00 2001 From: Zoe Gidiere Date: Sun, 13 Oct 2024 16:06:35 -0600 Subject: [PATCH 126/126] bump build number --- build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 67b22ccb5..968d1e3b7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,8 @@ preRelease(true) -versionProjects(":common:api", version("6.5.0")) -versionProjects(":common:implementation", version("6.5.0")) -versionProjects(":platforms", version("6.5.0")) +versionProjects(":common:api", version("6.5.1")) +versionProjects(":common:implementation", version("6.5.1")) +versionProjects(":platforms", version("6.5.1")) allprojects {