2014-11-30 23:16:48 +01:00
From 53fd961aebd1c269c92d4617c3ec81825e26f3cf Mon Sep 17 00:00:00 2001
2014-07-21 22:46:54 +02:00
From: md_5 <git@md-5.net>
Date: Sun, 20 Apr 2014 11:16:54 +1000
Subject: [PATCH] Log null TileEntity Owner
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
2014-11-28 02:17:45 +01:00
index a93ad27..80c7937 100644
2014-07-21 22:46:54 +02:00
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
2014-11-28 02:17:45 +01:00
@@ -189,7 +189,14 @@ public abstract class TileEntity {
2014-07-21 22:46:54 +02:00
// CraftBukkit start - add method
public InventoryHolder getOwner() {
2014-11-28 02:17:45 +01:00
- org.bukkit.block.BlockState state = world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()).getState();
2014-07-21 22:46:54 +02:00
+ // Spigot start
2014-11-28 02:17:45 +01:00
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ());
2014-07-21 22:46:54 +02:00
+ if (block == null) {
2014-11-28 02:17:45 +01:00
+ org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.WARNING, "No block for owner at %s %d %d %d", new Object[]{world.getWorld(), position.getX(), position.getY(), position.getZ()});
2014-07-21 22:46:54 +02:00
+ return null;
+ }
+ // Spigot end
+ org.bukkit.block.BlockState state = block.getState();
if (state instanceof InventoryHolder) return (InventoryHolder) state;
return null;
}
--
2014-11-28 02:17:45 +01:00
2.1.0
2014-07-21 22:46:54 +02:00