Add more needed BlockStateListPopulator Methods (#8021)

This commit is contained in:
Owen 2022-07-29 19:28:46 -04:00 committed by GitHub
parent b74c4d4587
commit 65f0b2e2e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 2 deletions

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add missing important BlockStateListPopulator methods
Without these methods it causes exceptions due to these being used by certain feature generators. Without these methods it causes exceptions due to these being used by certain feature generators.
diff --git a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
index 8e6a71c1e8b53faa70b893c76f5bd25f96a5e142..03153abb425acf2d615acc386c91a6524aaa80bf 100644 index 8e6a71c1e8b53faa70b893c76f5bd25f96a5e142..19abf7b6000a875be8c7141cfba81b279b2cae60 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java --- a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java +++ b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
@@ -129,4 +129,27 @@ public class BlockStateListPopulator extends DummyGeneratorAccess { @@ -129,4 +129,32 @@ public class BlockStateListPopulator extends DummyGeneratorAccess {
public DimensionType dimensionType() { public DimensionType dimensionType() {
return this.world.dimensionType(); return this.world.dimensionType();
} }
@ -32,8 +32,35 @@ index 8e6a71c1e8b53faa70b893c76f5bd25f96a5e142..03153abb425acf2d615acc386c91a652
+ } + }
+ +
+ @Override + @Override
+ public int getHeight(net.minecraft.world.level.levelgen.Heightmap.Types heightmap, int x, int z) {
+ return world.getHeight(heightmap, x, z);
+ }
+
+ @Override
+ public net.minecraft.world.level.storage.LevelData getLevelData() { + public net.minecraft.world.level.storage.LevelData getLevelData() {
+ return world.getLevelData(); + return world.getLevelData();
+ } + }
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
index fbd82b6be6604bf854e01ed5718e4e072f42b265..cd0dc080fbd8c5b1509d67e2b60264393b2b7dbb 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
@@ -269,5 +269,17 @@ public class DummyGeneratorAccess implements WorldGenLevel {
@Override
public <T> void getEntitiesByClass(Class<? extends T> clazz, Entity except, AABB box, List<? super T> into, Predicate<? super T> predicate) {}
+
+ @Override
+ public void scheduleTick(BlockPos pos, Fluid fluid, int delay) {
+ }
+
+ @Override
+ public void scheduleTick(BlockPos pos, Block block, int delay, net.minecraft.world.ticks.TickPriority priority) {
+ }
+
+ @Override
+ public void scheduleTick(BlockPos pos, Fluid fluid, int delay, net.minecraft.world.ticks.TickPriority priority) {
+ }
// Paper end
}