mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 16:18:02 +01:00
Return null instead of players location on EnderChests opened by plugins
This commit is contained in:
parent
77229ce7ab
commit
ddc8a0ae88
1 changed files with 5 additions and 4 deletions
|
@ -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 <theboyetronic@gmail.com>
|
From: Shane Freeder <theboyetronic@gmail.com>
|
||||||
Date: Sat, 10 Mar 2018 13:03:49 +0000
|
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
|
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
|
--- a/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
||||||
+++ b/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;
|
@@ -5,7 +5,7 @@ import org.bukkit.inventory.InventoryHolder;
|
||||||
|
@ -21,7 +22,7 @@ index cd7de2b53..85ad93d08 100644
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Location getLocation() {
|
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());
|
return new Location(this.a.getWorld().getWorld(), this.a.getPosition().getX(), this.a.getPosition().getY(), this.a.getPosition().getZ());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue