From dca3a3b021206600f508892ce76013448cd1f86f Mon Sep 17 00:00:00 2001 From: Zach Brown 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 | 23 +++++++++++-------- ...-chunks-not-being-sent-to-the-client.patch | 6 ++--- ...Try-and-Debug-Crash-Reports-Crashing.patch | 8 +++---- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/CraftBukkit-Patches/0036-Properly-Close-Inventories.patch b/CraftBukkit-Patches/0036-Properly-Close-Inventories.patch index 428f36e..d163ff1 100644 --- a/CraftBukkit-Patches/0036-Properly-Close-Inventories.patch +++ b/CraftBukkit-Patches/0036-Properly-Close-Inventories.patch @@ -1,4 +1,4 @@ -From 556009e8fbd6c78308510f470f9ee787d3e43a75 Mon Sep 17 00:00:00 2001 +From 7145e03eed873f3a2a1d4aba7c7d66f079a621f4 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 27 Jun 2013 17:26:09 +1000 Subject: [PATCH] Properly Close Inventories @@ -6,35 +6,41 @@ Subject: [PATCH] Properly Close Inventories Properly close inventories when unloading and switching worlds. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 40c878b..6112709 100644 +index 40c878b..ab0af12 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -783,6 +783,15 @@ public class Chunk { +@@ -783,6 +783,18 @@ public class Chunk { while (iterator.hasNext()) { TileEntity tileentity = (TileEntity) iterator.next(); + // 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 this.world.a(tileentity); } -@@ -792,6 +801,15 @@ public class Chunk { +@@ -792,6 +804,18 @@ public class Chunk { java.util.Iterator iter = this.entitySlices[i].iterator(); while (iter.hasNext()) { Entity entity = (Entity) iter.next(); + // 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 @@ -60,4 +66,3 @@ index 13b75ff..bf8e745 100644 } -- 1.9.1 - diff --git a/CraftBukkit-Patches/0057-Fix-some-chunks-not-being-sent-to-the-client.patch b/CraftBukkit-Patches/0057-Fix-some-chunks-not-being-sent-to-the-client.patch index 5fb8736..18edc81 100644 --- a/CraftBukkit-Patches/0057-Fix-some-chunks-not-being-sent-to-the-client.patch +++ b/CraftBukkit-Patches/0057-Fix-some-chunks-not-being-sent-to-the-client.patch @@ -1,14 +1,14 @@ -From 2122ad064c44b2fc30dedd211c7d77eb675ac997 Mon Sep 17 00:00:00 2001 +From ace27befb235223223df00019ad6a5e1e6b106e7 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Mon, 2 Dec 2013 23:42:09 +0000 Subject: [PATCH] Fix some chunks not being sent to the client diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 6112709..04c0d64 100644 +index ab0af12..b1213f0 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -955,7 +955,15 @@ public class Chunk { +@@ -961,7 +961,15 @@ public class Chunk { } public boolean isReady() { diff --git a/CraftBukkit-Patches/0080-Try-and-Debug-Crash-Reports-Crashing.patch b/CraftBukkit-Patches/0080-Try-and-Debug-Crash-Reports-Crashing.patch index 5ec076c..6896a39 100644 --- a/CraftBukkit-Patches/0080-Try-and-Debug-Crash-Reports-Crashing.patch +++ b/CraftBukkit-Patches/0080-Try-and-Debug-Crash-Reports-Crashing.patch @@ -1,14 +1,14 @@ -From c9398e09ef1075e6c74f3fab117fe5704ff229f8 Mon Sep 17 00:00:00 2001 +From c1f169eb0d0b24c2d56c853920cb54b09e0cf789 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 12 Jan 2014 20:56:41 +1100 Subject: [PATCH] Try and Debug Crash Reports Crashing diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ee74b03..edd781e 100644 +index 6a31aaa..28471d6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -661,7 +661,13 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo +@@ -664,7 +664,13 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo worldserver.doTick(); worldserver.timings.doTick.stopTiming(); // Spigot } catch (Throwable throwable) { @@ -22,7 +22,7 @@ index ee74b03..edd781e 100644 worldserver.a(crashreport); throw new ReportedException(crashreport); } -@@ -671,7 +677,13 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo +@@ -674,7 +680,13 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo worldserver.tickEntities(); worldserver.timings.tickEntities.stopTiming(); // Spigot } catch (Throwable throwable1) {