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