2018-03-10 17:11:51 +00:00
|
|
|
From ef57c5ff0c40fb3c195d1fb50ea6a887a6eeb81c Mon Sep 17 00:00:00 2001
|
2018-03-10 13:07:40 +00:00
|
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
|
|
Date: Sat, 10 Mar 2018 13:03:49 +0000
|
|
|
|
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
|
2018-03-10 17:11:51 +00:00
|
|
|
index cd7de2b53..85ad93d08 100644
|
2018-03-10 13:07:40 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
2018-03-10 17:11:51 +00:00
|
|
|
@@ -5,7 +5,7 @@ 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;
|
|
|
|
|
2018-03-10 13:07:40 +00:00
|
|
|
@@ -15,6 +15,7 @@ public class InventoryEnderChest extends InventorySubcontainer {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Location getLocation() {
|
2018-03-10 17:11:51 +00:00
|
|
|
+ if (getTileEntity() == null) return owner.getBukkitEntity().getLocation(); // Paper - return Player location if there is no TE
|
2018-03-10 13:07:40 +00:00
|
|
|
return new Location(this.a.getWorld().getWorld(), this.a.getPosition().getX(), this.a.getPosition().getY(), this.a.getPosition().getZ());
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
|
|
|
2.16.2
|
|
|
|
|