Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/nms-patches/DataPaletteBlock.patch

26 Zeilen
1.0 KiB
Diff

2016-02-29 22:32:46 +01:00
--- a/net/minecraft/server/DataPaletteBlock.java
+++ b/net/minecraft/server/DataPaletteBlock.java
2016-05-10 13:47:39 +02:00
@@ -112,7 +112,21 @@
2016-02-29 22:32:46 +01:00
int i1 = nibblearray1 == null ? 0 : nibblearray1.a(j, k, l);
int j1 = i1 << 12 | (abyte[i] & 255) << 4 | nibblearray.a(j, k, l);
- this.setBlockIndex(i, (IBlockData) Block.REGISTRY_ID.fromId(j1));
+ // CraftBukkit start - fix blocks with random data values (caused by plugins)
+ IBlockData data = Block.REGISTRY_ID.fromId(j1);
+ if (data == null) {
+ Block block = Block.getById(j1 >> 4);
+ if (block != null) {
+ try {
+ data = block.fromLegacyData(j1 & 0xF);
+ } catch (Exception ignored) {
+ data = block.getBlockData();
+ }
+ }
+ }
+ this.setBlockIndex(i, data);
+ // this.setBlockIndex(i, (IBlockData) Block.REGISTRY_ID.fromId(j1));
+ // CraftBukkit end
}
}