Paper/Spigot-Server-Patches/0196-Add-missing-coverages-for-getTileEntity-in-order-to-.patch
2018-07-23 09:44:57 +01:00

29 lines
1.1 KiB
Diff

From 6abcfc52f3b1140bf55d775ef2083c3bc17c0797 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 22 Jul 2017 15:22:59 +0100
Subject: [PATCH] Add missing coverages for getTileEntity in order to attempt
to avoid exeptions when calling getTileEntity
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 8f6ce6bf1a..5d5f6f6328 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -234,6 +234,13 @@ public class WorldServer extends World implements IAsyncTaskHandler {
result = fixTileEntity(pos, type, result);
}
}
+ // Paper Start - add TE fix checks for shulkers, see nms.BlockShulkerBox
+ else if (type instanceof BlockShulkerBox) {
+ if (!(result instanceof TileEntityShulkerBox)) {
+ result = fixTileEntity(pos, type, result);
+ }
+ }
+ // Paper end
return result;
}
--
2.18.0