mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
Add OBFHELPER - InventoryEnderChest#getTileEntity
This commit is contained in:
parent
3af34bfe45
commit
d207b66009
1 changed files with 11 additions and 2 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue