mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Fix configurable feature seed patch
This commit is contained in:
parent
9ea33aa222
commit
10c6a1bd9e
1 changed files with 14 additions and 14 deletions
|
@ -79,32 +79,32 @@ index e5543b3a261f80bd9b0346d595a62b5458d9b229..45abadeb2568566b3646004d03e7ba8c
|
||||||
return getIntOrDefault(behaviorTickRates, typeName, entityType, def);
|
return getIntOrDefault(behaviorTickRates, typeName, entityType, def);
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||||
index e2b7da265e9616ac47e6be72cc6e6d2c75cfec44..f8a2aa31e38f64f88a82d5a388b58f1962d5fda0 100644
|
index e2b7da265e9616ac47e6be72cc6e6d2c75cfec44..e4591c0b3c8547cc6f4e2a0891fc378ee4334d9e 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||||
@@ -278,7 +278,7 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource {
|
@@ -277,7 +277,7 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource {
|
||||||
|
int j = list.size();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Registry<PlacedFeature> iregistry = generatoraccessseed.registryAccess().registryOrThrow(Registry.PLACED_FEATURE_REGISTRY);
|
- Registry<PlacedFeature> iregistry = generatoraccessseed.registryAccess().registryOrThrow(Registry.PLACED_FEATURE_REGISTRY);
|
||||||
- Registry<StructureFeature<?>> iregistry1 = generatoraccessseed.registryAccess().registryOrThrow(Registry.STRUCTURE_FEATURE_REGISTRY);
|
+ Registry<PlacedFeature> iregistry = generatoraccessseed.registryAccess().registryOrThrow(Registry.PLACED_FEATURE_REGISTRY); // Paper - diff on change
|
||||||
+ Registry<StructureFeature<?>> iregistry1 = generatoraccessseed.registryAccess().registryOrThrow(Registry.STRUCTURE_FEATURE_REGISTRY); // Paper - diff on change
|
Registry<StructureFeature<?>> iregistry1 = generatoraccessseed.registryAccess().registryOrThrow(Registry.STRUCTURE_FEATURE_REGISTRY);
|
||||||
int k = Math.max(GenerationStep.Decoration.values().length, j);
|
int k = Math.max(GenerationStep.Decoration.values().length, j);
|
||||||
|
|
||||||
for (int l = 0; l < k; ++l) {
|
@@ -351,7 +351,15 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource {
|
||||||
@@ -292,7 +292,15 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource {
|
return (String) optional.orElseGet(placedfeature::toString);
|
||||||
for (iterator = list1.iterator(); iterator.hasNext(); ++i1) {
|
};
|
||||||
StructureFeature<?> structuregenerator = (StructureFeature) iterator.next();
|
|
||||||
|
|
||||||
- seededrandom.setFeatureSeed(i, i1, l);
|
- seededrandom.setFeatureSeed(i, l1, l);
|
||||||
+ // Paper start - change populationSeed used in random
|
+ // Paper start - change populationSeed used in random
|
||||||
+ long featurePopulationSeed = i;
|
+ long featurePopulationSeed = i;
|
||||||
+ final net.minecraft.resources.ResourceLocation location = iregistry1.getKey(structuregenerator);
|
+ final net.minecraft.resources.ResourceLocation location = iregistry.getKey(placedfeature);
|
||||||
+ final long configFeatureSeed = generatoraccessseed.getMinecraftWorld().paperConfig.featureSeeds.getLong(location);
|
+ final long configFeatureSeed = generatoraccessseed.getMinecraftWorld().paperConfig.featureSeeds.getLong(location);
|
||||||
+ if (configFeatureSeed != -1) {
|
+ if (configFeatureSeed != -1) {
|
||||||
+ featurePopulationSeed = seededrandom.setDecorationSeed(configFeatureSeed, blockposition.getX(), blockposition.getZ()); // See seededrandom.setDecorationSeed from above
|
+ featurePopulationSeed = seededrandom.setDecorationSeed(configFeatureSeed, blockposition.getX(), blockposition.getZ()); // See seededrandom.setDecorationSeed from above
|
||||||
+ }
|
+ }
|
||||||
+ seededrandom.setFeatureSeed(featurePopulationSeed, i1, l);;
|
+ seededrandom.setFeatureSeed(featurePopulationSeed, l1, l);
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
Supplier<String> supplier = () -> { // CraftBukkit - decompile error
|
|
||||||
Optional optional = iregistry1.getResourceKey(structuregenerator).map(Object::toString);
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
generatoraccessseed.setCurrentlyGenerating(supplier1);
|
||||||
|
|
Loading…
Reference in a new issue