From ddc8a0ae88add57bd0b5fa32ba9c0a3450db92f8 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 10 Mar 2018 20:26:05 +0000 Subject: [PATCH] Return null instead of players location on EnderChests opened by plugins --- ...E-when-getting-location-from-InventoryEnderChe.patch} | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) rename Spigot-Server-Patches/{0272-Fix-NPE-when-getting-location-from-players-EnderChes.patch => 0272-Fix-NPE-when-getting-location-from-InventoryEnderChe.patch} (76%) diff --git a/Spigot-Server-Patches/0272-Fix-NPE-when-getting-location-from-players-EnderChes.patch b/Spigot-Server-Patches/0272-Fix-NPE-when-getting-location-from-InventoryEnderChe.patch similarity index 76% rename from Spigot-Server-Patches/0272-Fix-NPE-when-getting-location-from-players-EnderChes.patch rename to Spigot-Server-Patches/0272-Fix-NPE-when-getting-location-from-InventoryEnderChe.patch index ce7df1952..e4c6f8cde 100644 --- a/Spigot-Server-Patches/0272-Fix-NPE-when-getting-location-from-players-EnderChes.patch +++ b/Spigot-Server-Patches/0272-Fix-NPE-when-getting-location-from-InventoryEnderChe.patch @@ -1,11 +1,12 @@ -From ef57c5ff0c40fb3c195d1fb50ea6a887a6eeb81c Mon Sep 17 00:00:00 2001 +From 4caec43af620f7c53787870fd105694be881b5d2 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 10 Mar 2018 13:03:49 +0000 -Subject: [PATCH] Fix NPE when getting location from players EnderChest +Subject: [PATCH] Fix NPE when getting location from InventoryEnderChest opened + by plugins diff --git a/src/main/java/net/minecraft/server/InventoryEnderChest.java b/src/main/java/net/minecraft/server/InventoryEnderChest.java -index cd7de2b53..85ad93d08 100644 +index cd7de2b53..37b494b78 100644 --- a/src/main/java/net/minecraft/server/InventoryEnderChest.java +++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java @@ -5,7 +5,7 @@ import org.bukkit.inventory.InventoryHolder; @@ -21,7 +22,7 @@ index cd7de2b53..85ad93d08 100644 @Override public Location getLocation() { -+ if (getTileEntity() == null) return owner.getBukkitEntity().getLocation(); // Paper - return Player location if there is no TE ++ if (getTileEntity() == null) return null; // Paper - return null if there is no TE bound (opened by plugin) return new Location(this.a.getWorld().getWorld(), this.a.getPosition().getX(), this.a.getPosition().getY(), this.a.getPosition().getZ()); }