From d207b66009d012fa1412edf92fa23f37f3a82603 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 10 Mar 2018 17:11:51 +0000 Subject: [PATCH] Add OBFHELPER - InventoryEnderChest#getTileEntity --- ...en-getting-location-from-players-EnderChes.patch | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-players-EnderChes.patch b/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-players-EnderChes.patch index 8b2e16781..17e2616c7 100644 --- a/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-players-EnderChes.patch +++ b/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-players-EnderChes.patch @@ -5,14 +5,23 @@ Subject: [PATCH] Fix NPE when getting location from players EnderChest diff --git a/src/main/java/net/minecraft/server/InventoryEnderChest.java b/src/main/java/net/minecraft/server/InventoryEnderChest.java -index cd7de2b53..3bd69bf86 100644 +index cd7de2b53..85ad93d08 100644 --- a/src/main/java/net/minecraft/server/InventoryEnderChest.java +++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java +@@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryHolder; + + public class InventoryEnderChest extends InventorySubcontainer { + +- private TileEntityEnderChest a; ++ private TileEntityEnderChest a; public TileEntityEnderChest getTileEntity() { return a; } // Paper - OBFHELPER + // CraftBukkit start + private final EntityHuman owner; + @@ -0,0 +0,0 @@ public class InventoryEnderChest extends InventorySubcontainer { @Override public Location getLocation() { -+ if (a == null) return owner.getBukkitEntity().getLocation(); // Paper - return Player location if there is no TE ++ if (getTileEntity() == null) return owner.getBukkitEntity().getLocation(); // Paper - return Player location if there is no TE return new Location(this.a.getWorld().getWorld(), this.a.getPosition().getX(), this.a.getPosition().getY(), this.a.getPosition().getZ()); }