From 2377cf1414e5a29638cecd0c3b0a0b85486c2175 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Sun, 24 Aug 2014 02:40:45 -0500 Subject: [PATCH] Update from upstream SpigotMC Included Commits: Update IRC channel to irc.spi.gt SpigotMC/Spigot@a791c555e7bf83fe51a3f96b0cdf873c1c76620c Remove inv close patch for now SpigotMC/Spigot@a3abb3bea9f64ffc4e566b00088cf76fbdf1d582 Limit TNT Detonations per tick SpigotMC/Spigot@8f9c601aed5d90e721707d2706238fe17cb27722 Use sane default config values SpigotMC/Spigot@1cbbb9b62e683110cb82a1c0270a4985593c9a3b These commits were not included as they were quickly reverted: Only close if we are actually placing a block SpigotMC/Spigot@ea0b1b2d67d49f26d7ec5b7208e1f367f61cb54f Revert for the above SpigotMC/Spigot@28faa0bd20db58a9d18db37a0cdc4b1c16021e64 Add isUnbreakable and setUnbreakable to ItemMeta. Also fixes a bug wh... SpigotMC/Spigot@32e6d74a5f08b29dcb0f6fe5fac77dc55ee70542 Revert for the above SpigotMC/Spigot@4b5a26b11c737aa52fee132d98d729d2e64120c1 --- .../0005-Spigot-Configuration.patch | 4 +- ...=> 0170-Fix-Corrupted-Trapped-Chest.patch} | 0 .../0170-Force-Close-Inventory-On-Move.patch | 50 ----------------- ...h => 0171-Remove-uneeded-validation.patch} | 0 ...ch => 0172-Add-Hunger-Config-Values.patch} | 0 ...> 0173-Make-debug-logging-togglable.patch} | 0 ...p-invalid-enchants-in-CraftMetaItem.patch} | 0 .../0175-Limit-TNT-Detonations-per-tick.patch | 53 +++++++++++++++++++ 8 files changed, 55 insertions(+), 52 deletions(-) rename CraftBukkit-Patches/{0171-Fix-Corrupted-Trapped-Chest.patch => 0170-Fix-Corrupted-Trapped-Chest.patch} (100%) delete mode 100644 CraftBukkit-Patches/0170-Force-Close-Inventory-On-Move.patch rename CraftBukkit-Patches/{0172-Remove-uneeded-validation.patch => 0171-Remove-uneeded-validation.patch} (100%) rename CraftBukkit-Patches/{0173-Add-Hunger-Config-Values.patch => 0172-Add-Hunger-Config-Values.patch} (100%) rename CraftBukkit-Patches/{0174-Make-debug-logging-togglable.patch => 0173-Make-debug-logging-togglable.patch} (100%) rename CraftBukkit-Patches/{0175-Skip-invalid-enchants-in-CraftMetaItem.patch => 0174-Skip-invalid-enchants-in-CraftMetaItem.patch} (100%) create mode 100644 CraftBukkit-Patches/0175-Limit-TNT-Detonations-per-tick.patch diff --git a/CraftBukkit-Patches/0005-Spigot-Configuration.patch b/CraftBukkit-Patches/0005-Spigot-Configuration.patch index 91013e6c7..c279b4503 100644 --- a/CraftBukkit-Patches/0005-Spigot-Configuration.patch +++ b/CraftBukkit-Patches/0005-Spigot-Configuration.patch @@ -131,8 +131,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + "If you need help with the configuration or have any questions related to Spigot,\n" + + "join us at the IRC or drop by our forums and leave a post.\n" + + "\n" -+ + "IRC: #spigot @ irc.esper.net ( http://webchat.esper.net/?channel=spigot )\n" -+ + "Forums: http://www.spigotmc.org/forum/\n"; ++ + "IRC: #spigot @ irc.spi.gt ( http://www.spigotmc.org/pages/irc/ )\n" ++ + "Forums: http://www.spigotmc.org/\n"; + /*========================================================================*/ + static YamlConfiguration config; + static int version; diff --git a/CraftBukkit-Patches/0171-Fix-Corrupted-Trapped-Chest.patch b/CraftBukkit-Patches/0170-Fix-Corrupted-Trapped-Chest.patch similarity index 100% rename from CraftBukkit-Patches/0171-Fix-Corrupted-Trapped-Chest.patch rename to CraftBukkit-Patches/0170-Fix-Corrupted-Trapped-Chest.patch diff --git a/CraftBukkit-Patches/0170-Force-Close-Inventory-On-Move.patch b/CraftBukkit-Patches/0170-Force-Close-Inventory-On-Move.patch deleted file mode 100644 index 539d71c1b..000000000 --- a/CraftBukkit-Patches/0170-Force-Close-Inventory-On-Move.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sun, 10 Aug 2014 11:01:02 +1000 -Subject: [PATCH] Force Close Inventory On Move - - -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketPlayInListener { - - public void a(PacketPlayInBlockDig packetplayinblockdig) { - if (this.player.dead) return; // CraftBukkit -+ // Spigot start -+ if ( player.activeContainer != player.defaultContainer ) -+ { -+ getPlayer().closeInventory(); -+ } -+ // Spigot end - WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); - - this.player.v(); -@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketPlayInListener { - // a notch bug where the item doesn't update correctly. - boolean always = false; - // CraftBukkit end -+ // Spigot start -+ if ( player.activeContainer != player.defaultContainer ) -+ { -+ getPlayer().closeInventory(); -+ } -+ // Spigot end - - ItemStack itemstack = this.player.inventory.getItemInHand(); - boolean flag = false; -@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketPlayInListener { - return; - } - // Spigot End -+ // Spigot start -+ if ( player.activeContainer != player.defaultContainer ) -+ { -+ getPlayer().closeInventory(); -+ } -+ // Spigot end - - this.player.v(); - if (entity != null) { --- \ No newline at end of file diff --git a/CraftBukkit-Patches/0172-Remove-uneeded-validation.patch b/CraftBukkit-Patches/0171-Remove-uneeded-validation.patch similarity index 100% rename from CraftBukkit-Patches/0172-Remove-uneeded-validation.patch rename to CraftBukkit-Patches/0171-Remove-uneeded-validation.patch diff --git a/CraftBukkit-Patches/0173-Add-Hunger-Config-Values.patch b/CraftBukkit-Patches/0172-Add-Hunger-Config-Values.patch similarity index 100% rename from CraftBukkit-Patches/0173-Add-Hunger-Config-Values.patch rename to CraftBukkit-Patches/0172-Add-Hunger-Config-Values.patch diff --git a/CraftBukkit-Patches/0174-Make-debug-logging-togglable.patch b/CraftBukkit-Patches/0173-Make-debug-logging-togglable.patch similarity index 100% rename from CraftBukkit-Patches/0174-Make-debug-logging-togglable.patch rename to CraftBukkit-Patches/0173-Make-debug-logging-togglable.patch diff --git a/CraftBukkit-Patches/0175-Skip-invalid-enchants-in-CraftMetaItem.patch b/CraftBukkit-Patches/0174-Skip-invalid-enchants-in-CraftMetaItem.patch similarity index 100% rename from CraftBukkit-Patches/0175-Skip-invalid-enchants-in-CraftMetaItem.patch rename to CraftBukkit-Patches/0174-Skip-invalid-enchants-in-CraftMetaItem.patch diff --git a/CraftBukkit-Patches/0175-Limit-TNT-Detonations-per-tick.patch b/CraftBukkit-Patches/0175-Limit-TNT-Detonations-per-tick.patch new file mode 100644 index 000000000..beb310559 --- /dev/null +++ b/CraftBukkit-Patches/0175-Limit-TNT-Detonations-per-tick.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 20 Aug 2014 18:12:32 -0400 +Subject: [PATCH] Limit TNT Detonations per tick + +This gives a per-world control on how much TNT will be processed per-tick, +preventing a massive TNT detonation from lagging out the server. + +diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java ++++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java +@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity { + } + + public void h() { ++ if (world.spigotConfig.currentPrimedTnt++ > world.spigotConfig.maxTntTicksPerTick) { return; } // Spigot + this.lastX = this.locX; + this.lastY = this.locY; + this.lastZ = this.locZ; +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -0,0 +0,0 @@ public class WorldServer extends World { + } + + super.tickEntities(); ++ spigotConfig.currentPrimedTnt = 0; // Spigot + } + + public void i() { +diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java ++++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +@@ -0,0 +0,0 @@ public class SpigotWorldConfig + combatExhaustion = (float) getDouble( "hunger.combat-exhaustion", 0.3 ); + regenExhaustion = (float) getDouble( "hunger.regen-exhaustion", 3 ); + } ++ ++ public int currentPrimedTnt = 0; ++ public int maxTntTicksPerTick; ++ private void maxTntPerTick() { ++ if ( SpigotConfig.version < 7 ) ++ { ++ set( "max-tnt-per-tick", 100 ); ++ } ++ maxTntTicksPerTick = getInt( "max-tnt-per-tick", 100 ); ++ log( "Max TNT Explosions: " + maxTntTicksPerTick ); ++ } + } +-- \ No newline at end of file