Update from upstream SpigotMC

Fix Corrupted Trapped Chests SpigotMC/Spigot@08de30ca3e
Don't time async events SpigotMC/Spigot@c3a9e71da3
This commit is contained in:
Zach Brown 2014-08-15 14:35:58 -05:00
parent 57ec3d64be
commit d301626815
2 changed files with 35 additions and 6 deletions

View File

@ -1,4 +1,4 @@
From 1a8060d85c71cd9047243fd1fb8d8484601abf99 Mon Sep 17 00:00:00 2001
From 8436d82f19ccc283c93fa2a2a2df7621437dd5ae Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 2 Jun 2013 10:42:57 +1000
Subject: [PATCH] Spigot Timings
@ -242,7 +242,7 @@ index d2fe422..1d51908 100644
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index b178c0d..6611342 100644
index b178c0d..fe723c9 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -39,6 +39,7 @@ import org.bukkit.plugin.PluginLoader;
@ -261,7 +261,7 @@ index b178c0d..6611342 100644
/**
* This class was not meant to be constructed explicitly
@@ -283,13 +285,16 @@ public final class JavaPluginLoader implements PluginLoader {
@@ -283,13 +285,19 @@ public final class JavaPluginLoader implements PluginLoader {
}
}
@ -272,13 +272,16 @@ index b178c0d..6611342 100644
if (!eventClass.isAssignableFrom(event.getClass())) {
return;
}
+ timings.startTiming(); // Spigot
+ // Spigot start
+ boolean isAsync = event.isAsynchronous();
+ if (!isAsync) timings.startTiming();
method.invoke(listener, event);
+ timings.stopTiming(); // Spigot
+ if (!isAsync) timings.stopTiming();
+ // Spigot end
} catch (InvocationTargetException ex) {
throw new EventException(ex.getCause());
} catch (Throwable t) {
@@ -297,7 +302,7 @@ public final class JavaPluginLoader implements PluginLoader {
@@ -297,7 +305,7 @@ public final class JavaPluginLoader implements PluginLoader {
}
}
};

View File

@ -0,0 +1,26 @@
From baa91fa0bb4aee82819f9ccb4aa2f6c8889365ca Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 15 Aug 2014 00:56:41 -0400
Subject: [PATCH] Fix Corrupted Trapped Chest
The CraftBukkit code that auto repairs corrupted tile entities never was updated for Trapped Chest.
If a Trapped Chest gets its Tile Entity corrupted, it will crash the server every time the chunk is loaded.
This will now fix Trapped Chests too.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index d93eb8b..f9dc0fc 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -87,7 +87,7 @@ public class WorldServer extends World {
TileEntity result = super.getTileEntity(i, j, k);
Block type = getType(i, j, k);
- if (type == Blocks.CHEST) {
+ if (type == Blocks.CHEST || type == Blocks.TRAPPED_CHEST) { // Spigot
if (!(result instanceof TileEntityChest)) {
result = fixTileEntity(i, j, k, type, result);
}
--
1.9.1