Update configurable feature seed patch

This commit is contained in:
Nassim Jahnke
2022-06-09 13:16:00 +02:00
parent 5dc0509d47
commit 929bb263c3
2 changed files with 30 additions and 19 deletions

View File

@@ -22,15 +22,6 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -0,0 +0,0 @@ public abstract class ChunkGenerator {
int j = list.size();
try {
- Registry<PlacedFeature> iregistry1 = generatoraccessseed.registryAccess().registryOrThrow(Registry.PLACED_FEATURE_REGISTRY);
+ Registry<PlacedFeature> iregistry1 = generatoraccessseed.registryAccess().registryOrThrow(Registry.PLACED_FEATURE_REGISTRY); // Paper - diff on change
int k = Math.max(GenerationStep.Decoration.values().length, j);
for (int l = 0; l < k; ++l) {
@@ -0,0 +0,0 @@ public abstract class ChunkGenerator {
return (String) optional.orElseGet(placedfeature::toString);
};
@@ -38,8 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- seededrandom.setFeatureSeed(i, l1, l);
+ // Paper start - change populationSeed used in random
+ long featurePopulationSeed = i;
+ final net.minecraft.resources.ResourceLocation location = iregistry1.getKey(placedfeature);
+ final long configFeatureSeed = generatoraccessseed.getMinecraftWorld().paperConfig().featureSeeds.features.getLong(location); // TODO this wont work
+ final long configFeatureSeed = generatoraccessseed.getMinecraftWorld().paperConfig().featureSeeds.features.getLong(placedfeature.feature());
+ if (configFeatureSeed != -1) {
+ featurePopulationSeed = seededrandom.setDecorationSeed(configFeatureSeed, blockposition.getX(), blockposition.getZ()); // See seededrandom.setDecorationSeed from above
+ }