From 8be7a60b76213fcfa21bc8f6c4aba9d2d92cbee0 Mon Sep 17 00:00:00 2001 From: Redned Date: Mon, 10 Apr 2023 03:06:49 -0500 Subject: [PATCH] Fix getBrightness and getRawBrightness throwing exception in BlockStateListPopulator (#9111) --- LICENSE.md | 1 + ...-important-BlockStateListPopulator-method.patch | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index a191154cc1..cfa2f75ba0 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -55,4 +55,5 @@ TheFruxz Kieran Wallbanks Denery Jakubk15 +Redned ``` diff --git a/patches/server/0851-Add-missing-important-BlockStateListPopulator-method.patch b/patches/server/0851-Add-missing-important-BlockStateListPopulator-method.patch index 740a5d886f..cdb1bc89a3 100644 --- a/patches/server/0851-Add-missing-important-BlockStateListPopulator-method.patch +++ b/patches/server/0851-Add-missing-important-BlockStateListPopulator-method.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add missing important BlockStateListPopulator methods 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 -index 4bd59614606962a5371fd0da54bde25bf6a01325..602ce766f00dfde057c735eae3351068d09feab1 100644 +index 4bd59614606962a5371fd0da54bde25bf6a01325..216b413ce29c2557d12b80b29072e7fc822de551 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java +++ b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java @@ -128,7 +128,7 @@ public class BlockStateListPopulator extends DummyGeneratorAccess { @@ -18,7 +18,7 @@ index 4bd59614606962a5371fd0da54bde25bf6a01325..602ce766f00dfde057c735eae3351068 } @Override -@@ -140,4 +140,28 @@ public class BlockStateListPopulator extends DummyGeneratorAccess { +@@ -140,4 +140,38 @@ public class BlockStateListPopulator extends DummyGeneratorAccess { public RegistryAccess registryAccess() { return this.world.registryAccess(); } @@ -45,6 +45,16 @@ index 4bd59614606962a5371fd0da54bde25bf6a01325..602ce766f00dfde057c735eae3351068 + public net.minecraft.world.level.storage.LevelData getLevelData() { + return world.getLevelData(); + } ++ ++ @Override ++ public int getRawBrightness(BlockPos pos, int ambientDarkness) { ++ return world.getRawBrightness(pos, ambientDarkness); ++ } ++ ++ @Override ++ public int getBrightness(net.minecraft.world.level.LightLayer type, BlockPos pos) { ++ return world.getBrightness(type, pos); ++ } + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java