3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00

Fix getBrightness and getRawBrightness throwing exception in BlockStateListPopulator (#9111)

Dieser Commit ist enthalten in:
Redned 2023-04-10 03:06:49 -05:00 committet von GitHub
Ursprung ab72b123ec
Commit 8be7a60b76
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 13 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -55,4 +55,5 @@ TheFruxz <cedricspitzer@outlook.de>
Kieran Wallbanks <kieran.wallbanks@gmail.com>
Denery <dorofeevij@gmail.com>
Jakubk15 <jakubk15@protonmail.com>
Redned <redned235@gmail.com>
```

Datei anzeigen

@ -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