13
0
geforkt von Mirrors/Paper

Add OBFHELPER - InventoryEnderChest#getTileEntity

Dieser Commit ist enthalten in:
Shane Freeder 2018-03-10 17:11:51 +00:00
Ursprung 3af34bfe45
Commit d207b66009

Datei anzeigen

@ -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());
}