2019-07-20 06:01:24 +02:00
|
|
|
From 500fdae1ef6a574bb8d2e19fe39cea0927a66a82 Mon Sep 17 00:00:00 2001
|
2018-03-10 14:07:40 +01:00
|
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
|
|
Date: Sat, 10 Mar 2018 13:03:49 +0000
|
2018-03-10 21:26:05 +01:00
|
|
|
Subject: [PATCH] Fix NPE when getting location from InventoryEnderChest opened
|
|
|
|
by plugins
|
2018-03-10 14:07:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/InventoryEnderChest.java b/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
2019-07-20 06:01:24 +02:00
|
|
|
index 5a9ac3960d..fd31b9a6dc 100644
|
2018-03-10 14:07:40 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
2018-03-10 18:11:51 +01: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 14:07:40 +01:00
|
|
|
@@ -15,6 +15,7 @@ public class InventoryEnderChest extends InventorySubcontainer {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Location getLocation() {
|
2018-03-10 21:26:05 +01:00
|
|
|
+ if (getTileEntity() == null) return null; // Paper - return null if there is no TE bound (opened by plugin)
|
2018-03-10 14:07:40 +01:00
|
|
|
return new Location(this.a.getWorld().getWorld(), this.a.getPosition().getX(), this.a.getPosition().getY(), this.a.getPosition().getZ());
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2019-06-25 21:18:50 +02:00
|
|
|
2.22.0
|
2018-03-10 14:07:40 +01:00
|
|
|
|