From 47f9c99934b20aafdd535793bad0b585bdcaea50 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Wed, 6 Aug 2014 18:00:55 -0500 Subject: [PATCH] Update from upstream SpigotMC Fixed: Check cast SpigotMC/Spigot@7efa75c63af6091b9bc3c90c386d0f70139dfee4 --- .../0036-Properly-Close-Inventories.patch | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CraftBukkit-Patches/0036-Properly-Close-Inventories.patch b/CraftBukkit-Patches/0036-Properly-Close-Inventories.patch index b0144bdf33..851682a64c 100644 --- a/CraftBukkit-Patches/0036-Properly-Close-Inventories.patch +++ b/CraftBukkit-Patches/0036-Properly-Close-Inventories.patch @@ -16,9 +16,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Spigot Start + if ( tileentity instanceof IInventory ) + { -+ for ( org.bukkit.craftbukkit.entity.CraftHumanEntity h : new ArrayList( (List) ( (IInventory) tileentity ).getViewers() ) ) ++ for ( org.bukkit.entity.HumanEntity h : new ArrayList( (List) ( (IInventory) tileentity ).getViewers() ) ) + { -+ h.getHandle().closeInventory(); ++ if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity ) ++ { ++ ( (org.bukkit.craftbukkit.entity.CraftHumanEntity) h).getHandle().closeInventory(); ++ } + } + } + // Spigot End @@ -32,9 +35,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Spigot Start + if ( entity instanceof IInventory ) + { -+ for ( org.bukkit.craftbukkit.entity.CraftHumanEntity h : new ArrayList( (List) ( (IInventory) entity ).getViewers() ) ) ++ for ( org.bukkit.entity.HumanEntity h : new ArrayList( (List) ( (IInventory) entity ).getViewers() ) ) + { -+ h.getHandle().closeInventory(); ++ if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity ) ++ { ++ ( (org.bukkit.craftbukkit.entity.CraftHumanEntity) h).getHandle().closeInventory(); ++ } + } + } + // Spigot End