diff --git a/Bukkit-Patches/0001-POM-Changes.patch b/Bukkit-Patches/0001-POM-Changes.patch index 9e68eda32b..f6d4126c4c 100644 --- a/Bukkit-Patches/0001-POM-Changes.patch +++ b/Bukkit-Patches/0001-POM-Changes.patch @@ -1,11 +1,11 @@ -From 43ea4b8812178c2ba6431f28b9b492138335538e Mon Sep 17 00:00:00 2001 +From a583c578d388bff0e1deb7c3aafd935cd9d1dbb5 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 2 Jun 2013 10:36:24 +1000 Subject: [PATCH] POM Changes diff --git a/pom.xml b/pom.xml -index a2bdfbc..70d5ff8 100644 +index c893bd2..a633a78 100644 --- a/pom.xml +++ b/pom.xml @@ -9,14 +9,14 @@ @@ -16,7 +16,7 @@ index a2bdfbc..70d5ff8 100644 - bukkit + org.spigotmc + spigot-api - 1.8.8-R0.1-SNAPSHOT + 1.9-SNAPSHOT jar - Bukkit @@ -29,5 +29,5 @@ index a2bdfbc..70d5ff8 100644 1.6 -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0002-Spigot-Timings.patch b/Bukkit-Patches/0002-Spigot-Timings.patch index 49cb2a6333..54ec4ef87d 100644 --- a/Bukkit-Patches/0002-Spigot-Timings.patch +++ b/Bukkit-Patches/0002-Spigot-Timings.patch @@ -1,4 +1,4 @@ -From ec04cd369a98a9016ae00a8237a9b5b5835528ab Mon Sep 17 00:00:00 2001 +From 307267c4b0b17ad241ae7ad8f8baf106a3408002 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 2 Jun 2013 10:42:57 +1000 Subject: [PATCH] Spigot Timings @@ -8,10 +8,10 @@ Adds performance tracking timings all around the Minecraft Server, and improves Plugins can track their own timings with CustomTimingsHandler diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index d7b88d6..818bfd4 100644 +index 2ace8c1..e61e50b 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -542,6 +542,7 @@ public final class Bukkit { +@@ -546,6 +546,7 @@ public final class Bukkit { */ public static void reload() { server.reload(); @@ -19,7 +19,7 @@ index d7b88d6..818bfd4 100644 } /** -@@ -1138,4 +1139,9 @@ public final class Bukkit { +@@ -1156,4 +1157,9 @@ public final class Bukkit { public static UnsafeValues getUnsafe() { return server.getUnsafe(); } @@ -30,10 +30,10 @@ index d7b88d6..818bfd4 100644 + } } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index c2f5de4..f4aa4a8 100644 +index 60bcec8..5ca4321 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -932,4 +932,15 @@ public interface Server extends PluginMessageRecipient { +@@ -948,4 +948,15 @@ public interface Server extends PluginMessageRecipient { */ @Deprecated UnsafeValues getUnsafe(); @@ -264,7 +264,7 @@ index a39ea5d..fc59aa3 100644 + // Spigot end } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index e51658d..1a61ad3 100644 +index 5a9e50d..c9d23d6 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -295,6 +295,7 @@ public final class SimplePluginManager implements PluginManager { @@ -496,5 +496,5 @@ index 0000000..8d98297 + } +} -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0003-Add-PlayerItemDamageEvent.patch b/Bukkit-Patches/0003-Add-PlayerItemDamageEvent.patch index c4b765e63b..38661ed65e 100644 --- a/Bukkit-Patches/0003-Add-PlayerItemDamageEvent.patch +++ b/Bukkit-Patches/0003-Add-PlayerItemDamageEvent.patch @@ -1,4 +1,4 @@ -From 2d16a2bd0871f1eb71f53b0f2949a99269f0dbda Mon Sep 17 00:00:00 2001 +From 654acca108839b65a772cce9154c6f177249256b Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 4 Mar 2013 18:31:20 +1100 Subject: [PATCH] Add PlayerItemDamageEvent @@ -65,5 +65,5 @@ index 0000000..38a72ab + } +} -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0004-BungeeCord-Support.patch b/Bukkit-Patches/0004-BungeeCord-Support.patch index 49ba757d77..1a3c117593 100644 --- a/Bukkit-Patches/0004-BungeeCord-Support.patch +++ b/Bukkit-Patches/0004-BungeeCord-Support.patch @@ -1,18 +1,17 @@ -From b351cd2f9562eff94b8a32f0f3cf1c066cd48690 Mon Sep 17 00:00:00 2001 +From 8f696725c1b35a064cd4fed84209f226b342b3f7 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 2 Jun 2013 15:20:49 +1000 Subject: [PATCH] BungeeCord Support diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 1b54b48..ced2d6b 100644 +index 723464b..6444fdf 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1076,4 +1076,23 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -1272,4 +1272,22 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline */ - @Deprecated - public void resetTitle(); -+ + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); + + // Spigot start + public class Spigot extends Entity.Spigot + { @@ -99,5 +98,5 @@ index 68834dd..4bc024f 100644 * Gets the current result of the login, as an enum * -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0005-Add-Arrow-API.patch b/Bukkit-Patches/0005-Add-Arrow-API.patch index 6ed550fef7..0829a0ce0a 100644 --- a/Bukkit-Patches/0005-Add-Arrow-API.patch +++ b/Bukkit-Patches/0005-Add-Arrow-API.patch @@ -1,4 +1,4 @@ -From 5a6f3e6ac8d2c3b6a5600e89231a293af7ce03c8 Mon Sep 17 00:00:00 2001 +From 52741b1442b0a31830c4fc0fed12941f4952e1ff Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 2 Jun 2013 15:08:24 +1000 Subject: [PATCH] Add Arrow API @@ -30,5 +30,5 @@ index e49eef0..e7a32f7 100644 + Spigot spigot(); } -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0006-Add-Particle-API.patch b/Bukkit-Patches/0006-Add-Particle-API.patch index 542f0388c6..8a24c7df5f 100644 --- a/Bukkit-Patches/0006-Add-Particle-API.patch +++ b/Bukkit-Patches/0006-Add-Particle-API.patch @@ -1,4 +1,4 @@ -From b46e9679728dcaa4782c6ce491897cfc8c978ab2 Mon Sep 17 00:00:00 2001 +From b7f4ea781b3c25795d0e7634b088c70265d6d0cc Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 2 Jun 2013 15:57:09 +1000 Subject: [PATCH] Add Particle API @@ -271,10 +271,10 @@ index 2474a2d..37f29e2 100644 + public enum Type {SOUND, VISUAL, PARTICLE} } diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 127ad9d..6613286 100644 +index 5cc1fec..5ce8f05 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -1183,6 +1183,56 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1159,6 +1159,56 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public boolean isGameRule(String rule); @@ -332,10 +332,10 @@ index 127ad9d..6613286 100644 * Gets the world border for this world. * diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index ced2d6b..c136208 100644 +index 6444fdf..77ddf68 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1091,6 +1091,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -1286,6 +1286,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline { throw new UnsupportedOperationException( "Not supported yet." ); } @@ -365,5 +365,5 @@ index 08aa71d..5217aec 100644 } } -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0007-Define-EntitySpawnEvent-and-SpawnerSpawnEvent.patch b/Bukkit-Patches/0007-Define-EntitySpawnEvent-and-SpawnerSpawnEvent.patch index a7517c4d0d..efc379199f 100644 --- a/Bukkit-Patches/0007-Define-EntitySpawnEvent-and-SpawnerSpawnEvent.patch +++ b/Bukkit-Patches/0007-Define-EntitySpawnEvent-and-SpawnerSpawnEvent.patch @@ -1,4 +1,4 @@ -From e982d761707c7b217a88c4f9238feeaeaba4858d Mon Sep 17 00:00:00 2001 +From 04ee5f8788f7610f2486fe64de77113c126dbba1 Mon Sep 17 00:00:00 2001 From: Andy Shulman Date: Mon, 15 Apr 2013 20:06:01 -0500 Subject: [PATCH] Define EntitySpawnEvent and SpawnerSpawnEvent @@ -6,11 +6,11 @@ Subject: [PATCH] Define EntitySpawnEvent and SpawnerSpawnEvent Defines EntitySpawnEvent and SpawnerSpawnEvent. Adds BUKKIT-267 and BUKKIT-1559 diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java -index 288e98b..8883157 100644 +index c035b37..9dd8ef1 100644 --- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java -@@ -4,17 +4,13 @@ import org.bukkit.Location; - import org.bukkit.entity.CreatureType; +@@ -3,17 +3,13 @@ package org.bukkit.event.entity; + import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; -import org.bukkit.event.Cancellable; @@ -28,8 +28,8 @@ index 288e98b..8883157 100644 private final SpawnReason spawnReason; public CreatureSpawnEvent(final LivingEntity spawnee, final SpawnReason spawnReason) { -@@ -28,29 +24,12 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable { - spawnReason = reason; +@@ -21,29 +17,12 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable { + this.spawnReason = spawnReason; } - public boolean isCancelled() { @@ -55,10 +55,10 @@ index 288e98b..8883157 100644 - } - - /** - * Gets the type of creature being spawned. + * Gets the reason for why the creature is being spawned. * - * @return A CreatureType value detailing the type of creature being -@@ -72,15 +51,6 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable { + * @return A SpawnReason value detailing the reason for the creature being +@@ -53,15 +32,6 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable { return spawnReason; } @@ -216,5 +216,5 @@ index 0000000..1acb3c4 + } +} -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0008-Entity-Mount-and-Dismount-Events.patch b/Bukkit-Patches/0008-Entity-Mount-and-Dismount-Events.patch index c894161363..4684f3460e 100644 --- a/Bukkit-Patches/0008-Entity-Mount-and-Dismount-Events.patch +++ b/Bukkit-Patches/0008-Entity-Mount-and-Dismount-Events.patch @@ -1,4 +1,4 @@ -From 246b47b22a286b0e8bd36082f636a6edeb3d7284 Mon Sep 17 00:00:00 2001 +From a9eaefd368301b5c4864045a44fa1342ae68268f Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 2 Jul 2013 20:32:53 +1000 Subject: [PATCH] Entity Mount and Dismount Events @@ -108,5 +108,5 @@ index 0000000..16aa2a7 + } +} -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0009-InventoryClickEvent-getClickedInventory.patch b/Bukkit-Patches/0009-InventoryClickEvent-getClickedInventory.patch index c57ccf78f0..37738a03ce 100644 --- a/Bukkit-Patches/0009-InventoryClickEvent-getClickedInventory.patch +++ b/Bukkit-Patches/0009-InventoryClickEvent-getClickedInventory.patch @@ -1,4 +1,4 @@ -From 8a80ebccc9555a300c001caf8a8984f12a86f326 Mon Sep 17 00:00:00 2001 +From 079a3005be2ade43d449b78816220b755c8e2d10 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 7 Jul 2013 10:32:05 -0400 Subject: [PATCH] InventoryClickEvent getClickedInventory @@ -50,5 +50,5 @@ index 28198b8..3313d91 100644 * * @return the slot type -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0010-Added-getAllSessionData-to-the-Conversation-API.patch b/Bukkit-Patches/0010-Added-getAllSessionData-to-the-Conversation-API.patch index 9fb4893cee..b0874cda15 100644 --- a/Bukkit-Patches/0010-Added-getAllSessionData-to-the-Conversation-API.patch +++ b/Bukkit-Patches/0010-Added-getAllSessionData-to-the-Conversation-API.patch @@ -1,4 +1,4 @@ -From 0244c6a138d2d14eebedef0b3fa06570d1772e87 Mon Sep 17 00:00:00 2001 +From 80ef0d7b1087f5fe6f649ae203c725955572e767 Mon Sep 17 00:00:00 2001 From: Alex Bennett Date: Thu, 11 Jul 2013 15:31:32 -0500 Subject: [PATCH] Added getAllSessionData() to the Conversation API. @@ -24,5 +24,5 @@ index 4f33ff4..7390a77 100644 * this as a way to pass data through each Prompt as the conversation * develops. -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0011-Catch-Conversation-API-Errors.patch b/Bukkit-Patches/0011-Catch-Conversation-API-Errors.patch index b147a45ef5..7ca79d3096 100644 --- a/Bukkit-Patches/0011-Catch-Conversation-API-Errors.patch +++ b/Bukkit-Patches/0011-Catch-Conversation-API-Errors.patch @@ -1,4 +1,4 @@ -From f58f3bf04a2bb21880cc76e09196a57eddc44c6d Mon Sep 17 00:00:00 2001 +From 2a5b8a50c4a4f099b3c55f04fb67aa7167a0ab17 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 22 Jul 2013 19:09:43 +1000 Subject: [PATCH] Catch Conversation API Errors @@ -30,5 +30,5 @@ index d4c1f6d..46912c8 100644 /** -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0012-Player-Collision-API.patch b/Bukkit-Patches/0012-Player-Collision-API.patch index c43fb936eb..5fc715444a 100644 --- a/Bukkit-Patches/0012-Player-Collision-API.patch +++ b/Bukkit-Patches/0012-Player-Collision-API.patch @@ -1,14 +1,14 @@ -From 6cac32aab7e7270acc0c3a3802a833007301a755 Mon Sep 17 00:00:00 2001 +From 44dd38e7430e311b08d019670af02ba95edd264e Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 3 Aug 2013 19:20:50 +1000 Subject: [PATCH] Player Collision API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index c136208..2d054ba 100644 +index 77ddf68..146fbd4 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1096,6 +1096,27 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -1291,6 +1291,27 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline { throw new UnsupportedOperationException( "Not supported yet." ); } @@ -37,5 +37,5 @@ index c136208..2d054ba 100644 Spigot spigot(); -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0013-Expand-Boolean-Prompt-Values.patch b/Bukkit-Patches/0013-Expand-Boolean-Prompt-Values.patch index 825ea2cacc..3b86348365 100644 --- a/Bukkit-Patches/0013-Expand-Boolean-Prompt-Values.patch +++ b/Bukkit-Patches/0013-Expand-Boolean-Prompt-Values.patch @@ -1,4 +1,4 @@ -From cbb9593827fba7ecf040fab1fc0a0794a78345c2 Mon Sep 17 00:00:00 2001 +From 038d1beb08ab34c9ca9e184dec9fdc83887bb0f0 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 3 Aug 2013 19:42:16 +1000 Subject: [PATCH] Expand Boolean Prompt Values @@ -24,5 +24,5 @@ index 3f2c97f..81ef78c 100644 } -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0014-Add-Getter-for-Entity-Invulnerability.patch b/Bukkit-Patches/0014-Add-Getter-for-Entity-Invulnerability.patch index 45882b4297..c3e20db2b0 100644 --- a/Bukkit-Patches/0014-Add-Getter-for-Entity-Invulnerability.patch +++ b/Bukkit-Patches/0014-Add-Getter-for-Entity-Invulnerability.patch @@ -1,17 +1,17 @@ -From 3058e4ccec6de64c7c0a94fefecebaf76cae104c Mon Sep 17 00:00:00 2001 +From d5ab308d68818daf36befd871e7e2ace01d23479 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 3 Aug 2013 19:49:36 +1000 Subject: [PATCH] Add Getter for Entity Invulnerability diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index de7815f..7fb08af 100644 +index 6dc7076..9f4d48b 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -342,4 +342,22 @@ public interface Entity extends Metadatable, CommandSender { - * @return if the custom name is displayed +@@ -356,4 +356,22 @@ public interface Entity extends Metadatable, CommandSender { + * @return whether the entity is glowing */ - public boolean isCustomNameVisible(); + boolean isGlowing(); + + // Spigot Start + public class Spigot @@ -32,5 +32,5 @@ index de7815f..7fb08af 100644 + // Spigot End } -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0015-Add-respawn-API.patch b/Bukkit-Patches/0015-Add-respawn-API.patch index 789ef45772..1870668e3a 100644 --- a/Bukkit-Patches/0015-Add-respawn-API.patch +++ b/Bukkit-Patches/0015-Add-respawn-API.patch @@ -1,14 +1,14 @@ -From 76c4f71d40ca15b885666c5425f5b3c8a6269b26 Mon Sep 17 00:00:00 2001 +From 23765cfe217052f421684a8ba05260245d33b2ec Mon Sep 17 00:00:00 2001 From: ninja- Date: Tue, 8 Oct 2013 14:35:58 +0200 Subject: [PATCH] Add respawn API. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 2d054ba..b7f4e9e 100644 +index 146fbd4..a9bdfde 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1117,6 +1117,14 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -1312,6 +1312,14 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline { throw new UnsupportedOperationException( "Not supported yet." ); } @@ -24,5 +24,5 @@ index 2d054ba..b7f4e9e 100644 Spigot spigot(); -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0016-Fix-Plugin-Message-API-Disconnects.patch b/Bukkit-Patches/0016-Fix-Plugin-Message-API-Disconnects.patch index d8cc7ab587..df40f55873 100644 --- a/Bukkit-Patches/0016-Fix-Plugin-Message-API-Disconnects.patch +++ b/Bukkit-Patches/0016-Fix-Plugin-Message-API-Disconnects.patch @@ -1,4 +1,4 @@ -From 32283d1dd78f712e95675f00ae2241651ec87068 Mon Sep 17 00:00:00 2001 +From f0c7705947c6a451e14395327a4a99a8d410daf4 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 19 Oct 2013 12:59:42 +1100 Subject: [PATCH] Fix Plugin Message API Disconnects @@ -26,5 +26,5 @@ index a906f8d..4c171e8 100644 } -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0017-Fix-Tab-Completion-for-Some-Commands.patch b/Bukkit-Patches/0017-Fix-Tab-Completion-for-Some-Commands.patch index 0b8129b1e5..717108ba61 100644 --- a/Bukkit-Patches/0017-Fix-Tab-Completion-for-Some-Commands.patch +++ b/Bukkit-Patches/0017-Fix-Tab-Completion-for-Some-Commands.patch @@ -1,4 +1,4 @@ -From baf98de9c6282b4a8d61b2c853fd2fb070b9a180 Mon Sep 17 00:00:00 2001 +From c29cf606489a4e59e68a6c93e17200afe054c25d Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 24 Dec 2013 10:14:25 +1100 Subject: [PATCH] Fix Tab Completion for Some Commands @@ -81,5 +81,5 @@ index 7e5494d..e168b49 100644 + // Spigot End } -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0018-Implement-Locale-Getter-for-Players.patch b/Bukkit-Patches/0018-Implement-Locale-Getter-for-Players.patch index 304dbfe5ad..70e5dcd168 100644 --- a/Bukkit-Patches/0018-Implement-Locale-Getter-for-Players.patch +++ b/Bukkit-Patches/0018-Implement-Locale-Getter-for-Players.patch @@ -1,14 +1,14 @@ -From 32427451524d58b5096de3be5a98c1a9041dcacd Mon Sep 17 00:00:00 2001 +From ab2d9521139e82f956683828c60f506fdf6a0da2 Mon Sep 17 00:00:00 2001 From: Smove Date: Sat, 1 Feb 2014 18:10:49 +1100 Subject: [PATCH] Implement Locale Getter for Players diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index b7f4e9e..41b7b3c 100644 +index a9bdfde..43ef5b1 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1125,6 +1125,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -1320,6 +1320,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline { throw new UnsupportedOperationException( "Not supported yet." ); } @@ -26,5 +26,5 @@ index b7f4e9e..41b7b3c 100644 Spigot spigot(); -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0019-Add-support-for-fetching-hidden-players.patch b/Bukkit-Patches/0019-Add-support-for-fetching-hidden-players.patch index bcf9603930..82cbb93a3e 100644 --- a/Bukkit-Patches/0019-Add-support-for-fetching-hidden-players.patch +++ b/Bukkit-Patches/0019-Add-support-for-fetching-hidden-players.patch @@ -1,14 +1,14 @@ -From ced760bab62605d3cccbf4886a70d3d9f0e272a5 Mon Sep 17 00:00:00 2001 +From c5fe30d39567423a3ad99602b7b16e9fea60de23 Mon Sep 17 00:00:00 2001 From: Tux Date: Sun, 9 Feb 2014 14:02:11 -0500 Subject: [PATCH] Add support for fetching hidden players diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 41b7b3c..0f59c07 100644 +index 43ef5b1..eb5084b 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1135,6 +1135,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -1330,6 +1330,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline { throw new UnsupportedOperationException( "Not supported yet." ); } @@ -26,5 +26,5 @@ index 41b7b3c..0f59c07 100644 Spigot spigot(); -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0020-Silenceable-Lightning-API.patch b/Bukkit-Patches/0020-Silenceable-Lightning-API.patch index 9db001c3f0..689866c029 100644 --- a/Bukkit-Patches/0020-Silenceable-Lightning-API.patch +++ b/Bukkit-Patches/0020-Silenceable-Lightning-API.patch @@ -1,14 +1,14 @@ -From b7f82738214b66303a80cf45d071c43cefce2e4c Mon Sep 17 00:00:00 2001 +From 9a96f7e60f3b3f14e8b93ced586c7dd7382aa18d Mon Sep 17 00:00:00 2001 From: drXor Date: Sun, 23 Feb 2014 16:16:29 -0400 Subject: [PATCH] Silenceable Lightning API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 6613286..2772b09 100644 +index 5ce8f05..4125633 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -1228,6 +1228,30 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1204,6 +1204,30 @@ public interface World extends PluginMessageRecipient, Metadatable { { throw new UnsupportedOperationException( "Not supported yet." ); } @@ -66,5 +66,5 @@ index c8b5154..1ed4ac9 100644 + Spigot spigot(); } -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0021-Remove-deprecation-on-some-player-lookup-methods.patch b/Bukkit-Patches/0021-Remove-deprecation-on-some-player-lookup-methods.patch index fa4ea0bc13..8c2f47c126 100644 --- a/Bukkit-Patches/0021-Remove-deprecation-on-some-player-lookup-methods.patch +++ b/Bukkit-Patches/0021-Remove-deprecation-on-some-player-lookup-methods.patch @@ -1,4 +1,4 @@ -From 986a5a9ab066bf672dfba0e657c47830768bc5a9 Mon Sep 17 00:00:00 2001 +From f539a053099a090b756663ea24cb1138e398501a Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 30 Mar 2014 15:58:22 +1100 Subject: [PATCH] Remove deprecation on some player lookup methods @@ -6,10 +6,10 @@ Subject: [PATCH] Remove deprecation on some player lookup methods Most of these methods still have plenty of use given that only one player with each name can exist at a time. Deprecating these methods renders even basic functionality such as /msg impossible without causing compiler warnings. We will maintain this API and it should be considered safe and appropriate for most use cases. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 818bfd4..584fe11 100644 +index e61e50b..dc2c9d1 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -373,12 +373,9 @@ public final class Bukkit { +@@ -377,12 +377,9 @@ public final class Bukkit { *

* This method may not return objects for offline players. * @@ -22,7 +22,7 @@ index 818bfd4..584fe11 100644 public static Player getPlayer(String name) { return server.getPlayer(name); } -@@ -386,12 +383,9 @@ public final class Bukkit { +@@ -390,12 +387,9 @@ public final class Bukkit { /** * Gets the player with the exact given name, case insensitive. * @@ -35,7 +35,7 @@ index 818bfd4..584fe11 100644 public static Player getPlayerExact(String name) { return server.getPlayerExact(name); } -@@ -403,12 +397,9 @@ public final class Bukkit { +@@ -407,12 +401,9 @@ public final class Bukkit { * This list is not sorted in any particular order. If an exact match is * found, the returned list will only contain a single result. * @@ -49,10 +49,10 @@ index 818bfd4..584fe11 100644 return server.matchPlayer(name); } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index f4aa4a8..65bf845 100644 +index 5ca4321..cdccaf3 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -309,23 +309,17 @@ public interface Server extends PluginMessageRecipient { +@@ -313,23 +313,17 @@ public interface Server extends PluginMessageRecipient { *

* This method may not return objects for offline players. * @@ -76,7 +76,7 @@ index f4aa4a8..65bf845 100644 public Player getPlayerExact(String name); /** -@@ -335,12 +329,9 @@ public interface Server extends PluginMessageRecipient { +@@ -339,12 +333,9 @@ public interface Server extends PluginMessageRecipient { * This list is not sorted in any particular order. If an exact match is * found, the returned list will only contain a single result. * @@ -90,5 +90,5 @@ index f4aa4a8..65bf845 100644 /** -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0022-Add-Score.isScoreSet-Z-API.patch b/Bukkit-Patches/0022-Add-Score.isScoreSet-Z-API.patch index 016cb4767a..2a11a24c75 100644 --- a/Bukkit-Patches/0022-Add-Score.isScoreSet-Z-API.patch +++ b/Bukkit-Patches/0022-Add-Score.isScoreSet-Z-API.patch @@ -1,4 +1,4 @@ -From e9305a7a4988acd7f73e0c444d1237409bb51db4 Mon Sep 17 00:00:00 2001 +From d16c4523a2ceb4982d61f4ab9de0de7c8365e36b Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 17 Apr 2014 19:35:13 +1000 Subject: [PATCH] Add Score.isScoreSet()Z API. @@ -27,5 +27,5 @@ index 4c10346..2410cbd 100644 * Gets the scoreboard for the associated objective. * -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0023-Add-PlayerSpawnLocationEvent.patch b/Bukkit-Patches/0023-Add-PlayerSpawnLocationEvent.patch index b28ea88050..721e692855 100644 --- a/Bukkit-Patches/0023-Add-PlayerSpawnLocationEvent.patch +++ b/Bukkit-Patches/0023-Add-PlayerSpawnLocationEvent.patch @@ -1,4 +1,4 @@ -From 5a4a84f14e3fc0cb1b60b6d8d9e5b65055e107a9 Mon Sep 17 00:00:00 2001 +From d4bf4914fbad3a515eee90f86b75c1ed0c4a6897 Mon Sep 17 00:00:00 2001 From: ninja Date: Tue, 8 Apr 2014 14:01:32 +0200 Subject: [PATCH] Add PlayerSpawnLocationEvent. @@ -61,5 +61,5 @@ index 0000000..dd3f58c + } +} -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0024-Ease-ClassLoader-Deadlocks-Where-Possible.patch b/Bukkit-Patches/0024-Ease-ClassLoader-Deadlocks-Where-Possible.patch index 321424efbd..4e2844b7ff 100644 --- a/Bukkit-Patches/0024-Ease-ClassLoader-Deadlocks-Where-Possible.patch +++ b/Bukkit-Patches/0024-Ease-ClassLoader-Deadlocks-Where-Possible.patch @@ -1,4 +1,4 @@ -From 39d5351db6c384a64b5de29d3ebc45ceb4fbcee7 Mon Sep 17 00:00:00 2001 +From 0c39657113b2d277479e3d54af0d629adb382b64 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 16 Jul 2014 17:24:21 +1000 Subject: [PATCH] Ease ClassLoader Deadlocks Where Possible @@ -63,5 +63,5 @@ index 13f8633..4cffa13 100644 super(new URL[] {file.toURI().toURL()}, parent); Validate.notNull(loader, "Loader cannot be null"); -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0025-Fix-slow-tab-complete-for-some-commands.patch b/Bukkit-Patches/0025-Fix-slow-tab-complete-for-some-commands.patch index aef256e9f1..05f2395942 100644 --- a/Bukkit-Patches/0025-Fix-slow-tab-complete-for-some-commands.patch +++ b/Bukkit-Patches/0025-Fix-slow-tab-complete-for-some-commands.patch @@ -1,4 +1,4 @@ -From f68a6b171088758dfab21917b1028246fcbfd6af Mon Sep 17 00:00:00 2001 +From f0d5641078f99b04e23d73e262a8c333a738ec35 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 22 Jul 2014 21:01:32 +1000 Subject: [PATCH] Fix slow tab complete for some commands. @@ -19,5 +19,5 @@ index 92de43c..855f560 100644 if (StringUtil.startsWithIgnoreCase(name, args[1]) && !player.isWhitelisted()) { completions.add(name); -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0026-Undeprecate-Player-updateInventory-V.patch b/Bukkit-Patches/0026-Undeprecate-Player-updateInventory-V.patch index 43cdf1e212..79ccd23de0 100644 --- a/Bukkit-Patches/0026-Undeprecate-Player-updateInventory-V.patch +++ b/Bukkit-Patches/0026-Undeprecate-Player-updateInventory-V.patch @@ -1,14 +1,14 @@ -From 9cb8116240b7afad0bf933eae153b6c61daf6921 Mon Sep 17 00:00:00 2001 +From 00c7ee3cabfe5725c8a1b466cca6cdf7a6e61f01 Mon Sep 17 00:00:00 2001 From: drXor Date: Wed, 23 Jul 2014 15:50:36 -0400 Subject: [PATCH] Undeprecate Player#updateInventory()V diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 0f59c07..d429074 100644 +index eb5084b..a89df18 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -333,10 +333,8 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -334,10 +334,8 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline /** * Forces an update of the player's entire inventory. * @@ -21,5 +21,5 @@ index 0f59c07..d429074 100644 /** -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0027-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch b/Bukkit-Patches/0027-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch index 25b0917fc9..5e7b6b8d44 100644 --- a/Bukkit-Patches/0027-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch +++ b/Bukkit-Patches/0027-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch @@ -1,4 +1,4 @@ -From d4f00fcaa6e46a323a4e5a11427fd76ff80df8e2 Mon Sep 17 00:00:00 2001 +From f36cbb4943bd6515cb4b1192c6243223a3d3290f Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 22 Aug 2014 05:31:04 -0400 Subject: [PATCH] Added isUnbreakable and setUnbreakable to ItemMeta @@ -42,5 +42,5 @@ index 459e09c..d8cc821 100644 + // Spigot end } -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0028-BungeeCord-Chat-API.patch b/Bukkit-Patches/0028-BungeeCord-Chat-API.patch index 25f52bd2b2..7ce1083b03 100644 --- a/Bukkit-Patches/0028-BungeeCord-Chat-API.patch +++ b/Bukkit-Patches/0028-BungeeCord-Chat-API.patch @@ -1,11 +1,11 @@ -From 7aea279e8606e39d6d025b915de7d6d1ef01358f Mon Sep 17 00:00:00 2001 +From d67111c349697a604e4f0d42987c1f2cf6f54d2c Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 13 Dec 2014 12:59:14 +1100 Subject: [PATCH] BungeeCord Chat API diff --git a/pom.xml b/pom.xml -index 70d5ff8..cb142f2 100644 +index 0a4aa07..bad3e43 100644 --- a/pom.xml +++ b/pom.xml @@ -83,6 +83,14 @@ @@ -268,10 +268,10 @@ index b8872b4..adbae51 100644 * Gets the char value associated with this color * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 65bf845..7aa374f 100644 +index cdccaf3..1ae5e96 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -931,6 +931,24 @@ public interface Server extends PluginMessageRecipient { +@@ -947,6 +947,24 @@ public interface Server extends PluginMessageRecipient { { throw new UnsupportedOperationException( "Not supported yet." ); } @@ -297,10 +297,10 @@ index 65bf845..7aa374f 100644 Spigot spigot(); diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index d429074..9508e84 100644 +index a89df18..dc58bea 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1143,6 +1143,24 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline +@@ -1338,6 +1338,24 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline { throw new UnsupportedOperationException( "Not supported yet." ); } @@ -326,5 +326,5 @@ index d429074..9508e84 100644 Spigot spigot(); -- -2.1.4 +2.5.0 diff --git a/Bukkit-Patches/0029-Add-restart-API.patch b/Bukkit-Patches/0029-Add-restart-API.patch index 2d1ace2216..bcfe6c3089 100644 --- a/Bukkit-Patches/0029-Add-restart-API.patch +++ b/Bukkit-Patches/0029-Add-restart-API.patch @@ -1,14 +1,14 @@ -From 948e11f2b713bbda226ef75d98763a488ffeaecb Mon Sep 17 00:00:00 2001 +From aec4742c4696be1fb949189ddd4c02fd20bdaa00 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 13 Jul 2015 19:10:15 +1000 Subject: [PATCH] Add restart API. diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 7aa374f..169008a 100644 +index 1ae5e96..69720e9 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -949,6 +949,13 @@ public interface Server extends PluginMessageRecipient { +@@ -965,6 +965,13 @@ public interface Server extends PluginMessageRecipient { public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); } @@ -23,5 +23,5 @@ index 7aa374f..169008a 100644 Spigot spigot(); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0001-POM-Changes.patch b/CraftBukkit-Patches/0001-POM-Changes.patch index 96335719d3..7619c5f34e 100644 --- a/CraftBukkit-Patches/0001-POM-Changes.patch +++ b/CraftBukkit-Patches/0001-POM-Changes.patch @@ -1,4 +1,4 @@ -From 2bb58d91916cf4390bef54569377f5623dbead53 Mon Sep 17 00:00:00 2001 +From efc8adeba61da66aec88152cd8b7b4a740bc632c Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 2 Jul 2013 13:07:39 +1000 Subject: [PATCH] POM Changes @@ -6,7 +6,7 @@ Subject: [PATCH] POM Changes Basic changes to the build system which mark the artifact as Spigot, and the necessary code changes to ensure proper functionality. Also disables the auto updater provided by CraftBukkit as it is useless to us. diff --git a/pom.xml b/pom.xml -index f1fb28f..91627ff 100644 +index 5afb2b8..953cdbc 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,12 @@ @@ -18,7 +18,7 @@ index f1fb28f..91627ff 100644 + org.spigotmc + spigot jar - 1.8.8-R0.1-SNAPSHOT + 1.9-SNAPSHOT - CraftBukkit - http://www.bukkit.org + Spigot @@ -26,7 +26,7 @@ index f1fb28f..91627ff 100644 UTF-8 -@@ -20,10 +20,22 @@ +@@ -19,10 +19,17 @@ 1.6 @@ -41,24 +41,24 @@ index f1fb28f..91627ff 100644 - org.bukkit - bukkit ++ org.spigotmc ++ spigot-api + ${project.version} + compile + +@@ -56,6 +63,11 @@ + 5.1.37 + compile + ++ + net.sf.trove4j + trove4j + 3.0.3 + -+ -+ org.spigotmc -+ spigot-api - ${project.version} - jar - compile -@@ -88,17 +100,32 @@ - - - -- clean install -+ install - - + + + junit +@@ -86,11 +98,26 @@ net.md-5 scriptus 0.2 @@ -88,7 +88,7 @@ index f1fb28f..91627ff 100644 initialize describe -@@ -115,7 +142,7 @@ +@@ -107,7 +134,7 @@ org.bukkit.craftbukkit.Main CraftBukkit @@ -111,5 +111,5 @@ index f905d17..9304637 100644 if (stream != null) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0003-Skeleton-API-Implementations.patch b/CraftBukkit-Patches/0002-Skeleton-API-Implementations.patch similarity index 88% rename from CraftBukkit-Patches/0003-Skeleton-API-Implementations.patch rename to CraftBukkit-Patches/0002-Skeleton-API-Implementations.patch index b38f041211..0441f7b22d 100644 --- a/CraftBukkit-Patches/0003-Skeleton-API-Implementations.patch +++ b/CraftBukkit-Patches/0002-Skeleton-API-Implementations.patch @@ -1,4 +1,4 @@ -From 3d3e6d4cc0b9781591c399fdd5a187fb21f06348 Mon Sep 17 00:00:00 2001 +From 13ab33d4e7852bc53e1c51bac7a312b25e041503 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 2 Jun 2013 15:10:56 +1000 Subject: [PATCH] Skeleton API Implementations @@ -6,10 +6,10 @@ Subject: [PATCH] Skeleton API Implementations This contains the basic, empty implementations for some Spigot-API extensions. They are included early in the patching progress so that compilation will still succeed midway despite the APIs only being provided by subsequent patches. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 82a41b0..5377181 100644 +index d330226..6b37266 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1642,4 +1642,14 @@ public final class CraftServer implements Server { +@@ -1653,4 +1653,14 @@ public final class CraftServer implements Server { public UnsafeValues getUnsafe() { return CraftMagicNumbers.INSTANCE; } @@ -25,10 +25,10 @@ index 82a41b0..5377181 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 2bbbdd3..ff01a2d 100644 +index 45b5de6..3777f40 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1380,4 +1380,14 @@ public class CraftWorld implements World { +@@ -1451,4 +1451,14 @@ public class CraftWorld implements World { cps.queueUnload(chunk.locX, chunk.locZ); } } @@ -64,12 +64,12 @@ index dca8520..bf48e6e 100644 + // Spigot end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 5693e3a..4c0ac67 100644 +index 22d08a2..97dfc54 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -538,4 +538,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { - public void setOp(boolean value) { - perm.setOp(value); +@@ -555,4 +555,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { + public boolean isGlowing() { + return getHandle().glowing; } + + // Spigot start @@ -104,12 +104,12 @@ index 64e346d..243e8e5 100644 + // Spigot end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 40f52f1..e823f72 100644 +index fb81a28..2c3ee37 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1340,4 +1340,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - PacketPlayOutTitle packetReset = new PacketPlayOutTitle(EnumTitleAction.RESET, null); - getHandle().playerConnection.sendPacket(packetReset); +@@ -1406,4 +1406,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + getHandle().playerConnection.sendPacket(packetplayoutworldparticles); + } + + // Spigot start @@ -161,5 +161,5 @@ index d3ae91b..0b71b53 100644 + // Spigot end } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0002-mc-dev-imports.patch b/CraftBukkit-Patches/0003-mc-dev-imports.patch similarity index 68% rename from CraftBukkit-Patches/0002-mc-dev-imports.patch rename to CraftBukkit-Patches/0003-mc-dev-imports.patch index 690cef1ce8..b0cc8470da 100644 --- a/CraftBukkit-Patches/0002-mc-dev-imports.patch +++ b/CraftBukkit-Patches/0003-mc-dev-imports.patch @@ -1,4 +1,4 @@ -From 53f6a9f493204f2c521e776e3faff4252b1ba69b Mon Sep 17 00:00:00 2001 +From 8e5e19fbbd923c11ef5ac57bfb402a1237bd614a Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 1 Dec 2013 15:10:48 +1100 Subject: [PATCH] mc-dev imports @@ -48,41 +48,56 @@ index 0000000..13602f0 +} diff --git a/src/main/java/net/minecraft/server/BlockAnvil.java b/src/main/java/net/minecraft/server/BlockAnvil.java new file mode 100644 -index 0000000..43b1d00 +index 0000000..3199e5c --- /dev/null +++ b/src/main/java/net/minecraft/server/BlockAnvil.java -@@ -0,0 +1,108 @@ +@@ -0,0 +1,122 @@ +package net.minecraft.server; + -+import com.google.common.base.Predicate; ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; + +public class BlockAnvil extends BlockFalling { + -+ public static final BlockStateDirection FACING = BlockStateDirection.of("facing", (Predicate) EnumDirection.EnumDirectionLimit.HORIZONTAL); ++ public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING; + public static final BlockStateInteger DAMAGE = BlockStateInteger.of("damage", 0, 2); ++ protected static final AxisAlignedBB c = new AxisAlignedBB(0.0D, 0.0D, 0.125D, 1.0D, 1.0D, 0.875D); ++ protected static final AxisAlignedBB d = new AxisAlignedBB(0.125D, 0.0D, 0.0D, 0.875D, 1.0D, 1.0D); ++ protected static final Logger e = LogManager.getLogger(); + + protected BlockAnvil() { + super(Material.HEAVY); -+ this.j(this.blockStateList.getBlockData().set(BlockAnvil.FACING, EnumDirection.NORTH).set(BlockAnvil.DAMAGE, Integer.valueOf(0))); -+ this.e(0); ++ this.w(this.blockStateList.getBlockData().set(BlockAnvil.FACING, EnumDirection.NORTH).set(BlockAnvil.DAMAGE, Integer.valueOf(0))); ++ this.d(0); + this.a(CreativeModeTab.c); + } + -+ public boolean d() { ++ public boolean c(IBlockData iblockdata) { + return false; + } + -+ public boolean c() { ++ public boolean b(IBlockData iblockdata) { + return false; + } + + public IBlockData getPlacedState(World world, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2, int i, EntityLiving entityliving) { + EnumDirection enumdirection1 = entityliving.getDirection().e(); + -+ return super.getPlacedState(world, blockposition, enumdirection, f, f1, f2, i, entityliving).set(BlockAnvil.FACING, enumdirection1).set(BlockAnvil.DAMAGE, Integer.valueOf(i >> 2)); ++ try { ++ return super.getPlacedState(world, blockposition, enumdirection, f, f1, f2, i, entityliving).set(BlockAnvil.FACING, enumdirection1).set(BlockAnvil.DAMAGE, Integer.valueOf(i >> 2)); ++ } catch (IllegalArgumentException illegalargumentexception) { ++ if (!world.isClientSide) { ++ BlockAnvil.e.warn(String.format("Invalid damage property for anvil at %s. Found %d, must be in [0, 1, 2]", new Object[] { blockposition, Integer.valueOf(i >> 2)})); ++ if (entityliving instanceof EntityHuman) { ++ ((EntityHuman) entityliving).sendMessage(new ChatMessage("Invalid damage property. Please pick in [0, 1, 2]", new Object[0])); ++ } ++ } ++ ++ return super.getPlacedState(world, blockposition, enumdirection, f, f1, f2, 0, entityliving).set(BlockAnvil.FACING, enumdirection1).set(BlockAnvil.DAMAGE, Integer.valueOf(0)); ++ } + } + -+ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumDirection enumdirection, float f, float f1, float f2) { ++ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) { + if (!world.isClientSide) { + entityhuman.openTileEntity(new BlockAnvil.TileEntityContainerAnvil(world, blockposition)); + } @@ -94,15 +109,10 @@ index 0000000..43b1d00 + return ((Integer) iblockdata.get(BlockAnvil.DAMAGE)).intValue(); + } + -+ public void updateShape(IBlockAccess iblockaccess, BlockPosition blockposition) { -+ EnumDirection enumdirection = (EnumDirection) iblockaccess.getType(blockposition).get(BlockAnvil.FACING); -+ -+ if (enumdirection.k() == EnumDirection.EnumAxis.X) { -+ this.a(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F); -+ } else { -+ this.a(0.125F, 0.0F, 0.0F, 0.875F, 1.0F, 1.0F); -+ } ++ public AxisAlignedBB a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) { ++ EnumDirection enumdirection = (EnumDirection) iblockdata.get(BlockAnvil.FACING); + ++ return enumdirection.k() == EnumDirection.EnumAxis.X ? BlockAnvil.c : BlockAnvil.d; + } + + protected void a(EntityFallingBlock entityfallingblock) { @@ -110,7 +120,7 @@ index 0000000..43b1d00 + } + + public void a_(World world, BlockPosition blockposition) { -+ world.triggerEffect(1022, blockposition, 0); ++ world.triggerEffect(1031, blockposition, 0); + } + + public IBlockData fromLegacyData(int i) { @@ -119,12 +129,16 @@ index 0000000..43b1d00 + + public int toLegacyData(IBlockData iblockdata) { + byte b0 = 0; -+ int i = b0 | ((EnumDirection) iblockdata.get(BlockAnvil.FACING)).b(); ++ int i = b0 | ((EnumDirection) iblockdata.get(BlockAnvil.FACING)).get2DRotationValue(); + + i |= ((Integer) iblockdata.get(BlockAnvil.DAMAGE)).intValue() << 2; + return i; + } + ++ public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { ++ return iblockdata.getBlock() != this ? iblockdata : iblockdata.set(BlockAnvil.FACING, enumblockrotation.a((EnumDirection) iblockdata.get(BlockAnvil.FACING))); ++ } ++ + protected BlockStateList getStateList() { + return new BlockStateList(this, new IBlockState[] { BlockAnvil.FACING, BlockAnvil.DAMAGE}); + } @@ -162,56 +176,56 @@ index 0000000..43b1d00 +} diff --git a/src/main/java/net/minecraft/server/BlockBrewingStand.java b/src/main/java/net/minecraft/server/BlockBrewingStand.java new file mode 100644 -index 0000000..0bb2b50 +index 0000000..2e6c63d --- /dev/null +++ b/src/main/java/net/minecraft/server/BlockBrewingStand.java -@@ -0,0 +1,119 @@ +@@ -0,0 +1,123 @@ +package net.minecraft.server; + +import java.util.List; +import java.util.Random; + -+public class BlockBrewingStand extends BlockContainer { ++public class BlockBrewingStand extends BlockTileEntity { + + public static final BlockStateBoolean[] HAS_BOTTLE = new BlockStateBoolean[] { BlockStateBoolean.of("has_bottle_0"), BlockStateBoolean.of("has_bottle_1"), BlockStateBoolean.of("has_bottle_2")}; ++ protected static final AxisAlignedBB b = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D); ++ protected static final AxisAlignedBB c = new AxisAlignedBB(0.4375D, 0.0D, 0.4375D, 0.5625D, 0.875D, 0.5625D); + + public BlockBrewingStand() { + super(Material.ORE); -+ this.j(this.blockStateList.getBlockData().set(BlockBrewingStand.HAS_BOTTLE[0], Boolean.valueOf(false)).set(BlockBrewingStand.HAS_BOTTLE[1], Boolean.valueOf(false)).set(BlockBrewingStand.HAS_BOTTLE[2], Boolean.valueOf(false))); ++ this.w(this.blockStateList.getBlockData().set(BlockBrewingStand.HAS_BOTTLE[0], Boolean.valueOf(false)).set(BlockBrewingStand.HAS_BOTTLE[1], Boolean.valueOf(false)).set(BlockBrewingStand.HAS_BOTTLE[2], Boolean.valueOf(false))); + } + + public String getName() { + return LocaleI18n.get("item.brewingStand.name"); + } + -+ public boolean c() { ++ public boolean b(IBlockData iblockdata) { + return false; + } + -+ public int b() { -+ return 3; ++ public EnumRenderType a(IBlockData iblockdata) { ++ return EnumRenderType.MODEL; + } + + public TileEntity a(World world, int i) { + return new TileEntityBrewingStand(); + } + -+ public boolean d() { ++ public boolean c(IBlockData iblockdata) { + return false; + } + -+ public void a(World world, BlockPosition blockposition, IBlockData iblockdata, AxisAlignedBB axisalignedbb, List list, Entity entity) { -+ this.a(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.875F, 0.5625F); -+ super.a(world, blockposition, iblockdata, axisalignedbb, list, entity); -+ this.j(); -+ super.a(world, blockposition, iblockdata, axisalignedbb, list, entity); ++ public void a(IBlockData iblockdata, World world, BlockPosition blockposition, AxisAlignedBB axisalignedbb, List list, Entity entity) { ++ a(blockposition, axisalignedbb, list, BlockBrewingStand.c); ++ a(blockposition, axisalignedbb, list, BlockBrewingStand.b); + } + -+ public void j() { -+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); ++ public AxisAlignedBB a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) { ++ return BlockBrewingStand.b; + } + -+ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumDirection enumdirection, float f, float f1, float f2) { ++ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) { + if (world.isClientSide) { + return true; + } else { @@ -219,7 +233,7 @@ index 0000000..0bb2b50 + + if (tileentity instanceof TileEntityBrewingStand) { + entityhuman.openContainer((TileEntityBrewingStand) tileentity); -+ entityhuman.b(StatisticList.M); ++ entityhuman.b(StatisticList.O); + } + + return true; @@ -251,11 +265,15 @@ index 0000000..0bb2b50 + return Items.BREWING_STAND; + } + -+ public boolean isComplexRedstone() { ++ public ItemStack a(World world, BlockPosition blockposition, IBlockData iblockdata) { ++ return new ItemStack(Items.BREWING_STAND); ++ } ++ ++ public boolean isComplexRedstone(IBlockData iblockdata) { + return true; + } + -+ public int l(World world, BlockPosition blockposition) { ++ public int d(IBlockData iblockdata, World world, BlockPosition blockposition) { + return Container.a(world.getTileEntity(blockposition)); + } + @@ -285,456 +303,18 @@ index 0000000..0bb2b50 + return new BlockStateList(this, new IBlockState[] { BlockBrewingStand.HAS_BOTTLE[0], BlockBrewingStand.HAS_BOTTLE[1], BlockBrewingStand.HAS_BOTTLE[2]}); + } +} -diff --git a/src/main/java/net/minecraft/server/BlockFlowerPot.java b/src/main/java/net/minecraft/server/BlockFlowerPot.java -new file mode 100644 -index 0000000..fd77047 ---- /dev/null -+++ b/src/main/java/net/minecraft/server/BlockFlowerPot.java -@@ -0,0 +1,432 @@ -+package net.minecraft.server; -+ -+import java.util.Random; -+ -+public class BlockFlowerPot extends BlockContainer { -+ -+ public static final BlockStateInteger LEGACY_DATA = BlockStateInteger.of("legacy_data", 0, 15); -+ public static final BlockStateEnum CONTENTS = BlockStateEnum.of("contents", BlockFlowerPot.EnumFlowerPotContents.class); -+ -+ public BlockFlowerPot() { -+ super(Material.ORIENTABLE); -+ this.j(this.blockStateList.getBlockData().set(BlockFlowerPot.CONTENTS, BlockFlowerPot.EnumFlowerPotContents.EMPTY).set(BlockFlowerPot.LEGACY_DATA, Integer.valueOf(0))); -+ this.j(); -+ } -+ -+ public String getName() { -+ return LocaleI18n.get("item.flowerPot.name"); -+ } -+ -+ public void j() { -+ float f = 0.375F; -+ float f1 = f / 2.0F; -+ -+ this.a(0.5F - f1, 0.0F, 0.5F - f1, 0.5F + f1, f, 0.5F + f1); -+ } -+ -+ public boolean c() { -+ return false; -+ } -+ -+ public int b() { -+ return 3; -+ } -+ -+ public boolean d() { -+ return false; -+ } -+ -+ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumDirection enumdirection, float f, float f1, float f2) { -+ ItemStack itemstack = entityhuman.inventory.getItemInHand(); -+ -+ if (itemstack != null && itemstack.getItem() instanceof ItemBlock) { -+ TileEntityFlowerPot tileentityflowerpot = this.f(world, blockposition); -+ -+ if (tileentityflowerpot == null) { -+ return false; -+ } else if (tileentityflowerpot.b() != null) { -+ return false; -+ } else { -+ Block block = Block.asBlock(itemstack.getItem()); -+ -+ if (!this.a(block, itemstack.getData())) { -+ return false; -+ } else { -+ tileentityflowerpot.a(itemstack.getItem(), itemstack.getData()); -+ tileentityflowerpot.update(); -+ world.notify(blockposition); -+ entityhuman.b(StatisticList.T); -+ if (!entityhuman.abilities.canInstantlyBuild && --itemstack.count <= 0) { -+ entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null); -+ } -+ -+ return true; -+ } -+ } -+ } else { -+ return false; -+ } -+ } -+ -+ private boolean a(Block block, int i) { -+ return block != Blocks.YELLOW_FLOWER && block != Blocks.RED_FLOWER && block != Blocks.CACTUS && block != Blocks.BROWN_MUSHROOM && block != Blocks.RED_MUSHROOM && block != Blocks.SAPLING && block != Blocks.DEADBUSH ? block == Blocks.TALLGRASS && i == BlockLongGrass.EnumTallGrassType.FERN.a() : true; -+ } -+ -+ public int getDropData(World world, BlockPosition blockposition) { -+ TileEntityFlowerPot tileentityflowerpot = this.f(world, blockposition); -+ -+ return tileentityflowerpot != null && tileentityflowerpot.b() != null ? tileentityflowerpot.c() : 0; -+ } -+ -+ public boolean canPlace(World world, BlockPosition blockposition) { -+ return super.canPlace(world, blockposition) && World.a((IBlockAccess) world, blockposition.down()); -+ } -+ -+ public void doPhysics(World world, BlockPosition blockposition, IBlockData iblockdata, Block block) { -+ if (!World.a((IBlockAccess) world, blockposition.down())) { -+ this.b(world, blockposition, iblockdata, 0); -+ world.setAir(blockposition); -+ } -+ -+ } -+ -+ public void remove(World world, BlockPosition blockposition, IBlockData iblockdata) { -+ TileEntityFlowerPot tileentityflowerpot = this.f(world, blockposition); -+ -+ if (tileentityflowerpot != null && tileentityflowerpot.b() != null) { -+ a(world, blockposition, new ItemStack(tileentityflowerpot.b(), 1, tileentityflowerpot.c())); -+ } -+ -+ super.remove(world, blockposition, iblockdata); -+ } -+ -+ public void a(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) { -+ super.a(world, blockposition, iblockdata, entityhuman); -+ if (entityhuman.abilities.canInstantlyBuild) { -+ TileEntityFlowerPot tileentityflowerpot = this.f(world, blockposition); -+ -+ if (tileentityflowerpot != null) { -+ tileentityflowerpot.a((Item) null, 0); -+ } -+ } -+ -+ } -+ -+ public Item getDropType(IBlockData iblockdata, Random random, int i) { -+ return Items.FLOWER_POT; -+ } -+ -+ private TileEntityFlowerPot f(World world, BlockPosition blockposition) { -+ TileEntity tileentity = world.getTileEntity(blockposition); -+ -+ return tileentity instanceof TileEntityFlowerPot ? (TileEntityFlowerPot) tileentity : null; -+ } -+ -+ public TileEntity a(World world, int i) { -+ Object object = null; -+ int j = 0; -+ -+ switch (i) { -+ case 1: -+ object = Blocks.RED_FLOWER; -+ j = BlockFlowers.EnumFlowerVarient.POPPY.b(); -+ break; -+ -+ case 2: -+ object = Blocks.YELLOW_FLOWER; -+ break; -+ -+ case 3: -+ object = Blocks.SAPLING; -+ j = BlockWood.EnumLogVariant.OAK.a(); -+ break; -+ -+ case 4: -+ object = Blocks.SAPLING; -+ j = BlockWood.EnumLogVariant.SPRUCE.a(); -+ break; -+ -+ case 5: -+ object = Blocks.SAPLING; -+ j = BlockWood.EnumLogVariant.BIRCH.a(); -+ break; -+ -+ case 6: -+ object = Blocks.SAPLING; -+ j = BlockWood.EnumLogVariant.JUNGLE.a(); -+ break; -+ -+ case 7: -+ object = Blocks.RED_MUSHROOM; -+ break; -+ -+ case 8: -+ object = Blocks.BROWN_MUSHROOM; -+ break; -+ -+ case 9: -+ object = Blocks.CACTUS; -+ break; -+ -+ case 10: -+ object = Blocks.DEADBUSH; -+ break; -+ -+ case 11: -+ object = Blocks.TALLGRASS; -+ j = BlockLongGrass.EnumTallGrassType.FERN.a(); -+ break; -+ -+ case 12: -+ object = Blocks.SAPLING; -+ j = BlockWood.EnumLogVariant.ACACIA.a(); -+ break; -+ -+ case 13: -+ object = Blocks.SAPLING; -+ j = BlockWood.EnumLogVariant.DARK_OAK.a(); -+ } -+ -+ return new TileEntityFlowerPot(Item.getItemOf((Block) object), j); -+ } -+ -+ protected BlockStateList getStateList() { -+ return new BlockStateList(this, new IBlockState[] { BlockFlowerPot.CONTENTS, BlockFlowerPot.LEGACY_DATA}); -+ } -+ -+ public int toLegacyData(IBlockData iblockdata) { -+ return ((Integer) iblockdata.get(BlockFlowerPot.LEGACY_DATA)).intValue(); -+ } -+ -+ public IBlockData updateState(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) { -+ BlockFlowerPot.EnumFlowerPotContents blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.EMPTY; -+ TileEntity tileentity = iblockaccess.getTileEntity(blockposition); -+ -+ if (tileentity instanceof TileEntityFlowerPot) { -+ TileEntityFlowerPot tileentityflowerpot = (TileEntityFlowerPot) tileentity; -+ Item item = tileentityflowerpot.b(); -+ -+ if (item instanceof ItemBlock) { -+ int i = tileentityflowerpot.c(); -+ Block block = Block.asBlock(item); -+ -+ if (block == Blocks.SAPLING) { -+ switch (BlockFlowerPot.SyntheticClass_1.a[BlockWood.EnumLogVariant.a(i).ordinal()]) { -+ case 1: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.OAK_SAPLING; -+ break; -+ -+ case 2: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.SPRUCE_SAPLING; -+ break; -+ -+ case 3: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.BIRCH_SAPLING; -+ break; -+ -+ case 4: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.JUNGLE_SAPLING; -+ break; -+ -+ case 5: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.ACACIA_SAPLING; -+ break; -+ -+ case 6: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.DARK_OAK_SAPLING; -+ break; -+ -+ default: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.EMPTY; -+ } -+ } else if (block == Blocks.TALLGRASS) { -+ switch (i) { -+ case 0: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.DEAD_BUSH; -+ break; -+ -+ case 2: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.FERN; -+ break; -+ -+ default: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.EMPTY; -+ } -+ } else if (block == Blocks.YELLOW_FLOWER) { -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.DANDELION; -+ } else if (block == Blocks.RED_FLOWER) { -+ switch (BlockFlowerPot.SyntheticClass_1.b[BlockFlowers.EnumFlowerVarient.a(BlockFlowers.EnumFlowerType.RED, i).ordinal()]) { -+ case 1: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.POPPY; -+ break; -+ -+ case 2: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.BLUE_ORCHID; -+ break; -+ -+ case 3: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.ALLIUM; -+ break; -+ -+ case 4: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.HOUSTONIA; -+ break; -+ -+ case 5: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.RED_TULIP; -+ break; -+ -+ case 6: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.ORANGE_TULIP; -+ break; -+ -+ case 7: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.WHITE_TULIP; -+ break; -+ -+ case 8: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.PINK_TULIP; -+ break; -+ -+ case 9: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.OXEYE_DAISY; -+ break; -+ -+ default: -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.EMPTY; -+ } -+ } else if (block == Blocks.RED_MUSHROOM) { -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.MUSHROOM_RED; -+ } else if (block == Blocks.BROWN_MUSHROOM) { -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.MUSHROOM_BROWN; -+ } else if (block == Blocks.DEADBUSH) { -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.DEAD_BUSH; -+ } else if (block == Blocks.CACTUS) { -+ blockflowerpot_enumflowerpotcontents = BlockFlowerPot.EnumFlowerPotContents.CACTUS; -+ } -+ } -+ } -+ -+ return iblockdata.set(BlockFlowerPot.CONTENTS, blockflowerpot_enumflowerpotcontents); -+ } -+ -+ static class SyntheticClass_1 { -+ -+ static final int[] a; -+ static final int[] b = new int[BlockFlowers.EnumFlowerVarient.values().length]; -+ -+ static { -+ try { -+ BlockFlowerPot.SyntheticClass_1.b[BlockFlowers.EnumFlowerVarient.POPPY.ordinal()] = 1; -+ } catch (NoSuchFieldError nosuchfielderror) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.b[BlockFlowers.EnumFlowerVarient.BLUE_ORCHID.ordinal()] = 2; -+ } catch (NoSuchFieldError nosuchfielderror1) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.b[BlockFlowers.EnumFlowerVarient.ALLIUM.ordinal()] = 3; -+ } catch (NoSuchFieldError nosuchfielderror2) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.b[BlockFlowers.EnumFlowerVarient.HOUSTONIA.ordinal()] = 4; -+ } catch (NoSuchFieldError nosuchfielderror3) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.b[BlockFlowers.EnumFlowerVarient.RED_TULIP.ordinal()] = 5; -+ } catch (NoSuchFieldError nosuchfielderror4) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.b[BlockFlowers.EnumFlowerVarient.ORANGE_TULIP.ordinal()] = 6; -+ } catch (NoSuchFieldError nosuchfielderror5) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.b[BlockFlowers.EnumFlowerVarient.WHITE_TULIP.ordinal()] = 7; -+ } catch (NoSuchFieldError nosuchfielderror6) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.b[BlockFlowers.EnumFlowerVarient.PINK_TULIP.ordinal()] = 8; -+ } catch (NoSuchFieldError nosuchfielderror7) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.b[BlockFlowers.EnumFlowerVarient.OXEYE_DAISY.ordinal()] = 9; -+ } catch (NoSuchFieldError nosuchfielderror8) { -+ ; -+ } -+ -+ a = new int[BlockWood.EnumLogVariant.values().length]; -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.a[BlockWood.EnumLogVariant.OAK.ordinal()] = 1; -+ } catch (NoSuchFieldError nosuchfielderror9) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.a[BlockWood.EnumLogVariant.SPRUCE.ordinal()] = 2; -+ } catch (NoSuchFieldError nosuchfielderror10) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.a[BlockWood.EnumLogVariant.BIRCH.ordinal()] = 3; -+ } catch (NoSuchFieldError nosuchfielderror11) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.a[BlockWood.EnumLogVariant.JUNGLE.ordinal()] = 4; -+ } catch (NoSuchFieldError nosuchfielderror12) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.a[BlockWood.EnumLogVariant.ACACIA.ordinal()] = 5; -+ } catch (NoSuchFieldError nosuchfielderror13) { -+ ; -+ } -+ -+ try { -+ BlockFlowerPot.SyntheticClass_1.a[BlockWood.EnumLogVariant.DARK_OAK.ordinal()] = 6; -+ } catch (NoSuchFieldError nosuchfielderror14) { -+ ; -+ } -+ -+ } -+ } -+ -+ public static enum EnumFlowerPotContents implements INamable { -+ -+ EMPTY("empty"), POPPY("rose"), BLUE_ORCHID("blue_orchid"), ALLIUM("allium"), HOUSTONIA("houstonia"), RED_TULIP("red_tulip"), ORANGE_TULIP("orange_tulip"), WHITE_TULIP("white_tulip"), PINK_TULIP("pink_tulip"), OXEYE_DAISY("oxeye_daisy"), DANDELION("dandelion"), OAK_SAPLING("oak_sapling"), SPRUCE_SAPLING("spruce_sapling"), BIRCH_SAPLING("birch_sapling"), JUNGLE_SAPLING("jungle_sapling"), ACACIA_SAPLING("acacia_sapling"), DARK_OAK_SAPLING("dark_oak_sapling"), MUSHROOM_RED("mushroom_red"), MUSHROOM_BROWN("mushroom_brown"), DEAD_BUSH("dead_bush"), FERN("fern"), CACTUS("cactus"); -+ -+ private final String w; -+ -+ private EnumFlowerPotContents(String s) { -+ this.w = s; -+ } -+ -+ public String toString() { -+ return this.w; -+ } -+ -+ public String getName() { -+ return this.w; -+ } -+ } -+} diff --git a/src/main/java/net/minecraft/server/BlockHopper.java b/src/main/java/net/minecraft/server/BlockHopper.java new file mode 100644 -index 0000000..9f9b45d +index 0000000..e30a2bb --- /dev/null +++ b/src/main/java/net/minecraft/server/BlockHopper.java -@@ -0,0 +1,161 @@ +@@ -0,0 +1,169 @@ +package net.minecraft.server; + +import com.google.common.base.Predicate; +import java.util.List; + -+public class BlockHopper extends BlockContainer { ++public class BlockHopper extends BlockTileEntity { + + public static final BlockStateDirection FACING = BlockStateDirection.of("facing", new Predicate() { + public boolean a(EnumDirection enumdirection) { @@ -746,32 +326,28 @@ index 0000000..9f9b45d + } + }); + public static final BlockStateBoolean ENABLED = BlockStateBoolean.of("enabled"); ++ protected static final AxisAlignedBB c = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.625D, 1.0D); ++ protected static final AxisAlignedBB d = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.125D); ++ protected static final AxisAlignedBB e = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 1.0D, 1.0D); ++ protected static final AxisAlignedBB f = new AxisAlignedBB(0.875D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ protected static final AxisAlignedBB g = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.125D, 1.0D, 1.0D); + + public BlockHopper() { + super(Material.ORE, MaterialMapColor.m); -+ this.j(this.blockStateList.getBlockData().set(BlockHopper.FACING, EnumDirection.DOWN).set(BlockHopper.ENABLED, Boolean.valueOf(true))); ++ this.w(this.blockStateList.getBlockData().set(BlockHopper.FACING, EnumDirection.DOWN).set(BlockHopper.ENABLED, Boolean.valueOf(true))); + this.a(CreativeModeTab.d); -+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + -+ public void updateShape(IBlockAccess iblockaccess, BlockPosition blockposition) { -+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); ++ public AxisAlignedBB a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition) { ++ return BlockHopper.j; + } + -+ public void a(World world, BlockPosition blockposition, IBlockData iblockdata, AxisAlignedBB axisalignedbb, List list, Entity entity) { -+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); -+ super.a(world, blockposition, iblockdata, axisalignedbb, list, entity); -+ float f = 0.125F; -+ -+ this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); -+ super.a(world, blockposition, iblockdata, axisalignedbb, list, entity); -+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); -+ super.a(world, blockposition, iblockdata, axisalignedbb, list, entity); -+ this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -+ super.a(world, blockposition, iblockdata, axisalignedbb, list, entity); -+ this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); -+ super.a(world, blockposition, iblockdata, axisalignedbb, list, entity); -+ this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); ++ public void a(IBlockData iblockdata, World world, BlockPosition blockposition, AxisAlignedBB axisalignedbb, List list, Entity entity) { ++ a(blockposition, axisalignedbb, list, BlockHopper.c); ++ a(blockposition, axisalignedbb, list, BlockHopper.g); ++ a(blockposition, axisalignedbb, list, BlockHopper.f); ++ a(blockposition, axisalignedbb, list, BlockHopper.d); ++ a(blockposition, axisalignedbb, list, BlockHopper.e); + } + + public IBlockData getPlacedState(World world, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2, int i, EntityLiving entityliving) { @@ -800,11 +376,15 @@ index 0000000..9f9b45d + + } + ++ public boolean k(IBlockData iblockdata) { ++ return true; ++ } ++ + public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) { + this.e(world, blockposition, iblockdata); + } + -+ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumDirection enumdirection, float f, float f1, float f2) { ++ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) { + if (world.isClientSide) { + return true; + } else { @@ -812,7 +392,7 @@ index 0000000..9f9b45d + + if (tileentity instanceof TileEntityHopper) { + entityhuman.openContainer((TileEntityHopper) tileentity); -+ entityhuman.b(StatisticList.P); ++ entityhuman.b(StatisticList.R); + } + + return true; @@ -843,19 +423,19 @@ index 0000000..9f9b45d + super.remove(world, blockposition, iblockdata); + } + -+ public int b() { -+ return 3; ++ public EnumRenderType a(IBlockData iblockdata) { ++ return EnumRenderType.MODEL; + } + -+ public boolean d() { ++ public boolean c(IBlockData iblockdata) { + return false; + } + -+ public boolean c() { ++ public boolean b(IBlockData iblockdata) { + return false; + } + -+ public static EnumDirection b(int i) { ++ public static EnumDirection e(int i) { + return EnumDirection.fromType1(i & 7); + } + @@ -863,16 +443,16 @@ index 0000000..9f9b45d + return (i & 8) != 8; + } + -+ public boolean isComplexRedstone() { ++ public boolean isComplexRedstone(IBlockData iblockdata) { + return true; + } + -+ public int l(World world, BlockPosition blockposition) { ++ public int d(IBlockData iblockdata, World world, BlockPosition blockposition) { + return Container.a(world.getTileEntity(blockposition)); + } + + public IBlockData fromLegacyData(int i) { -+ return this.getBlockData().set(BlockHopper.FACING, b(i)).set(BlockHopper.ENABLED, Boolean.valueOf(f(i))); ++ return this.getBlockData().set(BlockHopper.FACING, e(i)).set(BlockHopper.ENABLED, Boolean.valueOf(f(i))); + } + + public int toLegacyData(IBlockData iblockdata) { @@ -886,16 +466,24 @@ index 0000000..9f9b45d + return i; + } + ++ public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) { ++ return iblockdata.set(BlockHopper.FACING, enumblockrotation.a((EnumDirection) iblockdata.get(BlockHopper.FACING))); ++ } ++ ++ public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) { ++ return iblockdata.a(enumblockmirror.a((EnumDirection) iblockdata.get(BlockHopper.FACING))); ++ } ++ + protected BlockStateList getStateList() { + return new BlockStateList(this, new IBlockState[] { BlockHopper.FACING, BlockHopper.ENABLED}); + } +} diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java new file mode 100644 -index 0000000..de2d648 +index 0000000..54140f7 --- /dev/null +++ b/src/main/java/net/minecraft/server/BlockTNT.java -@@ -0,0 +1,102 @@ +@@ -0,0 +1,98 @@ +package net.minecraft.server; + +public class BlockTNT extends Block { @@ -904,7 +492,7 @@ index 0000000..de2d648 + + public BlockTNT() { + super(Material.TNT); -+ this.j(this.blockStateList.getBlockData().set(BlockTNT.EXPLODE, Boolean.valueOf(false))); ++ this.w(this.blockStateList.getBlockData().set(BlockTNT.EXPLODE, Boolean.valueOf(false))); + this.a(CreativeModeTab.d); + } + @@ -929,7 +517,7 @@ index 0000000..de2d648 + if (!world.isClientSide) { + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockposition.getX() + 0.5F), (double) blockposition.getY(), (double) ((float) blockposition.getZ() + 0.5F), explosion.getSource()); + -+ entitytntprimed.fuseTicks = world.random.nextInt(entitytntprimed.fuseTicks / 4) + entitytntprimed.fuseTicks / 8; ++ entitytntprimed.setFuseTicks((short) (world.random.nextInt(entitytntprimed.getFuseTicks() / 4) + entitytntprimed.getFuseTicks() / 8)); + world.addEntity(entitytntprimed); + } + } @@ -944,30 +532,26 @@ index 0000000..de2d648 + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockposition.getX() + 0.5F), (double) blockposition.getY(), (double) ((float) blockposition.getZ() + 0.5F), entityliving); + + world.addEntity(entitytntprimed); -+ world.makeSound(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F); ++ world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gj, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + + } + } + -+ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumDirection enumdirection, float f, float f1, float f2) { -+ if (entityhuman.bZ() != null) { -+ Item item = entityhuman.bZ().getItem(); -+ -+ if (item == Items.FLINT_AND_STEEL || item == Items.FIRE_CHARGE) { -+ this.a(world, blockposition, iblockdata.set(BlockTNT.EXPLODE, Boolean.valueOf(true)), (EntityLiving) entityhuman); -+ world.setAir(blockposition); -+ if (item == Items.FLINT_AND_STEEL) { -+ entityhuman.bZ().damage(1, entityhuman); -+ } else if (!entityhuman.abilities.canInstantlyBuild) { -+ --entityhuman.bZ().count; -+ } -+ -+ return true; ++ public boolean interact(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack, EnumDirection enumdirection, float f, float f1, float f2) { ++ if (itemstack != null && (itemstack.getItem() == Items.FLINT_AND_STEEL || itemstack.getItem() == Items.FIRE_CHARGE)) { ++ this.a(world, blockposition, iblockdata.set(BlockTNT.EXPLODE, Boolean.valueOf(true)), (EntityLiving) entityhuman); ++ world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 11); ++ if (itemstack.getItem() == Items.FLINT_AND_STEEL) { ++ itemstack.damage(1, entityhuman); ++ } else if (!entityhuman.abilities.canInstantlyBuild) { ++ --itemstack.count; + } -+ } + -+ return super.interact(world, blockposition, iblockdata, entityhuman, enumdirection, f, f1, f2); ++ return true; ++ } else { ++ return super.interact(world, blockposition, iblockdata, entityhuman, enumhand, itemstack, enumdirection, f, f1, f2); ++ } + } + + public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { @@ -1000,17 +584,20 @@ index 0000000..de2d648 +} diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java new file mode 100644 -index 0000000..81289b7 +index 0000000..3e4a31b --- /dev/null +++ b/src/main/java/net/minecraft/server/CommandDispatcher.java -@@ -0,0 +1,118 @@ +@@ -0,0 +1,125 @@ +package net.minecraft.server; + +import java.util.Iterator; + +public class CommandDispatcher extends CommandHandler implements ICommandDispatcher { + -+ public CommandDispatcher() { ++ private final MinecraftServer a; ++ ++ public CommandDispatcher(MinecraftServer minecraftserver) { ++ this.a = minecraftserver; + this.a((ICommand) (new CommandTime())); + this.a((ICommand) (new CommandGamemode())); + this.a((ICommand) (new CommandDifficulty())); @@ -1054,7 +641,7 @@ index 0000000..81289b7 + this.a((ICommand) (new CommandWorldBorder())); + this.a((ICommand) (new CommandTitle())); + this.a((ICommand) (new CommandEntityData())); -+ if (MinecraftServer.getServer().ae()) { ++ if (minecraftserver.aa()) { + this.a((ICommand) (new CommandOp())); + this.a((ICommand) (new CommandDeop())); + this.a((ICommand) (new CommandStop())); @@ -1079,7 +666,7 @@ index 0000000..81289b7 + + public void a(ICommandListener icommandlistener, ICommand icommand, int i, String s, Object... aobject) { + boolean flag = true; -+ MinecraftServer minecraftserver = MinecraftServer.getServer(); ++ MinecraftServer minecraftserver = this.a; + + if (!icommandlistener.getSendCommandFeedback()) { + flag = false; @@ -1095,9 +682,9 @@ index 0000000..81289b7 + while (iterator.hasNext()) { + EntityHuman entityhuman = (EntityHuman) iterator.next(); + -+ if (entityhuman != icommandlistener && minecraftserver.getPlayerList().isOp(entityhuman.getProfile()) && icommand.canUse(icommandlistener)) { -+ boolean flag1 = icommandlistener instanceof MinecraftServer && MinecraftServer.getServer().r(); -+ boolean flag2 = icommandlistener instanceof RemoteControlCommandListener && MinecraftServer.getServer().q(); ++ if (entityhuman != icommandlistener && minecraftserver.getPlayerList().isOp(entityhuman.getProfile()) && icommand.canUse(this.a, icommandlistener)) { ++ boolean flag1 = icommandlistener instanceof MinecraftServer && this.a.s(); ++ boolean flag2 = icommandlistener instanceof RemoteControlCommandListener && this.a.r(); + + if (flag1 || flag2 || !(icommandlistener instanceof RemoteControlCommandListener) && !(icommandlistener instanceof MinecraftServer)) { + entityhuman.sendMessage(chatmessage); @@ -1113,7 +700,7 @@ index 0000000..81289b7 + boolean flag3 = minecraftserver.worldServer[0].getGameRules().getBoolean("sendCommandFeedback"); + + if (icommandlistener instanceof CommandBlockListenerAbstract) { -+ flag3 = ((CommandBlockListenerAbstract) icommandlistener).m(); ++ flag3 = ((CommandBlockListenerAbstract) icommandlistener).n(); + } + + if ((i & 1) != 1 && flag3 || icommandlistener instanceof MinecraftServer) { @@ -1121,391 +708,28 @@ index 0000000..81289b7 + } + + } -+} -diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java -new file mode 100644 -index 0000000..2bf9196 ---- /dev/null -+++ b/src/main/java/net/minecraft/server/DataWatcher.java -@@ -0,0 +1,361 @@ -+package net.minecraft.server; + -+import com.google.common.collect.Lists; -+import com.google.common.collect.Maps; -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Map; -+import java.util.concurrent.locks.ReadWriteLock; -+import java.util.concurrent.locks.ReentrantReadWriteLock; -+import org.apache.commons.lang3.ObjectUtils; -+ -+public class DataWatcher { -+ -+ private final Entity a; -+ private boolean b = true; -+ private static final Map, Integer> c = Maps.newHashMap(); -+ private final Map d = Maps.newHashMap(); -+ private boolean e; -+ private ReadWriteLock f = new ReentrantReadWriteLock(); -+ -+ public DataWatcher(Entity entity) { -+ this.a = entity; -+ } -+ -+ public void a(int i, T t0) { -+ Integer integer = (Integer) DataWatcher.c.get(t0.getClass()); -+ -+ if (integer == null) { -+ throw new IllegalArgumentException("Unknown data type: " + t0.getClass()); -+ } else if (i > 31) { -+ throw new IllegalArgumentException("Data value id is too big with " + i + "! (Max is " + 31 + ")"); -+ } else if (this.d.containsKey(Integer.valueOf(i))) { -+ throw new IllegalArgumentException("Duplicate id value for " + i + "!"); -+ } else { -+ DataWatcher.WatchableObject datawatcher_watchableobject = new DataWatcher.WatchableObject(integer.intValue(), i, t0); -+ -+ this.f.writeLock().lock(); -+ this.d.put(Integer.valueOf(i), datawatcher_watchableobject); -+ this.f.writeLock().unlock(); -+ this.b = false; -+ } -+ } -+ -+ public void add(int i, int j) { -+ DataWatcher.WatchableObject datawatcher_watchableobject = new DataWatcher.WatchableObject(j, i, (Object) null); -+ -+ this.f.writeLock().lock(); -+ this.d.put(Integer.valueOf(i), datawatcher_watchableobject); -+ this.f.writeLock().unlock(); -+ this.b = false; -+ } -+ -+ public byte getByte(int i) { -+ return ((Byte) this.j(i).b()).byteValue(); -+ } -+ -+ public short getShort(int i) { -+ return ((Short) this.j(i).b()).shortValue(); -+ } -+ -+ public int getInt(int i) { -+ return ((Integer) this.j(i).b()).intValue(); -+ } -+ -+ public float getFloat(int i) { -+ return ((Float) this.j(i).b()).floatValue(); -+ } -+ -+ public String getString(int i) { -+ return (String) this.j(i).b(); -+ } -+ -+ public ItemStack getItemStack(int i) { -+ return (ItemStack) this.j(i).b(); -+ } -+ -+ private DataWatcher.WatchableObject j(int i) { -+ this.f.readLock().lock(); -+ -+ DataWatcher.WatchableObject datawatcher_watchableobject; -+ -+ try { -+ datawatcher_watchableobject = (DataWatcher.WatchableObject) this.d.get(Integer.valueOf(i)); -+ } catch (Throwable throwable) { -+ CrashReport crashreport = CrashReport.a(throwable, "Getting synched entity data"); -+ CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Synched entity data"); -+ -+ crashreportsystemdetails.a("Data ID", (Object) Integer.valueOf(i)); -+ throw new ReportedException(crashreport); -+ } -+ -+ this.f.readLock().unlock(); -+ return datawatcher_watchableobject; -+ } -+ -+ public Vector3f h(int i) { -+ return (Vector3f) this.j(i).b(); -+ } -+ -+ public void watch(int i, T t0) { -+ DataWatcher.WatchableObject datawatcher_watchableobject = this.j(i); -+ -+ if (ObjectUtils.notEqual(t0, datawatcher_watchableobject.b())) { -+ datawatcher_watchableobject.a(t0); -+ this.a.i(i); -+ datawatcher_watchableobject.a(true); -+ this.e = true; -+ } -+ -+ } -+ -+ public void update(int i) { -+ this.j(i).d = true; -+ this.e = true; -+ } -+ -+ public boolean a() { -+ return this.e; -+ } -+ -+ public static void a(List list, PacketDataSerializer packetdataserializer) throws IOException { -+ if (list != null) { -+ Iterator iterator = list.iterator(); -+ -+ while (iterator.hasNext()) { -+ DataWatcher.WatchableObject datawatcher_watchableobject = (DataWatcher.WatchableObject) iterator.next(); -+ -+ a(packetdataserializer, datawatcher_watchableobject); -+ } -+ } -+ -+ packetdataserializer.writeByte(127); -+ } -+ -+ public List b() { -+ ArrayList arraylist = null; -+ -+ if (this.e) { -+ this.f.readLock().lock(); -+ Iterator iterator = this.d.values().iterator(); -+ -+ while (iterator.hasNext()) { -+ DataWatcher.WatchableObject datawatcher_watchableobject = (DataWatcher.WatchableObject) iterator.next(); -+ -+ if (datawatcher_watchableobject.d()) { -+ datawatcher_watchableobject.a(false); -+ if (arraylist == null) { -+ arraylist = Lists.newArrayList(); -+ } -+ -+ arraylist.add(datawatcher_watchableobject); -+ } -+ } -+ -+ this.f.readLock().unlock(); -+ } -+ -+ this.e = false; -+ return arraylist; -+ } -+ -+ public void a(PacketDataSerializer packetdataserializer) throws IOException { -+ this.f.readLock().lock(); -+ Iterator iterator = this.d.values().iterator(); -+ -+ while (iterator.hasNext()) { -+ DataWatcher.WatchableObject datawatcher_watchableobject = (DataWatcher.WatchableObject) iterator.next(); -+ -+ a(packetdataserializer, datawatcher_watchableobject); -+ } -+ -+ this.f.readLock().unlock(); -+ packetdataserializer.writeByte(127); -+ } -+ -+ public List c() { -+ ArrayList arraylist = null; -+ -+ this.f.readLock().lock(); -+ -+ DataWatcher.WatchableObject datawatcher_watchableobject; -+ -+ for (Iterator iterator = this.d.values().iterator(); iterator.hasNext(); arraylist.add(datawatcher_watchableobject)) { -+ datawatcher_watchableobject = (DataWatcher.WatchableObject) iterator.next(); -+ if (arraylist == null) { -+ arraylist = Lists.newArrayList(); -+ } -+ } -+ -+ this.f.readLock().unlock(); -+ return arraylist; -+ } -+ -+ private static void a(PacketDataSerializer packetdataserializer, DataWatcher.WatchableObject datawatcher_watchableobject) throws IOException { -+ int i = (datawatcher_watchableobject.c() << 5 | datawatcher_watchableobject.a() & 31) & 255; -+ -+ packetdataserializer.writeByte(i); -+ switch (datawatcher_watchableobject.c()) { -+ case 0: -+ packetdataserializer.writeByte(((Byte) datawatcher_watchableobject.b()).byteValue()); -+ break; -+ -+ case 1: -+ packetdataserializer.writeShort(((Short) datawatcher_watchableobject.b()).shortValue()); -+ break; -+ -+ case 2: -+ packetdataserializer.writeInt(((Integer) datawatcher_watchableobject.b()).intValue()); -+ break; -+ -+ case 3: -+ packetdataserializer.writeFloat(((Float) datawatcher_watchableobject.b()).floatValue()); -+ break; -+ -+ case 4: -+ packetdataserializer.a((String) datawatcher_watchableobject.b()); -+ break; -+ -+ case 5: -+ ItemStack itemstack = (ItemStack) datawatcher_watchableobject.b(); -+ -+ packetdataserializer.a(itemstack); -+ break; -+ -+ case 6: -+ BlockPosition blockposition = (BlockPosition) datawatcher_watchableobject.b(); -+ -+ packetdataserializer.writeInt(blockposition.getX()); -+ packetdataserializer.writeInt(blockposition.getY()); -+ packetdataserializer.writeInt(blockposition.getZ()); -+ break; -+ -+ case 7: -+ Vector3f vector3f = (Vector3f) datawatcher_watchableobject.b(); -+ -+ packetdataserializer.writeFloat(vector3f.getX()); -+ packetdataserializer.writeFloat(vector3f.getY()); -+ packetdataserializer.writeFloat(vector3f.getZ()); -+ } -+ -+ } -+ -+ public static List b(PacketDataSerializer packetdataserializer) throws IOException { -+ ArrayList arraylist = null; -+ -+ for (byte b0 = packetdataserializer.readByte(); b0 != 127; b0 = packetdataserializer.readByte()) { -+ if (arraylist == null) { -+ arraylist = Lists.newArrayList(); -+ } -+ -+ int i = (b0 & 224) >> 5; -+ int j = b0 & 31; -+ DataWatcher.WatchableObject datawatcher_watchableobject = null; -+ -+ switch (i) { -+ case 0: -+ datawatcher_watchableobject = new DataWatcher.WatchableObject(i, j, Byte.valueOf(packetdataserializer.readByte())); -+ break; -+ -+ case 1: -+ datawatcher_watchableobject = new DataWatcher.WatchableObject(i, j, Short.valueOf(packetdataserializer.readShort())); -+ break; -+ -+ case 2: -+ datawatcher_watchableobject = new DataWatcher.WatchableObject(i, j, Integer.valueOf(packetdataserializer.readInt())); -+ break; -+ -+ case 3: -+ datawatcher_watchableobject = new DataWatcher.WatchableObject(i, j, Float.valueOf(packetdataserializer.readFloat())); -+ break; -+ -+ case 4: -+ datawatcher_watchableobject = new DataWatcher.WatchableObject(i, j, packetdataserializer.c(32767)); -+ break; -+ -+ case 5: -+ datawatcher_watchableobject = new DataWatcher.WatchableObject(i, j, packetdataserializer.i()); -+ break; -+ -+ case 6: -+ int k = packetdataserializer.readInt(); -+ int l = packetdataserializer.readInt(); -+ int i1 = packetdataserializer.readInt(); -+ -+ datawatcher_watchableobject = new DataWatcher.WatchableObject(i, j, new BlockPosition(k, l, i1)); -+ break; -+ -+ case 7: -+ float f = packetdataserializer.readFloat(); -+ float f1 = packetdataserializer.readFloat(); -+ float f2 = packetdataserializer.readFloat(); -+ -+ datawatcher_watchableobject = new DataWatcher.WatchableObject(i, j, new Vector3f(f, f1, f2)); -+ } -+ -+ arraylist.add(datawatcher_watchableobject); -+ } -+ -+ return arraylist; -+ } -+ -+ public boolean d() { -+ return this.b; -+ } -+ -+ public void e() { -+ this.e = false; -+ } -+ -+ static { -+ DataWatcher.c.put(Byte.class, Integer.valueOf(0)); -+ DataWatcher.c.put(Short.class, Integer.valueOf(1)); -+ DataWatcher.c.put(Integer.class, Integer.valueOf(2)); -+ DataWatcher.c.put(Float.class, Integer.valueOf(3)); -+ DataWatcher.c.put(String.class, Integer.valueOf(4)); -+ DataWatcher.c.put(ItemStack.class, Integer.valueOf(5)); -+ DataWatcher.c.put(BlockPosition.class, Integer.valueOf(6)); -+ DataWatcher.c.put(Vector3f.class, Integer.valueOf(7)); -+ } -+ -+ public static class WatchableObject { -+ -+ private final int a; -+ private final int b; -+ private Object c; -+ private boolean d; -+ -+ public WatchableObject(int i, int j, Object object) { -+ this.b = j; -+ this.c = object; -+ this.a = i; -+ this.d = true; -+ } -+ -+ public int a() { -+ return this.b; -+ } -+ -+ public void a(Object object) { -+ this.c = object; -+ } -+ -+ public Object b() { -+ return this.c; -+ } -+ -+ public int c() { -+ return this.a; -+ } -+ -+ public boolean d() { -+ return this.d; -+ } -+ -+ public void a(boolean flag) { -+ this.d = flag; -+ } ++ protected MinecraftServer a() { ++ return this.a; + } +} diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java new file mode 100644 -index 0000000..9865681 +index 0000000..022d3c5 --- /dev/null +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java -@@ -0,0 +1,450 @@ +@@ -0,0 +1,414 @@ +package net.minecraft.server; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; -+import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; ++import java.util.Map.Entry; + +public class EnchantmentManager { + @@ -1515,7 +739,7 @@ index 0000000..9865681 + private static final EnchantmentManager.EnchantmentModifierThorns d = new EnchantmentManager.EnchantmentModifierThorns((EnchantmentManager.SyntheticClass_1) null); + private static final EnchantmentManager.EnchantmentModifierArthropods e = new EnchantmentManager.EnchantmentModifierArthropods((EnchantmentManager.SyntheticClass_1) null); + -+ public static int getEnchantmentLevel(int i, ItemStack itemstack) { ++ public static int getEnchantmentLevel(Enchantment enchantment, ItemStack itemstack) { + if (itemstack == null) { + return 0; + } else { @@ -1524,12 +748,12 @@ index 0000000..9865681 + if (nbttaglist == null) { + return 0; + } else { -+ for (int j = 0; j < nbttaglist.size(); ++j) { -+ short short0 = nbttaglist.get(j).getShort("id"); -+ short short1 = nbttaglist.get(j).getShort("lvl"); ++ for (int i = 0; i < nbttaglist.size(); ++i) { ++ Enchantment enchantment1 = Enchantment.c(nbttaglist.get(i).getShort("id")); ++ short short0 = nbttaglist.get(i).getShort("lvl"); + -+ if (short0 == i) { -+ return short1; ++ if (enchantment1 == enchantment) { ++ return short0; + } + } + @@ -1538,73 +762,53 @@ index 0000000..9865681 + } + } + -+ public static Map a(ItemStack itemstack) { ++ public static Map a(ItemStack itemstack) { + LinkedHashMap linkedhashmap = Maps.newLinkedHashMap(); + NBTTagList nbttaglist = itemstack.getItem() == Items.ENCHANTED_BOOK ? Items.ENCHANTED_BOOK.h(itemstack) : itemstack.getEnchantments(); + + if (nbttaglist != null) { + for (int i = 0; i < nbttaglist.size(); ++i) { -+ short short0 = nbttaglist.get(i).getShort("id"); -+ short short1 = nbttaglist.get(i).getShort("lvl"); ++ Enchantment enchantment = Enchantment.c(nbttaglist.get(i).getShort("id")); ++ short short0 = nbttaglist.get(i).getShort("lvl"); + -+ linkedhashmap.put(Integer.valueOf(short0), Integer.valueOf(short1)); ++ linkedhashmap.put(enchantment, Integer.valueOf(short0)); + } + } + + return linkedhashmap; + } + -+ public static void a(Map map, ItemStack itemstack) { ++ public static void a(Map map, ItemStack itemstack) { + NBTTagList nbttaglist = new NBTTagList(); -+ Iterator iterator = map.keySet().iterator(); ++ Iterator iterator = map.entrySet().iterator(); + + while (iterator.hasNext()) { -+ int i = ((Integer) iterator.next()).intValue(); -+ Enchantment enchantment = Enchantment.getById(i); ++ Entry entry = (Entry) iterator.next(); ++ Enchantment enchantment = (Enchantment) entry.getKey(); + + if (enchantment != null) { ++ int i = ((Integer) entry.getValue()).intValue(); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + -+ nbttagcompound.setShort("id", (short) i); -+ nbttagcompound.setShort("lvl", (short) ((Integer) map.get(Integer.valueOf(i))).intValue()); ++ nbttagcompound.setShort("id", (short) Enchantment.getId(enchantment)); ++ nbttagcompound.setShort("lvl", (short) i); + nbttaglist.add(nbttagcompound); + if (itemstack.getItem() == Items.ENCHANTED_BOOK) { -+ Items.ENCHANTED_BOOK.a(itemstack, new WeightedRandomEnchant(enchantment, ((Integer) map.get(Integer.valueOf(i))).intValue())); ++ Items.ENCHANTED_BOOK.a(itemstack, new WeightedRandomEnchant(enchantment, i)); + } + } + } + -+ if (nbttaglist.size() > 0) { -+ if (itemstack.getItem() != Items.ENCHANTED_BOOK) { -+ itemstack.a("ench", (NBTBase) nbttaglist); ++ if (nbttaglist.isEmpty()) { ++ if (itemstack.hasTag()) { ++ itemstack.getTag().remove("ench"); + } -+ } else if (itemstack.hasTag()) { -+ itemstack.getTag().remove("ench"); ++ } else if (itemstack.getItem() != Items.ENCHANTED_BOOK) { ++ itemstack.a("ench", (NBTBase) nbttaglist); + } + + } + -+ public static int a(int i, ItemStack[] aitemstack) { -+ if (aitemstack == null) { -+ return 0; -+ } else { -+ int j = 0; -+ ItemStack[] aitemstack1 = aitemstack; -+ int k = aitemstack.length; -+ -+ for (int l = 0; l < k; ++l) { -+ ItemStack itemstack = aitemstack1[l]; -+ int i1 = getEnchantmentLevel(i, itemstack); -+ -+ if (i1 > j) { -+ j = i1; -+ } -+ } -+ -+ return j; -+ } -+ } -+ + private static void a(EnchantmentManager.EnchantmentModifier enchantmentmanager_enchantmentmodifier, ItemStack itemstack) { + if (itemstack != null) { + NBTTagList nbttaglist = itemstack.getEnchantments(); @@ -1614,8 +818,8 @@ index 0000000..9865681 + short short0 = nbttaglist.get(i).getShort("id"); + short short1 = nbttaglist.get(i).getShort("lvl"); + -+ if (Enchantment.getById(short0) != null) { -+ enchantmentmanager_enchantmentmodifier.a(Enchantment.getById(short0), short1); ++ if (Enchantment.c(short0) != null) { ++ enchantmentmanager_enchantmentmodifier.a(Enchantment.c(short0), short1); + } + } + @@ -1623,29 +827,22 @@ index 0000000..9865681 + } + } + -+ private static void a(EnchantmentManager.EnchantmentModifier enchantmentmanager_enchantmentmodifier, ItemStack[] aitemstack) { -+ ItemStack[] aitemstack1 = aitemstack; -+ int i = aitemstack.length; ++ private static void a(EnchantmentManager.EnchantmentModifier enchantmentmanager_enchantmentmodifier, Iterable iterable) { ++ Iterator iterator = iterable.iterator(); + -+ for (int j = 0; j < i; ++j) { -+ ItemStack itemstack = aitemstack1[j]; ++ while (iterator.hasNext()) { ++ ItemStack itemstack = (ItemStack) iterator.next(); + + a(enchantmentmanager_enchantmentmodifier, itemstack); + } + + } + -+ public static int a(ItemStack[] aitemstack, DamageSource damagesource) { ++ public static int a(Iterable iterable, DamageSource damagesource) { + EnchantmentManager.b.a = 0; + EnchantmentManager.b.b = damagesource; -+ a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.b, aitemstack); -+ if (EnchantmentManager.b.a > 25) { -+ EnchantmentManager.b.a = 25; -+ } else if (EnchantmentManager.b.a < 0) { -+ EnchantmentManager.b.a = 0; -+ } -+ -+ return (EnchantmentManager.b.a + 1 >> 1) + EnchantmentManager.a.nextInt((EnchantmentManager.b.a >> 1) + 1); ++ a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.b, iterable); ++ return EnchantmentManager.b.a; + } + + public static float a(ItemStack itemstack, EnumMonsterType enummonstertype) { @@ -1659,11 +856,11 @@ index 0000000..9865681 + EnchantmentManager.d.b = entity; + EnchantmentManager.d.a = entityliving; + if (entityliving != null) { -+ a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.d, entityliving.getEquipment()); ++ a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.d, entityliving.aG()); + } + + if (entity instanceof EntityHuman) { -+ a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.d, entityliving.bA()); ++ a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.d, entityliving.getItemInMainHand()); + } + + } @@ -1672,77 +869,97 @@ index 0000000..9865681 + EnchantmentManager.e.a = entityliving; + EnchantmentManager.e.b = entity; + if (entityliving != null) { -+ a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.e, entityliving.getEquipment()); ++ a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.e, entityliving.aG()); + } + + if (entityliving instanceof EntityHuman) { -+ a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.e, entityliving.bA()); ++ a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.e, entityliving.getItemInMainHand()); + } + + } + ++ public static int a(Enchantment enchantment, EntityLiving entityliving) { ++ Iterable iterable = enchantment.a(entityliving); ++ ++ if (iterable == null) { ++ return 0; ++ } else { ++ int i = 0; ++ Iterator iterator = iterable.iterator(); ++ ++ while (iterator.hasNext()) { ++ ItemStack itemstack = (ItemStack) iterator.next(); ++ int j = getEnchantmentLevel(enchantment, itemstack); ++ ++ if (j > i) { ++ i = j; ++ } ++ } ++ ++ return i; ++ } ++ } ++ + public static int a(EntityLiving entityliving) { -+ return getEnchantmentLevel(Enchantment.KNOCKBACK.id, entityliving.bA()); ++ return a(Enchantments.KNOCKBACK, entityliving); + } + + public static int getFireAspectEnchantmentLevel(EntityLiving entityliving) { -+ return getEnchantmentLevel(Enchantment.FIRE_ASPECT.id, entityliving.bA()); ++ return a(Enchantments.FIRE_ASPECT, entityliving); + } + -+ public static int getOxygenEnchantmentLevel(Entity entity) { -+ return a(Enchantment.OXYGEN.id, entity.getEquipment()); ++ public static int getOxygenEnchantmentLevel(EntityLiving entityliving) { ++ return a(Enchantments.OXYGEN, entityliving); + } + -+ public static int b(Entity entity) { -+ return a(Enchantment.DEPTH_STRIDER.id, entity.getEquipment()); ++ public static int d(EntityLiving entityliving) { ++ return a(Enchantments.DEPTH_STRIDER, entityliving); + } + + public static int getDigSpeedEnchantmentLevel(EntityLiving entityliving) { -+ return getEnchantmentLevel(Enchantment.DIG_SPEED.id, entityliving.bA()); ++ return a(Enchantments.DIG_SPEED, entityliving); + } + -+ public static boolean hasSilkTouchEnchantment(EntityLiving entityliving) { -+ return getEnchantmentLevel(Enchantment.SILK_TOUCH.id, entityliving.bA()) > 0; -+ } -+ -+ public static int getBonusBlockLootEnchantmentLevel(EntityLiving entityliving) { -+ return getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS.id, entityliving.bA()); ++ public static int f(EntityLiving entityliving) { ++ return a(Enchantments.LUCK, entityliving); + } + + public static int g(EntityLiving entityliving) { -+ return getEnchantmentLevel(Enchantment.LUCK.id, entityliving.bA()); ++ return a(Enchantments.LURE, entityliving); + } + + public static int h(EntityLiving entityliving) { -+ return getEnchantmentLevel(Enchantment.LURE.id, entityliving.bA()); ++ return a(Enchantments.LOOT_BONUS_MOBS, entityliving); + } + -+ public static int getBonusMonsterLootEnchantmentLevel(EntityLiving entityliving) { -+ return getEnchantmentLevel(Enchantment.LOOT_BONUS_MOBS.id, entityliving.bA()); ++ public static boolean i(EntityLiving entityliving) { ++ return a(Enchantments.WATER_WORKER, entityliving) > 0; + } + -+ public static boolean j(EntityLiving entityliving) { -+ return a(Enchantment.WATER_WORKER.id, entityliving.getEquipment()) > 0; -+ } ++ public static ItemStack b(Enchantment enchantment, EntityLiving entityliving) { ++ Iterable iterable = enchantment.a(entityliving); + -+ public static ItemStack a(Enchantment enchantment, EntityLiving entityliving) { -+ ItemStack[] aitemstack = entityliving.getEquipment(); -+ int i = aitemstack.length; ++ if (iterable == null) { ++ return null; ++ } else { ++ ArrayList arraylist = Lists.newArrayList(); ++ Iterator iterator = iterable.iterator(); + -+ for (int j = 0; j < i; ++j) { -+ ItemStack itemstack = aitemstack[j]; ++ while (iterator.hasNext()) { ++ ItemStack itemstack = (ItemStack) iterator.next(); + -+ if (itemstack != null && getEnchantmentLevel(enchantment.id, itemstack) > 0) { -+ return itemstack; ++ if (itemstack != null && getEnchantmentLevel(enchantment, itemstack) > 0) { ++ arraylist.add(itemstack); ++ } + } -+ } + -+ return null; ++ return arraylist.isEmpty() ? null : (ItemStack) arraylist.get(entityliving.getRandom().nextInt(arraylist.size())); ++ } + } + + public static int a(Random random, int i, int j, ItemStack itemstack) { + Item item = itemstack.getItem(); -+ int k = item.b(); ++ int k = item.c(); + + if (k <= 0) { + return 0; @@ -1757,90 +974,54 @@ index 0000000..9865681 + } + } + -+ public static ItemStack a(Random random, ItemStack itemstack, int i) { -+ List list = b(random, itemstack, i); -+ boolean flag = itemstack.getItem() == Items.BOOK; ++ public static ItemStack a(Random random, ItemStack itemstack, int i, boolean flag) { ++ boolean flag1 = itemstack.getItem() == Items.BOOK; ++ List list = b(random, itemstack, i, flag); + -+ if (flag) { ++ if (flag1) { + itemstack.setItem(Items.ENCHANTED_BOOK); + } + -+ if (list != null) { -+ Iterator iterator = list.iterator(); ++ Iterator iterator = list.iterator(); + -+ while (iterator.hasNext()) { -+ WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) iterator.next(); ++ while (iterator.hasNext()) { ++ WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) iterator.next(); + -+ if (flag) { -+ Items.ENCHANTED_BOOK.a(itemstack, weightedrandomenchant); -+ } else { -+ itemstack.addEnchantment(weightedrandomenchant.enchantment, weightedrandomenchant.level); -+ } ++ if (flag1) { ++ Items.ENCHANTED_BOOK.a(itemstack, weightedrandomenchant); ++ } else { ++ itemstack.addEnchantment(weightedrandomenchant.enchantment, weightedrandomenchant.level); + } + } + + return itemstack; + } + -+ public static List b(Random random, ItemStack itemstack, int i) { ++ public static List b(Random random, ItemStack itemstack, int i, boolean flag) { ++ ArrayList arraylist = Lists.newArrayList(); + Item item = itemstack.getItem(); -+ int j = item.b(); ++ int j = item.c(); + + if (j <= 0) { -+ return null; ++ return arraylist; + } else { -+ j /= 2; -+ j = 1 + random.nextInt((j >> 1) + 1) + random.nextInt((j >> 1) + 1); -+ int k = j + i; ++ i += 1 + random.nextInt(j / 4 + 1) + random.nextInt(j / 4 + 1); + float f = (random.nextFloat() + random.nextFloat() - 1.0F) * 0.15F; -+ int l = (int) ((float) k * (1.0F + f) + 0.5F); + -+ if (l < 1) { -+ l = 1; -+ } ++ i = MathHelper.clamp(Math.round((float) i + (float) i * f), 1, Integer.MAX_VALUE); ++ List list = a(i, itemstack, flag); + -+ ArrayList arraylist = null; -+ Map map = b(l, itemstack); ++ if (!list.isEmpty()) { ++ arraylist.add(WeightedRandom.a(random, list)); + -+ if (map != null && !map.isEmpty()) { -+ WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) WeightedRandom.a(random, map.values()); -+ -+ if (weightedrandomenchant != null) { -+ arraylist = Lists.newArrayList(); -+ arraylist.add(weightedrandomenchant); -+ -+ for (int i1 = l; random.nextInt(50) <= i1; i1 >>= 1) { -+ Iterator iterator = map.keySet().iterator(); -+ -+ while (iterator.hasNext()) { -+ Integer integer = (Integer) iterator.next(); -+ boolean flag = true; -+ Iterator iterator1 = arraylist.iterator(); -+ -+ while (true) { -+ if (iterator1.hasNext()) { -+ WeightedRandomEnchant weightedrandomenchant1 = (WeightedRandomEnchant) iterator1.next(); -+ -+ if (weightedrandomenchant1.enchantment.a(Enchantment.getById(integer.intValue()))) { -+ continue; -+ } -+ -+ flag = false; -+ } -+ -+ if (!flag) { -+ iterator.remove(); -+ } -+ break; -+ } -+ } -+ -+ if (!map.isEmpty()) { -+ WeightedRandomEnchant weightedrandomenchant2 = (WeightedRandomEnchant) WeightedRandom.a(random, map.values()); -+ -+ arraylist.add(weightedrandomenchant2); -+ } ++ while (random.nextInt(50) <= i) { ++ a(list, (WeightedRandomEnchant) SystemUtils.a(arraylist)); ++ if (list.isEmpty()) { ++ break; + } ++ ++ arraylist.add(WeightedRandom.a(random, list)); ++ i /= 2; + } + } + @@ -1848,30 +1029,37 @@ index 0000000..9865681 + } + } + -+ public static Map b(int i, ItemStack itemstack) { ++ public static void a(List list, WeightedRandomEnchant weightedrandomenchant) { ++ Iterator iterator = list.iterator(); ++ ++ while (iterator.hasNext()) { ++ if (!weightedrandomenchant.enchantment.a(((WeightedRandomEnchant) iterator.next()).enchantment)) { ++ iterator.remove(); ++ } ++ } ++ ++ } ++ ++ public static List a(int i, ItemStack itemstack, boolean flag) { ++ ArrayList arraylist = Lists.newArrayList(); + Item item = itemstack.getItem(); -+ HashMap hashmap = null; -+ boolean flag = itemstack.getItem() == Items.BOOK; -+ Enchantment[] aenchantment = Enchantment.b; -+ int j = aenchantment.length; ++ boolean flag1 = itemstack.getItem() == Items.BOOK; ++ Iterator iterator = Enchantment.enchantments.iterator(); + -+ for (int k = 0; k < j; ++k) { -+ Enchantment enchantment = aenchantment[k]; ++ while (iterator.hasNext()) { ++ Enchantment enchantment = (Enchantment) iterator.next(); + -+ if (enchantment != null && (enchantment.slot.canEnchant(item) || flag)) { -+ for (int l = enchantment.getStartLevel(); l <= enchantment.getMaxLevel(); ++l) { -+ if (i >= enchantment.a(l) && i <= enchantment.b(l)) { -+ if (hashmap == null) { -+ hashmap = Maps.newHashMap(); -+ } -+ -+ hashmap.put(Integer.valueOf(enchantment.id), new WeightedRandomEnchant(enchantment, l)); ++ if ((!enchantment.e() || flag) && (enchantment.itemTarget.canEnchant(item) || flag1)) { ++ for (int j = enchantment.getMaxLevel(); j > enchantment.getStartLevel() - 1; --j) { ++ if (i >= enchantment.a(j) && i <= enchantment.b(j)) { ++ arraylist.add(new WeightedRandomEnchant(enchantment, j)); ++ break; + } + } + } + } + -+ return hashmap; ++ return arraylist; + } + + static class SyntheticClass_1 { } @@ -2081,10 +1269,10 @@ index 0000000..27ce9d9 +} diff --git a/src/main/java/net/minecraft/server/GenericAttributes.java b/src/main/java/net/minecraft/server/GenericAttributes.java new file mode 100644 -index 0000000..3ed721a +index 0000000..16aaf1a --- /dev/null +++ b/src/main/java/net/minecraft/server/GenericAttributes.java -@@ -0,0 +1,114 @@ +@@ -0,0 +1,116 @@ +package net.minecraft.server; + +import java.util.Collection; @@ -2095,12 +1283,15 @@ index 0000000..3ed721a + +public class GenericAttributes { + -+ private static final Logger f = LogManager.getLogger(); ++ private static final Logger i = LogManager.getLogger(); + public static final IAttribute maxHealth = (new AttributeRanged((IAttribute) null, "generic.maxHealth", 20.0D, 0.0D, 1024.0D)).a("Max Health").a(true); + public static final IAttribute FOLLOW_RANGE = (new AttributeRanged((IAttribute) null, "generic.followRange", 32.0D, 0.0D, 2048.0D)).a("Follow Range"); + public static final IAttribute c = (new AttributeRanged((IAttribute) null, "generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).a("Knockback Resistance"); + public static final IAttribute MOVEMENT_SPEED = (new AttributeRanged((IAttribute) null, "generic.movementSpeed", 0.699999988079071D, 0.0D, 1024.0D)).a("Movement Speed").a(true); + public static final IAttribute ATTACK_DAMAGE = new AttributeRanged((IAttribute) null, "generic.attackDamage", 2.0D, 0.0D, 2048.0D); ++ public static final IAttribute f = (new AttributeRanged((IAttribute) null, "generic.attackSpeed", 4.0D, 0.0D, 1024.0D)).a(true); ++ public static final IAttribute g = (new AttributeRanged((IAttribute) null, "generic.armor", 0.0D, 0.0D, 30.0D)).a(true); ++ public static final IAttribute h = (new AttributeRanged((IAttribute) null, "generic.luck", 0.0D, -1024.0D, 1024.0D)).a(true); + + public static NBTTagList a(AttributeMapBase attributemapbase) { + NBTTagList nbttaglist = new NBTTagList(); @@ -2141,14 +1332,13 @@ index 0000000..3ed721a + return nbttagcompound; + } + -+ private static NBTTagCompound a(AttributeModifier attributemodifier) { ++ public static NBTTagCompound a(AttributeModifier attributemodifier) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + + nbttagcompound.setString("Name", attributemodifier.b()); + nbttagcompound.setDouble("Amount", attributemodifier.d()); + nbttagcompound.setInt("Operation", attributemodifier.c()); -+ nbttagcompound.setLong("UUIDMost", attributemodifier.a().getMostSignificantBits()); -+ nbttagcompound.setLong("UUIDLeast", attributemodifier.a().getLeastSignificantBits()); ++ nbttagcompound.a("UUID", attributemodifier.a()); + return nbttagcompound; + } + @@ -2160,7 +1350,7 @@ index 0000000..3ed721a + if (attributeinstance != null) { + a(attributeinstance, nbttagcompound); + } else { -+ GenericAttributes.f.warn("Ignoring unknown attribute \'" + nbttagcompound.getString("Name") + "\'"); ++ GenericAttributes.i.warn("Ignoring unknown attribute \'" + nbttagcompound.getString("Name") + "\'"); + } + } + @@ -2189,12 +1379,12 @@ index 0000000..3ed721a + } + + public static AttributeModifier a(NBTTagCompound nbttagcompound) { -+ UUID uuid = new UUID(nbttagcompound.getLong("UUIDMost"), nbttagcompound.getLong("UUIDLeast")); ++ UUID uuid = nbttagcompound.a("UUID"); + + try { + return new AttributeModifier(uuid, nbttagcompound.getString("Name"), nbttagcompound.getDouble("Amount"), nbttagcompound.getInt("Operation")); + } catch (Exception exception) { -+ GenericAttributes.f.warn("Unable to create attribute: " + exception.getMessage()); ++ GenericAttributes.i.warn("Unable to create attribute: " + exception.getMessage()); + return null; + } + } @@ -2270,10 +1460,10 @@ index 0000000..8167fdd +} diff --git a/src/main/java/net/minecraft/server/ItemDoor.java b/src/main/java/net/minecraft/server/ItemDoor.java new file mode 100644 -index 0000000..eef43df +index 0000000..669940a --- /dev/null +++ b/src/main/java/net/minecraft/server/ItemDoor.java -@@ -0,0 +1,56 @@ +@@ -0,0 +1,66 @@ +package net.minecraft.server; + +public class ItemDoor extends Item { @@ -2285,44 +1475,54 @@ index 0000000..eef43df + this.a(CreativeModeTab.d); + } + -+ public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2) { ++ public EnumInteractionResult a(ItemStack itemstack, EntityHuman entityhuman, World world, BlockPosition blockposition, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) { + if (enumdirection != EnumDirection.UP) { -+ return false; ++ return EnumInteractionResult.FAIL; + } else { + IBlockData iblockdata = world.getType(blockposition); + Block block = iblockdata.getBlock(); + -+ if (!block.a(world, blockposition)) { ++ if (!block.a((IBlockAccess) world, blockposition)) { + blockposition = blockposition.shift(enumdirection); + } + -+ if (!entityhuman.a(blockposition, enumdirection, itemstack)) { -+ return false; -+ } else if (!this.a.canPlace(world, blockposition)) { -+ return false; -+ } else { -+ a(world, blockposition, EnumDirection.fromAngle((double) entityhuman.yaw), this.a); ++ if (entityhuman.a(blockposition, enumdirection, itemstack) && this.a.canPlace(world, blockposition)) { ++ EnumDirection enumdirection1 = EnumDirection.fromAngle((double) entityhuman.yaw); ++ int i = enumdirection1.getAdjacentX(); ++ int j = enumdirection1.getAdjacentZ(); ++ boolean flag = i < 0 && f2 < 0.5F || i > 0 && f2 > 0.5F || j < 0 && f > 0.5F || j > 0 && f < 0.5F; ++ ++ a(world, blockposition, enumdirection1, this.a, flag); ++ SoundEffectType soundeffecttype = this.a.w(); ++ ++ world.a(entityhuman, blockposition, soundeffecttype.e(), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F); + --itemstack.count; -+ return true; ++ return EnumInteractionResult.SUCCESS; ++ } else { ++ return EnumInteractionResult.FAIL; + } + } + } + -+ public static void a(World world, BlockPosition blockposition, EnumDirection enumdirection, Block block) { ++ public static void a(World world, BlockPosition blockposition, EnumDirection enumdirection, Block block, boolean flag) { + BlockPosition blockposition1 = blockposition.shift(enumdirection.e()); + BlockPosition blockposition2 = blockposition.shift(enumdirection.f()); -+ int i = (world.getType(blockposition2).getBlock().isOccluding() ? 1 : 0) + (world.getType(blockposition2.up()).getBlock().isOccluding() ? 1 : 0); -+ int j = (world.getType(blockposition1).getBlock().isOccluding() ? 1 : 0) + (world.getType(blockposition1.up()).getBlock().isOccluding() ? 1 : 0); -+ boolean flag = world.getType(blockposition2).getBlock() == block || world.getType(blockposition2.up()).getBlock() == block; -+ boolean flag1 = world.getType(blockposition1).getBlock() == block || world.getType(blockposition1.up()).getBlock() == block; -+ boolean flag2 = false; ++ int i = (world.getType(blockposition2).l() ? 1 : 0) + (world.getType(blockposition2.up()).l() ? 1 : 0); ++ int j = (world.getType(blockposition1).l() ? 1 : 0) + (world.getType(blockposition1.up()).l() ? 1 : 0); ++ boolean flag1 = world.getType(blockposition2).getBlock() == block || world.getType(blockposition2.up()).getBlock() == block; ++ boolean flag2 = world.getType(blockposition1).getBlock() == block || world.getType(blockposition1.up()).getBlock() == block; + -+ if (flag && !flag1 || j > i) { -+ flag2 = true; ++ if ((!flag1 || flag2) && j <= i) { ++ if (flag2 && !flag1 || j < i) { ++ flag = false; ++ } ++ } else { ++ flag = true; + } + + BlockPosition blockposition3 = blockposition.up(); -+ IBlockData iblockdata = block.getBlockData().set(BlockDoor.FACING, enumdirection).set(BlockDoor.HINGE, flag2 ? BlockDoor.EnumDoorHinge.RIGHT : BlockDoor.EnumDoorHinge.LEFT); ++ boolean flag3 = world.isBlockIndirectlyPowered(blockposition) || world.isBlockIndirectlyPowered(blockposition3); ++ IBlockData iblockdata = block.getBlockData().set(BlockDoor.FACING, enumdirection).set(BlockDoor.HINGE, flag ? BlockDoor.EnumDoorHinge.RIGHT : BlockDoor.EnumDoorHinge.LEFT).set(BlockDoor.POWERED, Boolean.valueOf(flag3)).set(BlockDoor.OPEN, Boolean.valueOf(flag3)); + + world.setTypeAndData(blockposition, iblockdata.set(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER), 2); + world.setTypeAndData(blockposition3, iblockdata.set(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 2); @@ -2332,10 +1532,10 @@ index 0000000..eef43df +} diff --git a/src/main/java/net/minecraft/server/ItemSkull.java b/src/main/java/net/minecraft/server/ItemSkull.java new file mode 100644 -index 0000000..a46cfef +index 0000000..40338ae --- /dev/null +++ b/src/main/java/net/minecraft/server/ItemSkull.java -@@ -0,0 +1,124 @@ +@@ -0,0 +1,123 @@ +package net.minecraft.server; + +import com.mojang.authlib.GameProfile; @@ -2343,7 +1543,7 @@ index 0000000..a46cfef + +public class ItemSkull extends Item { + -+ private static final String[] a = new String[] { "skeleton", "wither", "zombie", "char", "creeper"}; ++ private static final String[] a = new String[] { "skeleton", "wither", "zombie", "char", "creeper", "dragon"}; + + public ItemSkull() { + this.a(CreativeModeTab.c); @@ -2351,29 +1551,27 @@ index 0000000..a46cfef + this.a(true); + } + -+ public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2) { ++ public EnumInteractionResult a(ItemStack itemstack, EntityHuman entityhuman, World world, BlockPosition blockposition, EnumHand enumhand, EnumDirection enumdirection, float f, float f1, float f2) { + if (enumdirection == EnumDirection.DOWN) { -+ return false; ++ return EnumInteractionResult.FAIL; + } else { + IBlockData iblockdata = world.getType(blockposition); + Block block = iblockdata.getBlock(); -+ boolean flag = block.a(world, blockposition); ++ boolean flag = block.a((IBlockAccess) world, blockposition); + + if (!flag) { -+ if (!world.getType(blockposition).getBlock().getMaterial().isBuildable()) { -+ return false; ++ if (!world.getType(blockposition).getMaterial().isBuildable()) { ++ return EnumInteractionResult.FAIL; + } + + blockposition = blockposition.shift(enumdirection); + } + -+ if (!entityhuman.a(blockposition, enumdirection, itemstack)) { -+ return false; -+ } else if (!Blocks.SKULL.canPlace(world, blockposition)) { -+ return false; -+ } else { -+ if (!world.isClientSide) { -+ world.setTypeAndData(blockposition, Blocks.SKULL.getBlockData().set(BlockSkull.FACING, enumdirection), 3); ++ if (entityhuman.a(blockposition, enumdirection, itemstack) && Blocks.SKULL.canPlace(world, blockposition)) { ++ if (world.isClientSide) { ++ return EnumInteractionResult.SUCCESS; ++ } else { ++ world.setTypeAndData(blockposition, Blocks.SKULL.getBlockData().set(BlockSkull.FACING, enumdirection), 11); + int i = 0; + + if (enumdirection == EnumDirection.UP) { @@ -2393,7 +1591,7 @@ index 0000000..a46cfef + + if (nbttagcompound.hasKeyOfType("SkullOwner", 10)) { + gameprofile = GameProfileSerializer.deserialize(nbttagcompound.getCompound("SkullOwner")); -+ } else if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && nbttagcompound.getString("SkullOwner").length() > 0) { ++ } else if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && !nbttagcompound.getString("SkullOwner").isEmpty()) { + gameprofile = new GameProfile((UUID) null, nbttagcompound.getString("SkullOwner")); + } + } @@ -2408,9 +1606,10 @@ index 0000000..a46cfef + } + + --itemstack.count; ++ return EnumInteractionResult.SUCCESS; + } -+ -+ return true; ++ } else { ++ return EnumInteractionResult.FAIL; + } + } + } @@ -2419,7 +1618,7 @@ index 0000000..a46cfef + return i; + } + -+ public String e_(ItemStack itemstack) { ++ public String f_(ItemStack itemstack) { + int i = itemstack.getData(); + + if (i < 0 || i >= ItemSkull.a.length) { @@ -2449,7 +1648,7 @@ index 0000000..a46cfef + + public boolean a(NBTTagCompound nbttagcompound) { + super.a(nbttagcompound); -+ if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && nbttagcompound.getString("SkullOwner").length() > 0) { ++ if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && !nbttagcompound.getString("SkullOwner").isEmpty()) { + GameProfile gameprofile = new GameProfile((UUID) null, nbttagcompound.getString("SkullOwner")); + + gameprofile = TileEntitySkull.b(gameprofile); @@ -2876,7 +2075,7 @@ index 0000000..648d255 +} diff --git a/src/main/java/net/minecraft/server/NibbleArray.java b/src/main/java/net/minecraft/server/NibbleArray.java new file mode 100644 -index 0000000..9306f97 +index 0000000..1509c77 --- /dev/null +++ b/src/main/java/net/minecraft/server/NibbleArray.java @@ -0,0 +1,58 @@ @@ -2934,13 +2133,13 @@ index 0000000..9306f97 + return i >> 1; + } + -+ public byte[] a() { ++ public byte[] asBytes() { + return this.a; + } +} diff --git a/src/main/java/net/minecraft/server/OldChunkLoader.java b/src/main/java/net/minecraft/server/OldChunkLoader.java new file mode 100644 -index 0000000..670d626 +index 0000000..30b1df3 --- /dev/null +++ b/src/main/java/net/minecraft/server/OldChunkLoader.java @@ -0,0 +1,145 @@ @@ -3041,9 +2240,9 @@ index 0000000..670d626 + + nbttagcompound1.setByte("Y", (byte) (l & 255)); + nbttagcompound1.setByteArray("Blocks", abyte); -+ nbttagcompound1.setByteArray("Data", nibblearray.a()); -+ nbttagcompound1.setByteArray("SkyLight", nibblearray1.a()); -+ nbttagcompound1.setByteArray("BlockLight", nibblearray2.a()); ++ nbttagcompound1.setByteArray("Data", nibblearray.asBytes()); ++ nbttagcompound1.setByteArray("SkyLight", nibblearray1.asBytes()); ++ nbttagcompound1.setByteArray("BlockLight", nibblearray2.asBytes()); + nbttaglist.add(nbttagcompound1); + } + } @@ -3055,7 +2254,7 @@ index 0000000..670d626 + for (j = 0; j < 16; ++j) { + for (k = 0; k < 16; ++k) { + blockposition_mutableblockposition.c(oldchunkloader_oldchunk.k << 4 | j, 0, oldchunkloader_oldchunk.l << 4 | k); -+ abyte1[k << 4 | j] = (byte) (worldchunkmanager.getBiome(blockposition_mutableblockposition, BiomeBase.ad).id & 255); ++ abyte1[k << 4 | j] = (byte) (BiomeBase.a(worldchunkmanager.getBiome(blockposition_mutableblockposition, Biomes.b)) & 255); + } + } + @@ -3091,7 +2290,7 @@ index 0000000..670d626 +} diff --git a/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java b/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java new file mode 100644 -index 0000000..9c7b691 +index 0000000..86f1be7 --- /dev/null +++ b/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java @@ -0,0 +1,39 @@ @@ -3109,10 +2308,10 @@ index 0000000..9c7b691 + public PacketHandshakingInSetProtocol() {} + + public void a(PacketDataSerializer packetdataserializer) throws IOException { -+ this.a = packetdataserializer.e(); ++ this.a = packetdataserializer.g(); + this.hostname = packetdataserializer.c(255); + this.port = packetdataserializer.readUnsignedShort(); -+ this.d = EnumProtocol.a(packetdataserializer.e()); ++ this.d = EnumProtocol.a(packetdataserializer.g()); + } + + public void b(PacketDataSerializer packetdataserializer) throws IOException { @@ -3136,25 +2335,39 @@ index 0000000..9c7b691 +} diff --git a/src/main/java/net/minecraft/server/PacketPlayInArmAnimation.java b/src/main/java/net/minecraft/server/PacketPlayInArmAnimation.java new file mode 100644 -index 0000000..c611db1 +index 0000000..cb0356e --- /dev/null +++ b/src/main/java/net/minecraft/server/PacketPlayInArmAnimation.java -@@ -0,0 +1,16 @@ +@@ -0,0 +1,30 @@ +package net.minecraft.server; + +import java.io.IOException; + +public class PacketPlayInArmAnimation implements Packet { + ++ private EnumHand a; ++ + public PacketPlayInArmAnimation() {} + -+ public void a(PacketDataSerializer packetdataserializer) throws IOException {} ++ public PacketPlayInArmAnimation(EnumHand enumhand) { ++ this.a = enumhand; ++ } + -+ public void b(PacketDataSerializer packetdataserializer) throws IOException {} ++ public void a(PacketDataSerializer packetdataserializer) throws IOException { ++ this.a = (EnumHand) packetdataserializer.a(EnumHand.class); ++ } ++ ++ public void b(PacketDataSerializer packetdataserializer) throws IOException { ++ packetdataserializer.a((Enum) this.a); ++ } + + public void a(PacketListenerPlayIn packetlistenerplayin) { + packetlistenerplayin.a(this); + } ++ ++ public EnumHand a() { ++ return this.a; ++ } +} diff --git a/src/main/java/net/minecraft/server/PacketPlayInChat.java b/src/main/java/net/minecraft/server/PacketPlayInChat.java new file mode 100644 @@ -3196,219 +2409,169 @@ index 0000000..0ab90f3 + return this.a; + } +} -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java new file mode 100644 -index 0000000..6e368f5 +index 0000000..c5147b6 --- /dev/null -+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -@@ -0,0 +1,119 @@ ++++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java +@@ -0,0 +1,38 @@ +package net.minecraft.server; + -+import com.google.common.collect.Lists; +import java.io.IOException; -+import java.util.ArrayList; -+import java.util.Iterator; ++ ++public class PacketPlayOutChat implements Packet { ++ ++ private IChatBaseComponent a; ++ private byte b; ++ ++ public PacketPlayOutChat() {} ++ ++ public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent) { ++ this(ichatbasecomponent, (byte) 1); ++ } ++ ++ public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, byte b0) { ++ this.a = ichatbasecomponent; ++ this.b = b0; ++ } ++ ++ public void a(PacketDataSerializer packetdataserializer) throws IOException { ++ this.a = packetdataserializer.f(); ++ this.b = packetdataserializer.readByte(); ++ } ++ ++ public void b(PacketDataSerializer packetdataserializer) throws IOException { ++ packetdataserializer.a(this.a); ++ packetdataserializer.writeByte(this.b); ++ } ++ ++ public void a(PacketListenerPlayOut packetlistenerplayout) { ++ packetlistenerplayout.a(this); ++ } ++ ++ public boolean b() { ++ return this.b == 1 || this.b == 2; ++ } ++} +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +new file mode 100644 +index 0000000..b5dc220 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +@@ -0,0 +1,110 @@ ++package net.minecraft.server; ++ ++import io.netty.buffer.ByteBuf; ++import io.netty.buffer.Unpooled; ++import java.io.IOException; + +public class PacketPlayOutMapChunk implements Packet { + + private int a; + private int b; -+ private PacketPlayOutMapChunk.ChunkMap c; -+ private boolean d; ++ private int c; ++ private byte[] d; ++ private boolean e; + + public PacketPlayOutMapChunk() {} + + public PacketPlayOutMapChunk(Chunk chunk, boolean flag, int i) { + this.a = chunk.locX; + this.b = chunk.locZ; -+ this.d = flag; -+ this.c = a(chunk, flag, !chunk.getWorld().worldProvider.o(), i); ++ this.e = flag; ++ boolean flag1 = !chunk.getWorld().worldProvider.m(); ++ ++ this.d = new byte[a(chunk, flag, flag1, i)]; ++ this.c = a(new PacketDataSerializer(this.f()), chunk, flag, flag1, i); + } + + public void a(PacketDataSerializer packetdataserializer) throws IOException { + this.a = packetdataserializer.readInt(); + this.b = packetdataserializer.readInt(); -+ this.d = packetdataserializer.readBoolean(); -+ this.c = new PacketPlayOutMapChunk.ChunkMap(); -+ this.c.b = packetdataserializer.readShort(); -+ this.c.a = packetdataserializer.a(); ++ this.e = packetdataserializer.readBoolean(); ++ this.c = packetdataserializer.g(); ++ int i = packetdataserializer.g(); ++ ++ if (i > 2097152) { ++ throw new RuntimeException("Chunk Packet trying to allocate too much memory on read."); ++ } else { ++ this.d = new byte[i]; ++ packetdataserializer.readBytes(this.d); ++ } + } + + public void b(PacketDataSerializer packetdataserializer) throws IOException { + packetdataserializer.writeInt(this.a); + packetdataserializer.writeInt(this.b); -+ packetdataserializer.writeBoolean(this.d); -+ packetdataserializer.writeShort((short) (this.c.b & '\uffff')); -+ packetdataserializer.a(this.c.a); ++ packetdataserializer.writeBoolean(this.e); ++ packetdataserializer.b(this.c); ++ packetdataserializer.b(this.d.length); ++ packetdataserializer.writeBytes(this.d); + } + + public void a(PacketListenerPlayOut packetlistenerplayout) { + packetlistenerplayout.a(this); + } + -+ protected static int a(int i, boolean flag, boolean flag1) { -+ int j = i * 2 * 16 * 16 * 16; -+ int k = i * 16 * 16 * 16 / 2; -+ int l = flag ? i * 16 * 16 * 16 / 2 : 0; -+ int i1 = flag1 ? 256 : 0; ++ private ByteBuf f() { ++ ByteBuf bytebuf = Unpooled.wrappedBuffer(this.d); + -+ return j + k + l + i1; ++ bytebuf.writerIndex(0); ++ return bytebuf; + } + -+ public static PacketPlayOutMapChunk.ChunkMap a(Chunk chunk, boolean flag, boolean flag1, int i) { ++ public static int a(PacketDataSerializer packetdataserializer, Chunk chunk, boolean flag, boolean flag1, int i) { ++ int j = 0; + ChunkSection[] achunksection = chunk.getSections(); -+ PacketPlayOutMapChunk.ChunkMap packetplayoutmapchunk_chunkmap = new PacketPlayOutMapChunk.ChunkMap(); -+ ArrayList arraylist = Lists.newArrayList(); ++ int k = 0; + -+ int j; ++ for (int l = achunksection.length; k < l; ++k) { ++ ChunkSection chunksection = achunksection[k]; + -+ for (j = 0; j < achunksection.length; ++j) { -+ ChunkSection chunksection = achunksection[j]; -+ -+ if (chunksection != null && (!flag || !chunksection.a()) && (i & 1 << j) != 0) { -+ packetplayoutmapchunk_chunkmap.b |= 1 << j; -+ arraylist.add(chunksection); -+ } -+ } -+ -+ packetplayoutmapchunk_chunkmap.a = new byte[a(Integer.bitCount(packetplayoutmapchunk_chunkmap.b), flag1, flag)]; -+ j = 0; -+ Iterator iterator = arraylist.iterator(); -+ -+ ChunkSection chunksection1; -+ -+ while (iterator.hasNext()) { -+ chunksection1 = (ChunkSection) iterator.next(); -+ char[] achar = chunksection1.getIdArray(); -+ char[] achar1 = achar; -+ int k = achar.length; -+ -+ for (int l = 0; l < k; ++l) { -+ char c0 = achar1[l]; -+ -+ packetplayoutmapchunk_chunkmap.a[j++] = (byte) (c0 & 255); -+ packetplayoutmapchunk_chunkmap.a[j++] = (byte) (c0 >> 8 & 255); -+ } -+ } -+ -+ for (iterator = arraylist.iterator(); iterator.hasNext(); j = a(chunksection1.getEmittedLightArray().a(), packetplayoutmapchunk_chunkmap.a, j)) { -+ chunksection1 = (ChunkSection) iterator.next(); -+ } -+ -+ if (flag1) { -+ for (iterator = arraylist.iterator(); iterator.hasNext(); j = a(chunksection1.getSkyLightArray().a(), packetplayoutmapchunk_chunkmap.a, j)) { -+ chunksection1 = (ChunkSection) iterator.next(); ++ if (chunksection != Chunk.a && (!flag || !chunksection.a()) && (i & 1 << k) != 0) { ++ j |= 1 << k; ++ chunksection.getBlocks().b(packetdataserializer); ++ packetdataserializer.writeBytes(chunksection.getEmittedLightArray().asBytes()); ++ if (flag1) { ++ packetdataserializer.writeBytes(chunksection.getSkyLightArray().asBytes()); ++ } + } + } + + if (flag) { -+ a(chunk.getBiomeIndex(), packetplayoutmapchunk_chunkmap.a, j); ++ packetdataserializer.writeBytes(chunk.getBiomeIndex()); + } + -+ return packetplayoutmapchunk_chunkmap; ++ return j; + } + -+ private static int a(byte[] abyte, byte[] abyte1, int i) { -+ System.arraycopy(abyte, 0, abyte1, i, abyte.length); -+ return i + abyte.length; -+ } ++ protected static int a(Chunk chunk, boolean flag, boolean flag1, int i) { ++ int j = 0; ++ ChunkSection[] achunksection = chunk.getSections(); ++ int k = 0; + -+ public static class ChunkMap { ++ for (int l = achunksection.length; k < l; ++k) { ++ ChunkSection chunksection = achunksection[k]; + -+ public byte[] a; -+ public int b; -+ -+ public ChunkMap() {} -+ } -+} -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java -new file mode 100644 -index 0000000..63b90f7 ---- /dev/null -+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java -@@ -0,0 +1,79 @@ -+package net.minecraft.server; -+ -+import java.io.IOException; -+import java.util.List; -+ -+public class PacketPlayOutMapChunkBulk implements Packet { -+ -+ private int[] a; -+ private int[] b; -+ private PacketPlayOutMapChunk.ChunkMap[] c; -+ private boolean d; -+ -+ public PacketPlayOutMapChunkBulk() {} -+ -+ public PacketPlayOutMapChunkBulk(List list) { -+ int i = list.size(); -+ -+ this.a = new int[i]; -+ this.b = new int[i]; -+ this.c = new PacketPlayOutMapChunk.ChunkMap[i]; -+ this.d = !((Chunk) list.get(0)).getWorld().worldProvider.o(); -+ -+ for (int j = 0; j < i; ++j) { -+ Chunk chunk = (Chunk) list.get(j); -+ PacketPlayOutMapChunk.ChunkMap packetplayoutmapchunk_chunkmap = PacketPlayOutMapChunk.a(chunk, true, this.d, '\uffff'); -+ -+ this.a[j] = chunk.locX; -+ this.b[j] = chunk.locZ; -+ this.c[j] = packetplayoutmapchunk_chunkmap; ++ if (chunksection != Chunk.a && (!flag || !chunksection.a()) && (i & 1 << k) != 0) { ++ j += chunksection.getBlocks().a(); ++ j += chunksection.getEmittedLightArray().asBytes().length; ++ if (flag1) { ++ j += chunksection.getSkyLightArray().asBytes().length; ++ } ++ } + } + -+ } -+ -+ public void a(PacketDataSerializer packetdataserializer) throws IOException { -+ this.d = packetdataserializer.readBoolean(); -+ int i = packetdataserializer.e(); -+ -+ this.a = new int[i]; -+ this.b = new int[i]; -+ this.c = new PacketPlayOutMapChunk.ChunkMap[i]; -+ -+ int j; -+ -+ for (j = 0; j < i; ++j) { -+ this.a[j] = packetdataserializer.readInt(); -+ this.b[j] = packetdataserializer.readInt(); -+ this.c[j] = new PacketPlayOutMapChunk.ChunkMap(); -+ this.c[j].b = packetdataserializer.readShort() & '\uffff'; -+ this.c[j].a = new byte[PacketPlayOutMapChunk.a(Integer.bitCount(this.c[j].b), this.d, true)]; ++ if (flag) { ++ j += chunk.getBiomeIndex().length; + } + -+ for (j = 0; j < i; ++j) { -+ packetdataserializer.readBytes(this.c[j].a); -+ } -+ -+ } -+ -+ public void b(PacketDataSerializer packetdataserializer) throws IOException { -+ packetdataserializer.writeBoolean(this.d); -+ packetdataserializer.b(this.c.length); -+ -+ int i; -+ -+ for (i = 0; i < this.a.length; ++i) { -+ packetdataserializer.writeInt(this.a[i]); -+ packetdataserializer.writeInt(this.b[i]); -+ packetdataserializer.writeShort((short) (this.c[i].b & '\uffff')); -+ } -+ -+ for (i = 0; i < this.a.length; ++i) { -+ packetdataserializer.writeBytes(this.c[i].a); -+ } -+ -+ } -+ -+ public void a(PacketListenerPlayOut packetlistenerplayout) { -+ packetlistenerplayout.a(this); ++ return j; + } +} diff --git a/src/main/java/net/minecraft/server/PacketPlayOutOpenWindow.java b/src/main/java/net/minecraft/server/PacketPlayOutOpenWindow.java new file mode 100644 -index 0000000..c168194 +index 0000000..2bcdc17 --- /dev/null +++ b/src/main/java/net/minecraft/server/PacketPlayOutOpenWindow.java @@ -0,0 +1,56 @@ @@ -3449,7 +2612,7 @@ index 0000000..c168194 + public void a(PacketDataSerializer packetdataserializer) throws IOException { + this.a = packetdataserializer.readUnsignedByte(); + this.b = packetdataserializer.c(32); -+ this.c = packetdataserializer.d(); ++ this.c = packetdataserializer.f(); + this.d = packetdataserializer.readUnsignedByte(); + if (this.b.equals("EntityHorse")) { + this.e = packetdataserializer.readInt(); @@ -3470,7 +2633,7 @@ index 0000000..c168194 +} diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSwell.java b/src/main/java/net/minecraft/server/PathfinderGoalSwell.java new file mode 100644 -index 0000000..c8eebf8 +index 0000000..bab71cc --- /dev/null +++ b/src/main/java/net/minecraft/server/PathfinderGoalSwell.java @@ -0,0 +1,39 @@ @@ -3489,11 +2652,11 @@ index 0000000..c8eebf8 + public boolean a() { + EntityLiving entityliving = this.a.getGoalTarget(); + -+ return this.a.cm() > 0 || entityliving != null && this.a.h(entityliving) < 9.0D; ++ return this.a.da() > 0 || entityliving != null && this.a.h(entityliving) < 9.0D; + } + + public void c() { -+ this.a.getNavigation().n(); ++ this.a.getNavigation().o(); + this.b = this.a.getGoalTarget(); + } + @@ -3515,10 +2678,10 @@ index 0000000..c8eebf8 +} diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java new file mode 100644 -index 0000000..4b8d548 +index 0000000..c29e3f7 --- /dev/null +++ b/src/main/java/net/minecraft/server/PersistentCollection.java -@@ -0,0 +1,184 @@ +@@ -0,0 +1,183 @@ +package net.minecraft.server; + +import com.google.common.collect.Lists; @@ -3685,9 +2848,8 @@ index 0000000..4b8d548 + + while (iterator.hasNext()) { + String s1 = (String) iterator.next(); -+ short short0 = ((Short) this.d.get(s1)).shortValue(); + -+ nbttagcompound.setShort(s1, short0); ++ nbttagcompound.setShort(s1, ((Short) this.d.get(s1)).shortValue()); + } + + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(file)); @@ -3778,7 +2940,7 @@ index 0000000..b07e7d5 +} diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java new file mode 100644 -index 0000000..86b1f37 +index 0000000..968a1b7 --- /dev/null +++ b/src/main/java/net/minecraft/server/ServerConnection.java @@ -0,0 +1,175 @@ @@ -3858,7 +3020,7 @@ index 0000000..86b1f37 + Class oclass; + LazyInitVar lazyinitvar; + -+ if (Epoll.isAvailable() && this.f.ai()) { ++ if (Epoll.isAvailable() && this.f.ae()) { + oclass = EpollServerSocketChannel.class; + lazyinitvar = ServerConnection.b; + ServerConnection.e.info("Using epoll channel type"); @@ -3881,7 +3043,7 @@ index 0000000..86b1f37 + + ServerConnection.this.h.add(networkmanager); + channel.pipeline().addLast("packet_handler", networkmanager); -+ networkmanager.a((PacketListener) (new HandshakeListener(ServerConnection.this.f, networkmanager))); ++ networkmanager.setPacketListener(new HandshakeListener(ServerConnection.this.f, networkmanager)); + } + }).group((EventLoopGroup) lazyinitvar.c()).localAddress(inetaddress, i)).bind().syncUninterruptibly()); + } @@ -3913,14 +3075,11 @@ index 0000000..86b1f37 + final NetworkManager networkmanager = (NetworkManager) iterator.next(); + + if (!networkmanager.h()) { -+ if (!networkmanager.g()) { -+ iterator.remove(); -+ networkmanager.l(); -+ } else { ++ if (networkmanager.isConnected()) { + try { + networkmanager.a(); + } catch (Exception exception) { -+ if (networkmanager.c()) { ++ if (networkmanager.isLocal()) { + CrashReport crashreport = CrashReport.a(exception, "Ticking memory connection"); + CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Ticking connection"); + @@ -3939,13 +3098,16 @@ index 0000000..86b1f37 + ServerConnection.e.warn("Failed to handle packet for " + networkmanager.getSocketAddress(), exception); + final ChatComponentText chatcomponenttext = new ChatComponentText("Internal server error"); + -+ networkmanager.a(new PacketPlayOutKickDisconnect(chatcomponenttext), new GenericFutureListener() { ++ networkmanager.sendPacket(new PacketPlayOutKickDisconnect(chatcomponenttext), new GenericFutureListener() { + public void operationComplete(Future future) throws Exception { + networkmanager.close(chatcomponenttext); + } + }, new GenericFutureListener[0]); -+ networkmanager.k(); ++ networkmanager.stopReading(); + } ++ } else { ++ iterator.remove(); ++ networkmanager.handleDisconnection(); + } + } + } @@ -3959,7 +3121,7 @@ index 0000000..86b1f37 +} diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java new file mode 100644 -index 0000000..46845cd +index 0000000..76bd9c1 --- /dev/null +++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java @@ -0,0 +1,212 @@ @@ -4028,14 +3190,14 @@ index 0000000..46845cd + this.e.add(statistic); + if (statistic.d() && j == 0 && i > 0) { + this.g = true; -+ if (this.c.aB()) { ++ if (this.c.ax()) { + this.c.getPlayerList().sendMessage(new ChatMessage("chat.type.achievement", new Object[] { entityhuman.getScoreboardDisplayName(), statistic.j()})); + } + } + + if (statistic.d() && j > 0 && i == 0) { + this.g = true; -+ if (this.c.aB()) { ++ if (this.c.ax()) { + this.c.getPlayerList().sendMessage(new ChatMessage("chat.type.achievement.taken", new Object[] { entityhuman.getScoreboardDisplayName(), statistic.j()})); + } + } @@ -4138,7 +3300,7 @@ index 0000000..46845cd + } + + public void a(EntityPlayer entityplayer) { -+ int i = this.c.at(); ++ int i = this.c.ap(); + HashMap hashmap = Maps.newHashMap(); + + if (this.g || i - this.f > 300) { @@ -4177,10 +3339,10 @@ index 0000000..46845cd +} diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java new file mode 100644 -index 0000000..0bced98 +index 0000000..dacba33 --- /dev/null +++ b/src/main/java/net/minecraft/server/StructureGenerator.java -@@ -0,0 +1,237 @@ +@@ -0,0 +1,239 @@ +package net.minecraft.server; + +import com.google.common.collect.Maps; @@ -4192,24 +3354,26 @@ index 0000000..0bced98 + +public abstract class StructureGenerator extends WorldGenBase { + -+ private PersistentStructure d; -+ protected Map e = Maps.newHashMap(); ++ private PersistentStructure a; ++ protected Map c = Maps.newHashMap(); + + public StructureGenerator() {} + + public abstract String a(); + -+ protected final void a(World world, final int i, final int j, int k, int l, ChunkSnapshot chunksnapshot) { ++ protected final synchronized void a(World world, final int i, final int j, int k, int l, ChunkSnapshot chunksnapshot) { + this.a(world); -+ if (!this.e.containsKey(Long.valueOf(ChunkCoordIntPair.a(i, j)))) { -+ this.b.nextInt(); ++ if (!this.c.containsKey(Long.valueOf(ChunkCoordIntPair.a(i, j)))) { ++ this.f.nextInt(); + + try { + if (this.a(i, j)) { + StructureStart structurestart = this.b(i, j); + -+ this.e.put(Long.valueOf(ChunkCoordIntPair.a(i, j)), structurestart); -+ this.a(i, j, structurestart); ++ this.c.put(Long.valueOf(ChunkCoordIntPair.a(i, j)), structurestart); ++ if (structurestart.a()) { ++ this.a(i, j, structurestart); ++ } + } + + } catch (Throwable throwable) { @@ -4249,17 +3413,17 @@ index 0000000..0bced98 + } + } + -+ public boolean a(World world, Random random, ChunkCoordIntPair chunkcoordintpair) { ++ public synchronized boolean a(World world, Random random, ChunkCoordIntPair chunkcoordintpair) { + this.a(world); + int i = (chunkcoordintpair.x << 4) + 8; + int j = (chunkcoordintpair.z << 4) + 8; + boolean flag = false; -+ Iterator iterator = this.e.values().iterator(); ++ Iterator iterator = this.c.values().iterator(); + + while (iterator.hasNext()) { + StructureStart structurestart = (StructureStart) iterator.next(); + -+ if (structurestart.d() && structurestart.a(chunkcoordintpair) && structurestart.a().a(i, j, i + 15, j + 15)) { ++ if (structurestart.a() && structurestart.a(chunkcoordintpair) && structurestart.b().a(i, j, i + 15, j + 15)) { + structurestart.a(world, random, new StructureBoundingBox(i, j, i + 15, j + 15)); + structurestart.b(chunkcoordintpair); + flag = true; @@ -4271,18 +3435,18 @@ index 0000000..0bced98 + } + + public boolean b(BlockPosition blockposition) { -+ this.a(this.c); ++ this.a(this.g); + return this.c(blockposition) != null; + } + + protected StructureStart c(BlockPosition blockposition) { -+ Iterator iterator = this.e.values().iterator(); ++ Iterator iterator = this.c.values().iterator(); + + while (iterator.hasNext()) { + StructureStart structurestart = (StructureStart) iterator.next(); + -+ if (structurestart.d() && structurestart.a().b((BaseBlockPosition) blockposition)) { -+ Iterator iterator1 = structurestart.b().iterator(); ++ if (structurestart.a() && structurestart.b().b((BaseBlockPosition) blockposition)) { ++ Iterator iterator1 = structurestart.c().iterator(); + + while (iterator1.hasNext()) { + StructurePiece structurepiece = (StructurePiece) iterator1.next(); @@ -4297,9 +3461,9 @@ index 0000000..0bced98 + return null; + } + -+ public boolean a(World world, BlockPosition blockposition) { ++ public boolean b(World world, BlockPosition blockposition) { + this.a(world); -+ Iterator iterator = this.e.values().iterator(); ++ Iterator iterator = this.c.values().iterator(); + + StructureStart structurestart; + @@ -4309,25 +3473,25 @@ index 0000000..0bced98 + } + + structurestart = (StructureStart) iterator.next(); -+ } while (!structurestart.d() || !structurestart.a().b((BaseBlockPosition) blockposition)); ++ } while (!structurestart.a() || !structurestart.b().b((BaseBlockPosition) blockposition)); + + return true; + } + + public BlockPosition getNearestGeneratedFeature(World world, BlockPosition blockposition) { -+ this.c = world; ++ this.g = world; + this.a(world); -+ this.b.setSeed(world.getSeed()); -+ long i = this.b.nextLong(); -+ long j = this.b.nextLong(); ++ this.f.setSeed(world.getSeed()); ++ long i = this.f.nextLong(); ++ long j = this.f.nextLong(); + long k = (long) (blockposition.getX() >> 4) * i; + long l = (long) (blockposition.getZ() >> 4) * j; + -+ this.b.setSeed(k ^ l ^ world.getSeed()); ++ this.f.setSeed(k ^ l ^ world.getSeed()); + this.a(world, blockposition.getX() >> 4, blockposition.getZ() >> 4, 0, 0, (ChunkSnapshot) null); + double d0 = Double.MAX_VALUE; + BlockPosition blockposition1 = null; -+ Iterator iterator = this.e.values().iterator(); ++ Iterator iterator = this.c.values().iterator(); + + BlockPosition blockposition2; + double d1; @@ -4335,11 +3499,11 @@ index 0000000..0bced98 + while (iterator.hasNext()) { + StructureStart structurestart = (StructureStart) iterator.next(); + -+ if (structurestart.d()) { -+ StructurePiece structurepiece = (StructurePiece) structurestart.b().get(0); ++ if (structurestart.a()) { ++ StructurePiece structurepiece = (StructurePiece) structurestart.c().get(0); + + blockposition2 = structurepiece.a(); -+ d1 = blockposition2.i(blockposition); ++ d1 = blockposition2.k(blockposition); + if (d1 < d0) { + d0 = d1; + blockposition1 = blockposition2; @@ -4350,7 +3514,7 @@ index 0000000..0bced98 + if (blockposition1 != null) { + return blockposition1; + } else { -+ List list = this.z_(); ++ List list = this.E_(); + + if (list != null) { + BlockPosition blockposition3 = null; @@ -4358,7 +3522,7 @@ index 0000000..0bced98 + + while (iterator1.hasNext()) { + blockposition2 = (BlockPosition) iterator1.next(); -+ d1 = blockposition2.i(blockposition); ++ d1 = blockposition2.k(blockposition); + if (d1 < d0) { + d0 = d1; + blockposition3 = blockposition2; @@ -4372,18 +3536,18 @@ index 0000000..0bced98 + } + } + -+ protected List z_() { ++ protected List E_() { + return null; + } + -+ private void a(World world) { -+ if (this.d == null) { -+ this.d = (PersistentStructure) world.a(PersistentStructure.class, this.a()); -+ if (this.d == null) { -+ this.d = new PersistentStructure(this.a()); -+ world.a(this.a(), (PersistentBase) this.d); ++ protected void a(World world) { ++ if (this.a == null) { ++ this.a = (PersistentStructure) world.a(PersistentStructure.class, this.a()); ++ if (this.a == null) { ++ this.a = new PersistentStructure(this.a()); ++ world.a(this.a(), (PersistentBase) this.a); + } else { -+ NBTTagCompound nbttagcompound = this.d.a(); ++ NBTTagCompound nbttagcompound = this.a.a(); + Iterator iterator = nbttagcompound.c().iterator(); + + while (iterator.hasNext()) { @@ -4399,7 +3563,7 @@ index 0000000..0bced98 + StructureStart structurestart = WorldGenFactory.a(nbttagcompound1, world); + + if (structurestart != null) { -+ this.e.put(Long.valueOf(ChunkCoordIntPair.a(i, j)), structurestart); ++ this.c.put(Long.valueOf(ChunkCoordIntPair.a(i, j)), structurestart); + } + } + } @@ -4410,8 +3574,8 @@ index 0000000..0bced98 + } + + private void a(int i, int j, StructureStart structurestart) { -+ this.d.a(structurestart.a(i, j), i, j); -+ this.d.c(); ++ this.a.a(structurestart.a(i, j), i, j); ++ this.a.c(); + } + + protected abstract boolean a(int i, int j); @@ -4420,7 +3584,7 @@ index 0000000..0bced98 +} diff --git a/src/main/java/net/minecraft/server/WorldGenForestTree.java b/src/main/java/net/minecraft/server/WorldGenForestTree.java new file mode 100644 -index 0000000..ffbc47d +index 0000000..1753f3c --- /dev/null +++ b/src/main/java/net/minecraft/server/WorldGenForestTree.java @@ -0,0 +1,178 @@ @@ -4475,7 +3639,7 @@ index 0000000..ffbc47d + + k2 = k + j2; + BlockPosition blockposition2 = new BlockPosition(k1, k2, l1); -+ Material material = world.getType(blockposition2).getBlock().getMaterial(); ++ Material material = world.getType(blockposition2).getMaterial(); + + if (material == Material.AIR || material == Material.LEAVES) { + this.b(world, blockposition2); @@ -4594,9 +3758,9 @@ index 0000000..ffbc47d + + private void a(World world, int i, int j, int k) { + BlockPosition blockposition = new BlockPosition(i, j, k); -+ Block block = world.getType(blockposition).getBlock(); ++ Material material = world.getType(blockposition).getMaterial(); + -+ if (block.getMaterial() == Material.AIR) { ++ if (material == Material.AIR) { + this.a(world, blockposition, WorldGenForestTree.b); + } + @@ -4604,10 +3768,10 @@ index 0000000..ffbc47d +} diff --git a/src/main/java/net/minecraft/server/WorldGenLargeFeature.java b/src/main/java/net/minecraft/server/WorldGenLargeFeature.java new file mode 100644 -index 0000000..b2f87cc +index 0000000..462dc76 --- /dev/null +++ b/src/main/java/net/minecraft/server/WorldGenLargeFeature.java -@@ -0,0 +1,131 @@ +@@ -0,0 +1,139 @@ +package net.minecraft.server; + +import com.google.common.collect.Lists; @@ -4620,16 +3784,16 @@ index 0000000..b2f87cc + +public class WorldGenLargeFeature extends StructureGenerator { + -+ private static final List d = Arrays.asList(new BiomeBase[] { BiomeBase.DESERT, BiomeBase.DESERT_HILLS, BiomeBase.JUNGLE, BiomeBase.JUNGLE_HILLS, BiomeBase.SWAMPLAND}); -+ private List f; -+ private int g; ++ private static final List a = Arrays.asList(new BiomeBase[] { Biomes.d, Biomes.s, Biomes.w, Biomes.x, Biomes.h, Biomes.n, Biomes.F}); ++ private List b; ++ private int d; + private int h; + + public WorldGenLargeFeature() { -+ this.f = Lists.newArrayList(); -+ this.g = 32; ++ this.b = Lists.newArrayList(); ++ this.d = 32; + this.h = 8; -+ this.f.add(new BiomeBase.BiomeMeta(EntityWitch.class, 1, 1, 1)); ++ this.b.add(new BiomeBase.BiomeMeta(EntityWitch.class, 1, 1, 1)); + } + + public WorldGenLargeFeature(Map map) { @@ -4640,7 +3804,7 @@ index 0000000..b2f87cc + Entry entry = (Entry) iterator.next(); + + if (((String) entry.getKey()).equals("distance")) { -+ this.g = MathHelper.a((String) entry.getValue(), this.g, this.h + 1); ++ this.d = MathHelper.a((String) entry.getValue(), this.d, this.h + 1); + } + } + @@ -4655,29 +3819,29 @@ index 0000000..b2f87cc + int l = j; + + if (i < 0) { -+ i -= this.g - 1; ++ i -= this.d - 1; + } + + if (j < 0) { -+ j -= this.g - 1; ++ j -= this.d - 1; + } + -+ int i1 = i / this.g; -+ int j1 = j / this.g; -+ Random random = this.c.a(i1, j1, 14357617); ++ int i1 = i / this.d; ++ int j1 = j / this.d; ++ Random random = this.g.a(i1, j1, 14357617); + -+ i1 *= this.g; -+ j1 *= this.g; -+ i1 += random.nextInt(this.g - this.h); -+ j1 += random.nextInt(this.g - this.h); ++ i1 *= this.d; ++ j1 *= this.d; ++ i1 += random.nextInt(this.d - this.h); ++ j1 += random.nextInt(this.d - this.h); + if (k == i1 && l == j1) { -+ BiomeBase biomebase = this.c.getWorldChunkManager().getBiome(new BlockPosition(k * 16 + 8, 0, l * 16 + 8)); ++ BiomeBase biomebase = this.g.getWorldChunkManager().getBiome(new BlockPosition(k * 16 + 8, 0, l * 16 + 8)); + + if (biomebase == null) { + return false; + } + -+ Iterator iterator = WorldGenLargeFeature.d.iterator(); ++ Iterator iterator = WorldGenLargeFeature.a.iterator(); + + while (iterator.hasNext()) { + BiomeBase biomebase1 = (BiomeBase) iterator.next(); @@ -4692,14 +3856,14 @@ index 0000000..b2f87cc + } + + protected StructureStart b(int i, int j) { -+ return new WorldGenLargeFeature.WorldGenLargeFeatureStart(this.c, this.b, i, j); ++ return new WorldGenLargeFeature.WorldGenLargeFeatureStart(this.g, this.f, i, j); + } + + public boolean a(BlockPosition blockposition) { + StructureStart structurestart = this.c(blockposition); + + if (structurestart != null && structurestart instanceof WorldGenLargeFeature.WorldGenLargeFeatureStart && !structurestart.a.isEmpty()) { -+ StructurePiece structurepiece = (StructurePiece) structurestart.a.getFirst(); ++ StructurePiece structurepiece = (StructurePiece) structurestart.a.get(0); + + return structurepiece instanceof WorldGenRegistration.WorldGenWitchHut; + } else { @@ -4708,7 +3872,7 @@ index 0000000..b2f87cc + } + + public List b() { -+ return this.f; ++ return this.b; + } + + public static class WorldGenLargeFeatureStart extends StructureStart { @@ -4716,15 +3880,23 @@ index 0000000..b2f87cc + public WorldGenLargeFeatureStart() {} + + public WorldGenLargeFeatureStart(World world, Random random, int i, int j) { -+ super(i, j); -+ BiomeBase biomebase = world.getBiome(new BlockPosition(i * 16 + 8, 0, j * 16 + 8)); ++ this(world, random, i, j, world.getBiome(new BlockPosition(i * 16 + 8, 0, j * 16 + 8))); ++ } + -+ if (biomebase != BiomeBase.JUNGLE && biomebase != BiomeBase.JUNGLE_HILLS) { -+ if (biomebase == BiomeBase.SWAMPLAND) { ++ public WorldGenLargeFeatureStart(World world, Random random, int i, int j, BiomeBase biomebase) { ++ super(i, j); ++ if (biomebase != Biomes.w && biomebase != Biomes.x) { ++ if (biomebase == Biomes.h) { + WorldGenRegistration.WorldGenWitchHut worldgenregistration_worldgenwitchhut = new WorldGenRegistration.WorldGenWitchHut(random, i * 16, j * 16); + + this.a.add(worldgenregistration_worldgenwitchhut); -+ } else if (biomebase == BiomeBase.DESERT || biomebase == BiomeBase.DESERT_HILLS) { ++ } else if (biomebase != Biomes.d && biomebase != Biomes.s) { ++ if (biomebase == Biomes.n || biomebase == Biomes.F) { ++ WorldGenRegistration.b worldgenregistration_b = new WorldGenRegistration.b(random, i * 16, j * 16); ++ ++ this.a.add(worldgenregistration_b); ++ } ++ } else { + WorldGenRegistration.WorldGenPyramidPiece worldgenregistration_worldgenpyramidpiece = new WorldGenRegistration.WorldGenPyramidPiece(random, i * 16, j * 16); + + this.a.add(worldgenregistration_worldgenpyramidpiece); @@ -4735,16 +3907,16 @@ index 0000000..b2f87cc + this.a.add(worldgenregistration_worldgenjungletemple); + } + -+ this.c(); ++ this.d(); + } + } +} diff --git a/src/main/java/net/minecraft/server/WorldGenPackedIce2.java b/src/main/java/net/minecraft/server/WorldGenPackedIce2.java new file mode 100644 -index 0000000..dcd085a +index 0000000..1364bbc --- /dev/null +++ b/src/main/java/net/minecraft/server/WorldGenPackedIce2.java -@@ -0,0 +1,100 @@ +@@ -0,0 +1,103 @@ +package net.minecraft.server; + +import java.util.Random; @@ -4784,15 +3956,17 @@ index 0000000..dcd085a + float f2 = (float) MathHelper.a(j1) - 0.25F; + + if ((i1 == 0 && j1 == 0 || f1 * f1 + f2 * f2 <= f * f) && (i1 != -l && i1 != l && j1 != -l && j1 != l || random.nextFloat() <= 0.75F)) { -+ Block block = world.getType(blockposition.a(i1, k, j1)).getBlock(); ++ IBlockData iblockdata = world.getType(blockposition.a(i1, k, j1)); ++ Block block = iblockdata.getBlock(); + -+ if (block.getMaterial() == Material.AIR || block == Blocks.DIRT || block == Blocks.SNOW || block == Blocks.ICE) { ++ if (iblockdata.getMaterial() == Material.AIR || block == Blocks.DIRT || block == Blocks.SNOW || block == Blocks.ICE) { + this.a(world, blockposition.a(i1, k, j1), Blocks.PACKED_ICE.getBlockData()); + } + + if (k != 0 && l > 1) { -+ block = world.getType(blockposition.a(i1, -k, j1)).getBlock(); -+ if (block.getMaterial() == Material.AIR || block == Blocks.DIRT || block == Blocks.SNOW || block == Blocks.ICE) { ++ iblockdata = world.getType(blockposition.a(i1, -k, j1)); ++ block = iblockdata.getBlock(); ++ if (iblockdata.getMaterial() == Material.AIR || block == Blocks.DIRT || block == Blocks.SNOW || block == Blocks.ICE) { + this.a(world, blockposition.a(i1, -k, j1), Blocks.PACKED_ICE.getBlockData()); + } + } @@ -4821,9 +3995,10 @@ index 0000000..dcd085a + + while (true) { + if (blockposition1.getY() > 50) { -+ Block block1 = world.getType(blockposition1).getBlock(); ++ IBlockData iblockdata1 = world.getType(blockposition1); ++ Block block1 = iblockdata1.getBlock(); + -+ if (block1.getMaterial() == Material.AIR || block1 == Blocks.DIRT || block1 == Blocks.SNOW || block1 == Blocks.ICE || block1 == Blocks.PACKED_ICE) { ++ if (iblockdata1.getMaterial() == Material.AIR || block1 == Blocks.DIRT || block1 == Blocks.SNOW || block1 == Blocks.ICE || block1 == Blocks.PACKED_ICE) { + this.a(world, blockposition1, Blocks.PACKED_ICE.getBlockData()); + blockposition1 = blockposition1.down(); + --l1; @@ -4847,7 +4022,7 @@ index 0000000..dcd085a +} diff --git a/src/main/java/net/minecraft/server/WorldGenVillage.java b/src/main/java/net/minecraft/server/WorldGenVillage.java new file mode 100644 -index 0000000..411f2dc +index 0000000..2f43742 --- /dev/null +++ b/src/main/java/net/minecraft/server/WorldGenVillage.java @@ -0,0 +1,138 @@ @@ -4862,13 +4037,13 @@ index 0000000..411f2dc + +public class WorldGenVillage extends StructureGenerator { + -+ public static final List d = Arrays.asList(new BiomeBase[] { BiomeBase.PLAINS, BiomeBase.DESERT, BiomeBase.SAVANNA}); -+ private int f; -+ private int g; ++ public static final List a = Arrays.asList(new BiomeBase[] { Biomes.c, Biomes.d, Biomes.K}); ++ private int b; ++ private int d; + private int h; + + public WorldGenVillage() { -+ this.g = 32; ++ this.d = 32; + this.h = 8; + } + @@ -4880,9 +4055,9 @@ index 0000000..411f2dc + Entry entry = (Entry) iterator.next(); + + if (((String) entry.getKey()).equals("size")) { -+ this.f = MathHelper.a((String) entry.getValue(), this.f, 0); ++ this.b = MathHelper.a((String) entry.getValue(), this.b, 0); + } else if (((String) entry.getKey()).equals("distance")) { -+ this.g = MathHelper.a((String) entry.getValue(), this.g, this.h + 1); ++ this.d = MathHelper.a((String) entry.getValue(), this.d, this.h + 1); + } + } + @@ -4897,23 +4072,23 @@ index 0000000..411f2dc + int l = j; + + if (i < 0) { -+ i -= this.g - 1; ++ i -= this.d - 1; + } + + if (j < 0) { -+ j -= this.g - 1; ++ j -= this.d - 1; + } + -+ int i1 = i / this.g; -+ int j1 = j / this.g; -+ Random random = this.c.a(i1, j1, 10387312); ++ int i1 = i / this.d; ++ int j1 = j / this.d; ++ Random random = this.g.a(i1, j1, 10387312); + -+ i1 *= this.g; -+ j1 *= this.g; -+ i1 += random.nextInt(this.g - this.h); -+ j1 += random.nextInt(this.g - this.h); ++ i1 *= this.d; ++ j1 *= this.d; ++ i1 += random.nextInt(this.d - this.h); ++ j1 += random.nextInt(this.d - this.h); + if (k == i1 && l == j1) { -+ boolean flag = this.c.getWorldChunkManager().a(k * 16 + 8, l * 16 + 8, 0, WorldGenVillage.d); ++ boolean flag = this.g.getWorldChunkManager().a(k * 16 + 8, l * 16 + 8, 0, WorldGenVillage.a); + + if (flag) { + return true; @@ -4924,7 +4099,7 @@ index 0000000..411f2dc + } + + protected StructureStart b(int i, int j) { -+ return new WorldGenVillage.WorldGenVillageStart(this.c, this.b, i, j, this.f); ++ return new WorldGenVillage.WorldGenVillageStart(this.g, this.f, i, j, this.b); + } + + public static class WorldGenVillageStart extends StructureStart { @@ -4939,7 +4114,7 @@ index 0000000..411f2dc + WorldGenVillagePieces.WorldGenVillageStartPiece worldgenvillagepieces_worldgenvillagestartpiece = new WorldGenVillagePieces.WorldGenVillageStartPiece(world.getWorldChunkManager(), 0, random, (i << 4) + 2, (j << 4) + 2, list, k); + + this.a.add(worldgenvillagepieces_worldgenvillagestartpiece); -+ worldgenvillagepieces_worldgenvillagestartpiece.a((StructurePiece) worldgenvillagepieces_worldgenvillagestartpiece, (List) this.a, random); ++ worldgenvillagepieces_worldgenvillagestartpiece.a((StructurePiece) worldgenvillagepieces_worldgenvillagestartpiece, this.a, random); + List list1 = worldgenvillagepieces_worldgenvillagestartpiece.g; + List list2 = worldgenvillagepieces_worldgenvillagestartpiece.f; + @@ -4951,15 +4126,15 @@ index 0000000..411f2dc + if (list1.isEmpty()) { + l = random.nextInt(list2.size()); + structurepiece = (StructurePiece) list2.remove(l); -+ structurepiece.a((StructurePiece) worldgenvillagepieces_worldgenvillagestartpiece, (List) this.a, random); ++ structurepiece.a((StructurePiece) worldgenvillagepieces_worldgenvillagestartpiece, this.a, random); + } else { + l = random.nextInt(list1.size()); + structurepiece = (StructurePiece) list1.remove(l); -+ structurepiece.a((StructurePiece) worldgenvillagepieces_worldgenvillagestartpiece, (List) this.a, random); ++ structurepiece.a((StructurePiece) worldgenvillagepieces_worldgenvillagestartpiece, this.a, random); + } + } + -+ this.c(); ++ this.d(); + l = 0; + Iterator iterator = this.a.iterator(); + @@ -4974,7 +4149,7 @@ index 0000000..411f2dc + this.c = l > 2; + } + -+ public boolean d() { ++ public boolean a() { + return this.c; + } + @@ -4989,6 +4164,45 @@ index 0000000..411f2dc + } + } +} +diff --git a/src/main/java/net/minecraft/server/WorldGenVillagePieces.java b/src/main/java/net/minecraft/server/WorldGenVillagePieces.java +index 35d3ed1..dfd1474 100644 +--- a/src/main/java/net/minecraft/server/WorldGenVillagePieces.java ++++ b/src/main/java/net/minecraft/server/WorldGenVillagePieces.java +@@ -282,10 +282,10 @@ public class WorldGenVillagePieces { + + protected void a(NBTTagCompound nbttagcompound) { + super.a(nbttagcompound); +- nbttagcompound.setInt("CA", Block.REGISTRY.a(this.a)); +- nbttagcompound.setInt("CB", Block.REGISTRY.a(this.b)); +- nbttagcompound.setInt("CC", Block.REGISTRY.a(this.c)); +- nbttagcompound.setInt("CD", Block.REGISTRY.a(this.d)); ++ nbttagcompound.setInt("CA", Block.REGISTRY.a(this.a)); // Spigot - decompile error ++ nbttagcompound.setInt("CB", Block.REGISTRY.a(this.b)); // Spigot - decompile error ++ nbttagcompound.setInt("CC", Block.REGISTRY.a(this.c)); // Spigot - decompile error ++ nbttagcompound.setInt("CD", Block.REGISTRY.a(this.d)); // Spigot - decompile error + } + + protected void b(NBTTagCompound nbttagcompound) { +@@ -413,8 +413,8 @@ public class WorldGenVillagePieces { + + protected void a(NBTTagCompound nbttagcompound) { + super.a(nbttagcompound); +- nbttagcompound.setInt("CA", Block.REGISTRY.a(this.a)); +- nbttagcompound.setInt("CB", Block.REGISTRY.a(this.b)); ++ nbttagcompound.setInt("CA", Block.REGISTRY.a(this.a)); // Spigot - decompile error ++ nbttagcompound.setInt("CB", Block.REGISTRY.a(this.b)); // Spigot - decompile error + } + + protected void b(NBTTagCompound nbttagcompound) { +@@ -1602,7 +1602,7 @@ public class WorldGenVillagePieces { + entityvillager.setPositionRotation((double) j1 + 0.5D, (double) k1, (double) l1 + 0.5D, 0.0F, 0.0F); + entityvillager.prepare(world.D(new BlockPosition(entityvillager)), (GroupDataEntity) null); + entityvillager.setProfession(this.c(i1, entityvillager.getProfession())); +- world.addEntity(entityvillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason ++ world.addEntity(entityvillager); + } + + } diff --git a/src/main/java/org/spigotmc/SneakyThrow.java b/src/main/java/org/spigotmc/SneakyThrow.java new file mode 100644 index 0000000..31fc0a9 @@ -5011,5 +4225,5 @@ index 0000000..31fc0a9 + } +} -- -1.9.1 +2.5.0 diff --git a/CraftBukkit-Patches/0004-Obfuscation-Helpers.patch b/CraftBukkit-Patches/0004-Obfuscation-Helpers.patch index b3f33a205a..796349aa0b 100644 --- a/CraftBukkit-Patches/0004-Obfuscation-Helpers.patch +++ b/CraftBukkit-Patches/0004-Obfuscation-Helpers.patch @@ -1,4 +1,4 @@ -From c32e02f99891c045b408e3b5b922fa1bda94b672 Mon Sep 17 00:00:00 2001 +From 81c785f55dd68fa4b55c1626e3a2ab08e3776f7f Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 14 Apr 2014 10:38:04 +1000 Subject: [PATCH] Obfuscation Helpers @@ -6,22 +6,22 @@ Subject: [PATCH] Obfuscation Helpers Provides several friendly named methods which map to a obfuscated method. Obfuscated methods which are used frequently should be added to this file to ease with updates to new Minecraft versions. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 352409d..b79a2e7 100644 +index bf1678d..f965592 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1287,6 +1287,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -1263,6 +1263,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs } + // Spigot Start + public ServerConnection getServerConnection() + { -+ return this.q; ++ return this.p; + } + // Spigot End - public ServerConnection aq() { - return this.q; + public ServerConnection am() { + return this.p; } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0005-Spigot-Configuration.patch b/CraftBukkit-Patches/0005-Spigot-Configuration.patch index d692b27e73..ad5d6e34e0 100644 --- a/CraftBukkit-Patches/0005-Spigot-Configuration.patch +++ b/CraftBukkit-Patches/0005-Spigot-Configuration.patch @@ -1,4 +1,4 @@ -From 2c218e85d6a9ae48159aa7e90c9911de9dd64fac Mon Sep 17 00:00:00 2001 +From 92394ce4c8727ef50ae51c9090a6c8cdaaa29d73 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 7 Jul 2013 09:32:53 +1000 Subject: [PATCH] Spigot Configuration @@ -6,11 +6,11 @@ Subject: [PATCH] Spigot Configuration Provides the basic infrastructure to load and save the Spigot configuration file, spigot.yml diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 5402532..187d2f4 100644 +index c0aff53..53b5e87 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -162,6 +162,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer - if (this.R() < 0) { +@@ -165,6 +165,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + if (this.P() < 0) { this.setPort(this.propertyManager.getInt("server-port", 25565)); } + // Spigot start @@ -21,7 +21,7 @@ index 5402532..187d2f4 100644 DedicatedServer.LOGGER.info("Generating keypair"); this.a(MinecraftEncryption.b()); -@@ -176,7 +181,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -179,7 +184,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer return false; } @@ -35,10 +35,10 @@ index 5402532..187d2f4 100644 if (!this.getOnlineMode()) { DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!"); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f7c913d..1638081 100644 +index bb8fd66..bdedeee 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -102,6 +102,7 @@ public abstract class World implements IBlockAccess { +@@ -97,6 +97,7 @@ public abstract class World implements IBlockAccess { public long ticksPerMonsterSpawns; public boolean populating; private int tickPosition; @@ -46,7 +46,7 @@ index f7c913d..1638081 100644 public CraftWorld getWorld() { return this.world; -@@ -116,6 +117,7 @@ public abstract class World implements IBlockAccess { +@@ -111,6 +112,7 @@ public abstract class World implements IBlockAccess { } protected World(IDataManager idatamanager, WorldData worlddata, WorldProvider worldprovider, MethodProfiler methodprofiler, boolean flag, ChunkGenerator gen, org.bukkit.World.Environment env) { @@ -55,10 +55,10 @@ index f7c913d..1638081 100644 this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 5377181..d296924 100644 +index 6b37266..91965c0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -248,8 +248,10 @@ public final class CraftServer implements Server { +@@ -252,8 +252,10 @@ public final class CraftServer implements Server { chunkGCLoadThresh = configuration.getInt("chunk-gc.load-threshold"); loadIcon(); @@ -71,7 +71,7 @@ index 5377181..d296924 100644 } public boolean getCommandBlockOverride(String command) { -@@ -670,6 +672,7 @@ public final class CraftServer implements Server { +@@ -674,6 +676,7 @@ public final class CraftServer implements Server { logger.log(Level.WARNING, "Failed to load banned-players.json, " + ex.getMessage()); } @@ -79,7 +79,7 @@ index 5377181..d296924 100644 for (WorldServer world : console.worlds) { world.worldData.setDifficulty(difficulty); world.setSpawnFlags(monsters, animals); -@@ -684,11 +687,14 @@ public final class CraftServer implements Server { +@@ -688,11 +691,14 @@ public final class CraftServer implements Server { } else { world.ticksPerMonsterSpawns = this.getTicksPerMonsterSpawns(); } @@ -336,5 +336,5 @@ index 0000000..961ddb4 + } +} -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch b/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch deleted file mode 100644 index de642c4e58..0000000000 --- a/CraftBukkit-Patches/0006-Better-Chunk-Tick-Selection.patch +++ /dev/null @@ -1,196 +0,0 @@ -From 426206c162bab9cdffb452562b8ec8f608e76655 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Tue, 11 Jun 2013 12:56:02 +1000 -Subject: [PATCH] Better Chunk Tick Selection - -An optimized chunk ticking algorithm which better selects chunks around players which are active on the server. - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 1638081..5cb66a5 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -68,7 +68,7 @@ public abstract class World implements IBlockAccess { - public Scoreboard scoreboard = new Scoreboard(); // CraftBukkit - public - public final boolean isClientSide; - // CraftBukkit - longhashset -- protected LongHashSet chunkTickList = new LongHashSet(); -+ // protected LongHashSet chunkTickList = new LongHashSet(); // Spigot - private int L; - public boolean allowMonsters; // CraftBukkit - public - public boolean allowAnimals; // CraftBukkit - public -@@ -102,6 +102,31 @@ public abstract class World implements IBlockAccess { - public long ticksPerMonsterSpawns; - public boolean populating; - private int tickPosition; -+ -+ // Spigot start -+ protected final gnu.trove.map.hash.TLongShortHashMap chunkTickList; -+ protected float growthOdds = 100; -+ protected float modifiedOdds = 100; -+ private final byte chunkTickRadius; -+ -+ public static long chunkToKey(int x, int z) -+ { -+ long k = ( ( ( (long) x ) & 0xFFFF0000L ) << 16 ) | ( ( ( (long) x ) & 0x0000FFFFL ) << 0 ); -+ k |= ( ( ( (long) z ) & 0xFFFF0000L ) << 32 ) | ( ( ( (long) z ) & 0x0000FFFFL ) << 16 ); -+ return k; -+ } -+ -+ public static int keyToX(long k) -+ { -+ return (int) ( ( ( k >> 16 ) & 0xFFFF0000 ) | ( k & 0x0000FFFF ) ); -+ } -+ -+ public static int keyToZ(long k) -+ { -+ return (int) ( ( ( k >> 32 ) & 0xFFFF0000L ) | ( ( k >> 16 ) & 0x0000FFFF ) ); -+ } -+ // Spigot end -+ - public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot - - public CraftWorld getWorld() { -@@ -123,6 +148,12 @@ public abstract class World implements IBlockAccess { - this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit - this.ticksPerMonsterSpawns = this.getServer().getTicksPerMonsterSpawns(); // CraftBukkit - // CraftBukkit end -+ // Spigot start -+ this.chunkTickRadius = (byte) ( ( this.getServer().getViewDistance() < 7 ) ? this.getServer().getViewDistance() : 7 ); -+ this.chunkTickList = new gnu.trove.map.hash.TLongShortHashMap( spigotConfig.chunksPerTick * 5, 0.7f, Long.MIN_VALUE, Short.MIN_VALUE ); -+ this.chunkTickList.setAutoCompactionFactor( 0 ); -+ // Spigot end -+ - this.L = this.random.nextInt(12000); - this.allowMonsters = true; - this.allowAnimals = true; -@@ -1964,18 +1995,43 @@ public abstract class World implements IBlockAccess { - int k; - int l; - -+ // Spigot start -+ int optimalChunks = spigotConfig.chunksPerTick; -+ // Quick conditions to allow us to exist early -+ if ( optimalChunks > 0 ) { -+ // Keep chunks with growth inside of the optimal chunk range -+ int chunksPerPlayer = Math.min( 200, Math.max( 1, (int) ( ( ( optimalChunks - players.size() ) / (double) players.size() ) + 0.5 ) ) ); -+ int randRange = 3 + chunksPerPlayer / 30; -+ // Limit to normal tick radius - including view distance -+ randRange = ( randRange > chunkTickRadius ) ? chunkTickRadius : randRange; -+ // odds of growth happening vs growth happening in vanilla -+ this.growthOdds = this.modifiedOdds = Math.max( 35, Math.min( 100, ( ( chunksPerPlayer + 1 ) * 100F ) / 15F ) ); -+ // Spigot end - for (i = 0; i < this.players.size(); ++i) { - entityhuman = (EntityHuman) this.players.get(i); - j = MathHelper.floor(entityhuman.locX / 16.0D); - k = MathHelper.floor(entityhuman.locZ / 16.0D); - l = this.q(); - -- for (int i1 = -l; i1 <= l; ++i1) { -- for (int j1 = -l; j1 <= l; ++j1) { -- this.chunkTickList.add(org.bukkit.craftbukkit.util.LongHash.toLong(i1 + j, j1 + k)); -+ // Spigot start - Always update the chunk the player is on -+ long key = chunkToKey( j, k ); -+ int existingPlayers = Math.max( 0, chunkTickList.get( key ) ); // filter out -1 -+ chunkTickList.put( key, (short) ( existingPlayers + 1 ) ); -+ -+ // Check and see if we update the chunks surrounding the player this tick -+ for ( int chunk = 0; chunk < chunksPerPlayer; chunk++ ) -+ { -+ int dx = ( random.nextBoolean() ? 1 : -1 ) * random.nextInt( randRange ); -+ int dz = ( random.nextBoolean() ? 1 : -1 ) * random.nextInt( randRange ); -+ long hash = chunkToKey( dx + j, dz + k ); -+ if ( !chunkTickList.contains( hash ) && this.chunkProvider.isChunkLoaded(dx + j, dz + k ) ) -+ { -+ chunkTickList.put( hash, (short) -1 ); // no players - } - } - } -+ // Spigot End -+ } - - this.methodProfiler.b(); - if (this.L > 0) { -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d27aa67..690e7dc 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -357,12 +357,15 @@ public class WorldServer extends World implements IAsyncTaskHandler { - protected void h() { - super.h(); - if (this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) { -- Iterator iterator = this.chunkTickList.iterator(); -+ // Spigot start -+ gnu.trove.iterator.TLongShortIterator iterator = this.chunkTickList.iterator(); - - while (iterator.hasNext()) { -- ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator.next(); -+ iterator.advance(); -+ long chunkCoord = iterator.key(); - -- this.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z).b(false); -+ this.getChunkAt(World.keyToX( chunkCoord ), World.keyToZ( chunkCoord )).b(false); -+ // Spigot end - } - - } else { -@@ -374,9 +377,21 @@ public class WorldServer extends World implements IAsyncTaskHandler { - // ChunkCoordIntPair chunkcoordintpair1 = (ChunkCoordIntPair) iterator1.next(); - // int k = chunkcoordintpair1.x * 16; - // int l = chunkcoordintpair1.z * 16; -- for (long chunkCoord : chunkTickList.popAll()) { -- int chunkX = LongHash.msw(chunkCoord); -- int chunkZ = LongHash.lsw(chunkCoord); -+ // Spigot start -+ for (gnu.trove.iterator.TLongShortIterator iter = chunkTickList.iterator(); iter.hasNext(); ) -+ { -+ iter.advance(); -+ long chunkCoord = iter.key(); -+ int chunkX = World.keyToX( chunkCoord ); -+ int chunkZ = World.keyToZ( chunkCoord ); -+ // If unloaded, or in procedd of being unloaded, drop it -+ if ( ( !this.chunkProvider.isChunkLoaded( chunkX, chunkZ ) ) || ( this.chunkProviderServer.unloadQueue.contains( chunkX, chunkZ ) ) ) -+ { -+ iter.remove(); -+ continue; -+ } -+ // Spigot end -+ // ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator.next(); - int k = chunkX * 16; - int l = chunkZ * 16; - -@@ -470,6 +485,12 @@ public class WorldServer extends World implements IAsyncTaskHandler { - } - - } -+ // Spigot Start -+ if ( spigotConfig.clearChunksOnTick ) -+ { -+ chunkTickList.clear(); -+ } -+ // Spigot End - } - - protected BlockPosition a(BlockPosition blockposition) { -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 961ddb4..90a227f 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -68,4 +68,15 @@ public class SpigotWorldConfig - config.addDefault( "world-settings.default." + path, def ); - return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) ); - } -+ -+ public int chunksPerTick; -+ public boolean clearChunksOnTick; -+ private void chunksPerTick() -+ { -+ chunksPerTick = getInt( "chunks-per-tick", 650 ); -+ log( "Chunks to Grow per Tick: " + chunksPerTick ); -+ -+ clearChunksOnTick = getBoolean( "clear-tick-list", false ); -+ log( "Clear tick list: " + clearChunksOnTick ); -+ } - } --- -2.1.4 - diff --git a/CraftBukkit-Patches/0007-Crop-Growth-Rates.patch b/CraftBukkit-Patches/0006-Crop-Growth-Rates.patch similarity index 62% rename from CraftBukkit-Patches/0007-Crop-Growth-Rates.patch rename to CraftBukkit-Patches/0006-Crop-Growth-Rates.patch index a37eb848c6..fc745eceaf 100644 --- a/CraftBukkit-Patches/0007-Crop-Growth-Rates.patch +++ b/CraftBukkit-Patches/0006-Crop-Growth-Rates.patch @@ -1,4 +1,4 @@ -From ceea89b9500f590905200814f6e7310c7a7fd2e3 Mon Sep 17 00:00:00 2001 +From 0f544805062834e55ff56f0cde813c693dbcc85d Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 21 Jun 2013 17:17:20 +1000 Subject: [PATCH] Crop Growth Rates @@ -6,13 +6,13 @@ Subject: [PATCH] Crop Growth Rates Allows configuring the growth rates of crops as a percentage of their normal growth rate. diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 4923f8b..6b02059 100644 +index 57f3981..12589d6 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -1009,4 +1009,16 @@ public class Block { - return 0; +@@ -857,4 +857,16 @@ public class Block { + private static void a(int i, String s, Block block) { + a(i, new MinecraftKey(s), block); } - // CraftBukkit end + + // Spigot start + public static float range(float min, float value, float max) { @@ -27,130 +27,103 @@ index 4923f8b..6b02059 100644 + // Spigot end } diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java -index 7f5e5ca..488e5c2 100644 +index f4b90e1..862075d 100644 --- a/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java -@@ -29,7 +29,7 @@ public class BlockCactus extends Block { +@@ -31,7 +31,7 @@ public class BlockCactus extends Block { if (i < 3) { int j = ((Integer) iblockdata.get(BlockCactus.AGE)).intValue(); - if (j == 15) { -+ if (j >= (byte) range(3, (world.growthOdds / world.spigotConfig.cactusModifier * 15) + 0.5F, 15)) { // Spigot ++ if (j >= (byte) range(3, (world.spigotConfig.cactusModifier / 100 * 15) + 0.5F, 15)) { // Spigot // world.setTypeUpdate(blockposition1, this.getBlockData()); // CraftBukkit IBlockData iblockdata1 = iblockdata.set(BlockCactus.AGE, Integer.valueOf(0)); diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java -index e3e898e..b91b220 100644 +index 062f769..d545d1a 100644 --- a/src/main/java/net/minecraft/server/BlockCrops.java +++ b/src/main/java/net/minecraft/server/BlockCrops.java -@@ -32,8 +32,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement - if (i < 7) { +@@ -54,7 +54,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement + if (i < this.g()) { float f = a((Block) this, world, blockposition); - if (random.nextInt((int) (25.0F / f) + 1) == 0) { -- // CraftBukkit start -+ if (random.nextInt((int) (world.growthOdds / world.spigotConfig.wheatModifier * (25.0F / f)) + 1) == 0) { // Spigot // CraftBukkit start - IBlockData data = iblockdata.set(AGE, Integer.valueOf(i + 1)); ++ if (random.nextInt((int) (world.spigotConfig.wheatModifier / 100 * (25.0F / f)) + 1) == 0) { // Spigot // CraftBukkit start + // CraftBukkit start + IBlockData data = this.setAge(i + 1); CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(data)); - // CraftBukkit end -diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java -index 147fb1f..844ad30 100644 ---- a/src/main/java/net/minecraft/server/BlockGrass.java -+++ b/src/main/java/net/minecraft/server/BlockGrass.java -@@ -45,7 +45,7 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement { - // CraftBukkit end - } else { - if (world.getLightLevel(blockposition.up()) >= 9) { -- for (int i = 0; i < 4; ++i) { -+ for (int i = 0; i < Math.min(4, Math.max(20, (int) (4 * 100F / world.growthOdds))); ++i) { // Spigot - BlockPosition blockposition1 = blockposition.a(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); - Block block = world.getType(blockposition1.up()).getBlock(); - IBlockData iblockdata1 = world.getType(blockposition1); diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java -index 160a063..7cf7a08 100644 +index fa7919e..e069252 100644 --- a/src/main/java/net/minecraft/server/BlockMushroom.java +++ b/src/main/java/net/minecraft/server/BlockMushroom.java -@@ -20,7 +20,7 @@ public class BlockMushroom extends BlockPlant implements IBlockFragilePlantEleme +@@ -23,7 +23,7 @@ public class BlockMushroom extends BlockPlant implements IBlockFragilePlantEleme public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { final int sourceX = blockposition.getX(), sourceY = blockposition.getY(), sourceZ = blockposition.getZ(); // CraftBukkit - if (random.nextInt(25) == 0) { -+ if (random.nextInt(Math.max(1, (int) world.growthOdds / world.spigotConfig.mushroomModifier * 25)) == 0) { // Spigot int i = 5; ++ if (random.nextInt(Math.max(1, (int) world.spigotConfig.mushroomModifier / 100 * 25)) == 0) { // Spigot int i = 5; boolean flag = true; Iterator iterator = BlockPosition.b(blockposition.a(-4, -1, -4), blockposition.a(4, 1, 4)).iterator(); -diff --git a/src/main/java/net/minecraft/server/BlockMycel.java b/src/main/java/net/minecraft/server/BlockMycel.java -index 70405d5..d2bd4dd 100644 ---- a/src/main/java/net/minecraft/server/BlockMycel.java -+++ b/src/main/java/net/minecraft/server/BlockMycel.java -@@ -44,7 +44,7 @@ public class BlockMycel extends Block { - // CraftBukkit end - } else { - if (world.getLightLevel(blockposition.up()) >= 9) { -- for (int i = 0; i < 4; ++i) { -+ for (int i = 0; i < Math.min(4, Math.max(20, (int) (4 * 100F / world.growthOdds))); ++i) { // Spigot - BlockPosition blockposition1 = blockposition.a(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); - IBlockData iblockdata1 = world.getType(blockposition1); - Block block = world.getType(blockposition1.up()).getBlock(); diff --git a/src/main/java/net/minecraft/server/BlockNetherWart.java b/src/main/java/net/minecraft/server/BlockNetherWart.java -index 1bb8015..374f06c 100644 +index b2ca55f..9cd8bd8 100644 --- a/src/main/java/net/minecraft/server/BlockNetherWart.java +++ b/src/main/java/net/minecraft/server/BlockNetherWart.java -@@ -27,7 +27,7 @@ public class BlockNetherWart extends BlockPlant { +@@ -29,7 +29,7 @@ public class BlockNetherWart extends BlockPlant { public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { int i = ((Integer) iblockdata.get(BlockNetherWart.AGE)).intValue(); - if (i < 3 && random.nextInt(10) == 0) { -+ if (i < 3 && random.nextInt(Math.max(1, (int) world.growthOdds / world.spigotConfig.wartModifier * 10)) == 0) { // Spigot ++ if (i < 3 && random.nextInt(Math.max(1, (int) world.spigotConfig.wartModifier / 100 * 10)) == 0) { // Spigot iblockdata = iblockdata.set(BlockNetherWart.AGE, Integer.valueOf(i + 1)); // world.setTypeAndData(blockposition, iblockdata, 2); // CraftBukkit org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(iblockdata)); // CraftBukkit diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java -index fae75fa..d00067d 100644 +index f507b83..b8c36a7 100644 --- a/src/main/java/net/minecraft/server/BlockReed.java +++ b/src/main/java/net/minecraft/server/BlockReed.java -@@ -28,7 +28,7 @@ public class BlockReed extends Block { +@@ -30,7 +30,7 @@ public class BlockReed extends Block { if (i < 3) { int j = ((Integer) iblockdata.get(BlockReed.AGE)).intValue(); - if (j == 15) { -+ if (j >= (byte) range(3, (world.growthOdds / world.spigotConfig.caneModifier * 15) + 0.5F, 15)) { // Spigot ++ if (j >= (byte) range(3, (world.spigotConfig.caneModifier /100 * 15) + 0.5F, 15)) { // Spigot // CraftBukkit start // world.setTypeUpdate(blockposition.up(), this.getBlockData()); // CraftBukkit BlockPosition upPos = blockposition.up(); diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java -index a2667d9..45fbf5c 100644 +index a2691a5..a60a7f8 100644 --- a/src/main/java/net/minecraft/server/BlockSapling.java +++ b/src/main/java/net/minecraft/server/BlockSapling.java -@@ -32,7 +32,7 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen +@@ -34,7 +34,7 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { if (!world.isClientSide) { super.b(world, blockposition, iblockdata, random); - if (world.getLightLevel(blockposition.up()) >= 9 && random.nextInt(7) == 0) { -+ if (world.getLightLevel(blockposition.up()) >= 9 && (random.nextInt(Math.max(2, (int) ((world.growthOdds / world.spigotConfig.saplingModifier * 7) + 0.5F))) == 0)) { // Spigot) { ++ if (world.getLightLevel(blockposition.up()) >= 9 && (random.nextInt(Math.max(2, (int) ((world.spigotConfig.saplingModifier / 100 * 7) + 0.5F))) == 0)) { // Spigot) { // CraftBukkit start world.captureTreeGeneration = true; // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java -index 2ff1a6b..2618c40 100644 +index 41200fa..53d99aa 100644 --- a/src/main/java/net/minecraft/server/BlockStem.java +++ b/src/main/java/net/minecraft/server/BlockStem.java -@@ -55,7 +55,7 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { +@@ -50,7 +50,7 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { if (world.getLightLevel(blockposition.up()) >= 9) { float f = BlockCrops.a((Block) this, world, blockposition); - if (random.nextInt((int) (25.0F / f) + 1) == 0) { -+ if (random.nextInt((int) (world.growthOdds / (this == Blocks.PUMPKIN_STEM? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) * (25.0F / f)) + 1) == 0) { // Spigot ++ if (random.nextInt((int) ((this == Blocks.PUMPKIN_STEM? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) / 100 * (25.0F / f)) + 1) == 0) { // Spigot int i = ((Integer) iblockdata.get(BlockStem.AGE)).intValue(); if (i < 7) { diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 90a227f..5749a45 100644 +index 961ddb4..8860a96 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -79,4 +79,37 @@ public class SpigotWorldConfig - clearChunksOnTick = getBoolean( "clear-tick-list", false ); - log( "Clear tick list: " + clearChunksOnTick ); +@@ -68,4 +68,37 @@ public class SpigotWorldConfig + config.addDefault( "world-settings.default." + path, def ); + return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) ); } + + // Crop growth rates @@ -187,5 +160,5 @@ index 90a227f..5749a45 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0008-Merge-tweaks-and-configuration.patch b/CraftBukkit-Patches/0007-Merge-tweaks-and-configuration.patch similarity index 91% rename from CraftBukkit-Patches/0008-Merge-tweaks-and-configuration.patch rename to CraftBukkit-Patches/0007-Merge-tweaks-and-configuration.patch index 936d518fbf..5c23a615a5 100644 --- a/CraftBukkit-Patches/0008-Merge-tweaks-and-configuration.patch +++ b/CraftBukkit-Patches/0007-Merge-tweaks-and-configuration.patch @@ -1,4 +1,4 @@ -From 132c9f128e9b958ba9161738329c811f68553833 Mon Sep 17 00:00:00 2001 +From ce110c7a6c2873311e74cc6391cdf8ebe7022b52 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 23 Mar 2013 09:46:33 +1100 Subject: [PATCH] Merge tweaks and configuration @@ -6,13 +6,13 @@ Subject: [PATCH] Merge tweaks and configuration This allows the merging of Experience orbs, as well as the configuration of the merge radius of items. Additionally it refactors the merge algorithm to be a better experience for players. diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 1eda0ef..8b7cd86 100644 +index 6009cac..7ea1150 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -122,7 +122,10 @@ public class EntityItem extends Entity { +@@ -123,7 +123,10 @@ public class EntityItem extends Entity { } - private void w() { + private void x() { - Iterator iterator = this.world.a(EntityItem.class, this.getBoundingBox().grow(0.5D, 0.0D, 0.5D)).iterator(); + // Spigot start + double radius = world.spigotConfig.itemMerge; @@ -21,7 +21,7 @@ index 1eda0ef..8b7cd86 100644 while (iterator.hasNext()) { EntityItem entityitem = (EntityItem) iterator.next(); -@@ -156,12 +159,14 @@ public class EntityItem extends Entity { +@@ -157,12 +160,14 @@ public class EntityItem extends Entity { } else if (itemstack1.count + itemstack.count > itemstack1.getMaxStackSize()) { return false; } else { @@ -43,10 +43,10 @@ index 1eda0ef..8b7cd86 100644 } } else { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 5cb66a5..75d335f 100644 +index bdedeee..a7c1afe 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -970,6 +970,23 @@ public abstract class World implements IBlockAccess { +@@ -898,6 +898,23 @@ public abstract class World implements IBlockAccess { // Not all projectiles extend EntityProjectile, so check for Bukkit interface instead event = CraftEventFactory.callProjectileLaunchEvent(entity); } @@ -71,10 +71,10 @@ index 5cb66a5..75d335f 100644 if (event != null && (event.isCancelled() || entity.dead)) { entity.dead = true; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 5749a45..7322703 100644 +index 8860a96..d4fb83c 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -112,4 +112,18 @@ public class SpigotWorldConfig +@@ -101,4 +101,18 @@ public class SpigotWorldConfig wheatModifier = getAndValidateGrowth( "Wheat" ); wartModifier = getAndValidateGrowth( "NetherWart" ); } @@ -94,5 +94,5 @@ index 5749a45..7322703 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0009-Async-Operation-Catching.patch b/CraftBukkit-Patches/0008-Async-Operation-Catching.patch similarity index 83% rename from CraftBukkit-Patches/0009-Async-Operation-Catching.patch rename to CraftBukkit-Patches/0008-Async-Operation-Catching.patch index cf5d689fb8..e667452aec 100644 --- a/CraftBukkit-Patches/0009-Async-Operation-Catching.patch +++ b/CraftBukkit-Patches/0008-Async-Operation-Catching.patch @@ -1,4 +1,4 @@ -From 4465c430d6b6e15762957e595385cc4fd7e7dbc2 Mon Sep 17 00:00:00 2001 +From dc01590bc8e5a48fa1bb790e2570e9a27c748ee0 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 25 Mar 2014 16:10:01 +1100 Subject: [PATCH] Async Operation Catching @@ -6,10 +6,10 @@ Subject: [PATCH] Async Operation Catching Catch and throw an exception when a potentially unsafe operation occurs on a thread other than the main server thread. diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 6b02059..66e099f 100644 +index 12589d6..1d2f580 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -309,9 +309,13 @@ public class Block { +@@ -274,9 +274,13 @@ public class Block { return 10; } @@ -26,10 +26,10 @@ index 6b02059..66e099f 100644 public int a(Random random) { return 1; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index ca28b72..8125cb9 100644 +index f832dc7..d5bfef5 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -570,6 +570,7 @@ public abstract class EntityLiving extends Entity { +@@ -618,6 +618,7 @@ public abstract class EntityLiving extends Entity { } public void addEffect(MobEffect mobeffect) { @@ -38,18 +38,18 @@ index ca28b72..8125cb9 100644 if (isTickingEffects) { effectsToProcess.add(mobeffect); diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java -index 7a76dd0..e1ff4f0 100644 +index ed9b0e5..0c19e5a 100644 --- a/src/main/java/net/minecraft/server/EntityTracker.java +++ b/src/main/java/net/minecraft/server/EntityTracker.java -@@ -94,6 +94,7 @@ public class EntityTracker { +@@ -102,6 +102,7 @@ public class EntityTracker { } public void addEntity(Entity entity, int i, final int j, boolean flag) { + org.spigotmc.AsyncCatcher.catchOp( "entity track"); // Spigot - if (i > this.e) { - i = this.e; - } -@@ -144,6 +145,7 @@ public class EntityTracker { + try { + if (this.trackedEntities.b(entity.getId())) { + throw new IllegalStateException("Entity is already tracked!"); +@@ -146,6 +147,7 @@ public class EntityTracker { } public void untrackEntity(Entity entity) { @@ -58,10 +58,10 @@ index 7a76dd0..e1ff4f0 100644 EntityPlayer entityplayer = (EntityPlayer) entity; Iterator iterator = this.c.iterator(); diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 89422ea..f0149bf 100644 +index 8b38bd2..f8570a8 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -@@ -310,6 +310,7 @@ public class EntityTrackerEntry { +@@ -324,6 +324,7 @@ public class EntityTrackerEntry { } public void updatePlayer(EntityPlayer entityplayer) { @@ -69,19 +69,19 @@ index 89422ea..f0149bf 100644 if (entityplayer != this.tracker) { if (this.c(entityplayer)) { if (!this.trackedPlayers.contains(entityplayer) && (this.e(entityplayer) || this.tracker.attachedToPlayer)) { -@@ -540,6 +541,7 @@ public class EntityTrackerEntry { +@@ -558,6 +559,7 @@ public class EntityTrackerEntry { } public void clear(EntityPlayer entityplayer) { + org.spigotmc.AsyncCatcher.catchOp( "player tracker clear"); // Spigot if (this.trackedPlayers.contains(entityplayer)) { this.trackedPlayers.remove(entityplayer); - entityplayer.d(this.tracker); + this.tracker.c(entityplayer); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 75d335f..61db17c 100644 +index a7c1afe..010374f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -940,6 +940,7 @@ public abstract class World implements IBlockAccess { +@@ -868,6 +868,7 @@ public abstract class World implements IBlockAccess { } public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason @@ -89,27 +89,27 @@ index 75d335f..61db17c 100644 if (entity == null) return false; // CraftBukkit end int i = MathHelper.floor(entity.locX / 16.0D); -@@ -1047,6 +1048,7 @@ public abstract class World implements IBlockAccess { +@@ -974,6 +975,7 @@ public abstract class World implements IBlockAccess { } public void removeEntity(Entity entity) { + org.spigotmc.AsyncCatcher.catchOp( "entity remove"); // Spigot + entity.b(false); entity.die(); if (entity instanceof EntityHuman) { - this.players.remove(entity); -@@ -2491,6 +2493,7 @@ public abstract class World implements IBlockAccess { +@@ -2417,6 +2419,7 @@ public abstract class World implements IBlockAccess { } - public void b(Collection collection) { + public void a(Collection collection) { + org.spigotmc.AsyncCatcher.catchOp( "entity world add"); // Spigot // CraftBukkit start // this.entityList.addAll(collection); Iterator iterator = collection.iterator(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e3db8e1..07d1ee4 100644 +index 3777f40..eedf49b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -167,6 +167,7 @@ public class CraftWorld implements World { +@@ -166,6 +166,7 @@ public class CraftWorld implements World { } public boolean unloadChunkRequest(int x, int z, boolean safe) { @@ -117,7 +117,7 @@ index e3db8e1..07d1ee4 100644 if (safe && isChunkInUse(x, z)) { return false; } -@@ -177,6 +178,7 @@ public class CraftWorld implements World { +@@ -176,6 +177,7 @@ public class CraftWorld implements World { } public boolean unloadChunk(int x, int z, boolean save, boolean safe) { @@ -125,7 +125,7 @@ index e3db8e1..07d1ee4 100644 if (safe && isChunkInUse(x, z)) { return false; } -@@ -244,6 +246,7 @@ public class CraftWorld implements World { +@@ -239,6 +241,7 @@ public class CraftWorld implements World { } public boolean loadChunk(int x, int z, boolean generate) { @@ -134,10 +134,10 @@ index e3db8e1..07d1ee4 100644 if (generate) { // Use the default variant of loadChunk when generate == true. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e823f72..d4d6259 100644 +index 2c3ee37..cd51b41 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -210,6 +210,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -211,6 +211,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void kickPlayer(String message) { @@ -146,7 +146,7 @@ index e823f72..d4d6259 100644 getHandle().playerConnection.disconnect(message == null ? "" : message); diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java -index 197086e..fbea5db 100644 +index db4c1db..12768ed 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java @@ -42,6 +42,7 @@ public final class CraftScoreboardManager implements ScoreboardManager { @@ -181,5 +181,5 @@ index 0000000..4b3aa85 + } +} -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0010-View-Distance.patch b/CraftBukkit-Patches/0009-View-Distance.patch similarity index 76% rename from CraftBukkit-Patches/0010-View-Distance.patch rename to CraftBukkit-Patches/0009-View-Distance.patch index 17e5600e95..1c41ed7dd6 100644 --- a/CraftBukkit-Patches/0010-View-Distance.patch +++ b/CraftBukkit-Patches/0009-View-Distance.patch @@ -1,4 +1,4 @@ -From f738cff112c9dc5e25b93334c91f953914a805b0 Mon Sep 17 00:00:00 2001 +From 64c0667e827ec6dc583a7b346be5601838c4dd51 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 23 Mar 2013 09:52:41 +1100 Subject: [PATCH] View Distance @@ -6,11 +6,11 @@ Subject: [PATCH] View Distance This commit allows the user to select per world view distances, and view distances below 3. Be wary of the issues selecting a view distance of 1 or 2 may cause! diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 688d6f0..abb24c8 100644 +index 13d47d7..8ef7eb2 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -28,9 +28,9 @@ public class PlayerChunkMap { - private final int[][] i = new int[][] { { 1, 0}, { 0, 1}, { -1, 0}, { 0, -1}}; +@@ -49,9 +49,9 @@ public class PlayerChunkMap { + private boolean m = true; private boolean wasNotEmpty; // CraftBukkit - add field - public PlayerChunkMap(WorldServer worldserver) { @@ -20,25 +20,25 @@ index 688d6f0..abb24c8 100644 + this.a(viewDistance); // Spigot } - public WorldServer a() { + public WorldServer getWorld() { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 690e7dc..9c0bcfe 100644 +index c65e557..59b78bb 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -62,7 +62,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -57,7 +57,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { // CraftBukkit end this.server = minecraftserver; this.tracker = new EntityTracker(this); - this.manager = new PlayerChunkMap(this); + this.manager = new PlayerChunkMap(this, spigotConfig.viewDistance); // Spigot - this.worldProvider.a(this); - this.chunkProvider = this.k(); - this.Q = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit + this.worldProvider.a((World) this); + this.chunkProvider = this.n(); + this.portalTravelAgent = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 7322703..a3255eb 100644 +index d4fb83c..86300d6 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -126,4 +126,11 @@ public class SpigotWorldConfig +@@ -115,4 +115,11 @@ public class SpigotWorldConfig expMerge = getDouble("merge-radius.exp", 3.0 ); log( "Experience Merge Radius: " + expMerge ); } @@ -51,5 +51,5 @@ index 7322703..a3255eb 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0011-Spigot-Timings.patch b/CraftBukkit-Patches/0010-Spigot-Timings.patch similarity index 81% rename from CraftBukkit-Patches/0011-Spigot-Timings.patch rename to CraftBukkit-Patches/0010-Spigot-Timings.patch index de37be4b2f..f8f2d14048 100644 --- a/CraftBukkit-Patches/0011-Spigot-Timings.patch +++ b/CraftBukkit-Patches/0010-Spigot-Timings.patch @@ -1,4 +1,4 @@ -From aeb61b3275fa914e67e52712e4ef290120fb2226 Mon Sep 17 00:00:00 2001 +From b0bfccd96c4591deba5aa0f8a356cd2ee69f2775 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 10 Jan 2013 00:18:11 -0500 Subject: [PATCH] Spigot Timings @@ -6,60 +6,50 @@ Subject: [PATCH] Spigot Timings Overhauls the Timings System adding performance tracking all around the Minecraft Server diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 1b68736..7e7aa11 100644 +index 582e684..8345e87 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -901,6 +901,7 @@ public class Chunk { +@@ -834,6 +834,7 @@ public class Chunk { } - public void loadNearby(IChunkProvider ichunkprovider, IChunkProvider ichunkprovider1, int i, int j) { + public void loadNearby(IChunkProvider ichunkprovider, ChunkGenerator chunkgenerator) { + world.timings.syncChunkLoadPostTimer.startTiming(); // Spigot - boolean flag = ichunkprovider.isChunkLoaded(i, j - 1); - boolean flag1 = ichunkprovider.isChunkLoaded(i + 1, j); - boolean flag2 = ichunkprovider.isChunkLoaded(i, j + 1); -@@ -947,6 +948,7 @@ public class Chunk { - } + Chunk chunk = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ - 1); + Chunk chunk1 = ichunkprovider.getLoadedChunkAt(this.locX + 1, this.locZ); + Chunk chunk2 = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ + 1); +@@ -895,6 +896,7 @@ public class Chunk { + this.e(); } + world.timings.syncChunkLoadPostTimer.stopTiming(); // Spigot } - public BlockPosition h(BlockPosition blockposition) { + public BlockPosition f(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 0ae736d..af77eef 100644 +index 38b9d16..8f3cd56 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -132,6 +132,7 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -148,6 +148,7 @@ public class ChunkProviderServer implements IChunkProvider { // CraftBukkit end if (chunk == null) { + world.timings.syncChunkLoadTimer.startTiming(); // Spigot + long k = ChunkCoordIntPair.a(i, j); + chunk = this.loadChunk(i, j); - if (chunk == null) { - if (this.chunkProvider == null) { -@@ -183,6 +184,7 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -196,6 +197,7 @@ public class ChunkProviderServer implements IChunkProvider { } // CraftBukkit end - chunk.loadNearby(this, this, i, j); + chunk.loadNearby(this, this.chunkGenerator); + world.timings.syncChunkLoadTimer.stopTiming(); // Spigot } return chunk; -@@ -217,7 +219,9 @@ public class ChunkProviderServer implements IChunkProvider { - if (chunk != null) { - chunk.setLastSaved(this.world.getTime()); - if (this.chunkProvider != null) { -+ world.timings.syncChunkLoadStructuresTimer.startTiming(); // Spigot - this.chunkProvider.recreateStructures(chunk, i, j); -+ world.timings.syncChunkLoadStructuresTimer.stopTiming(); // Spigot - } - } - diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 706d976..206e3aa 100644 +index c8a89ed..c1b1e1a 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -42,7 +42,9 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -44,7 +44,9 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { // CraftBukkit start - Add async variant, provide compatibility public Chunk a(World world, int i, int j) throws IOException { @@ -69,7 +59,7 @@ index 706d976..206e3aa 100644 if (data != null) { Chunk chunk = (Chunk) data[0]; NBTTagCompound nbttagcompound = (NBTTagCompound) data[1]; -@@ -392,7 +394,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -347,7 +349,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { public void loadEntities(Chunk chunk, NBTTagCompound nbttagcompound, World world) { // CraftBukkit end @@ -78,8 +68,8 @@ index 706d976..206e3aa 100644 NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10); if (nbttaglist1 != null) { -@@ -418,7 +420,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - } +@@ -358,7 +360,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + chunk.g(true); } } - @@ -88,7 +78,7 @@ index 706d976..206e3aa 100644 NBTTagList nbttaglist2 = nbttagcompound.getList("TileEntities", 10); if (nbttaglist2 != null) { -@@ -431,6 +434,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -371,6 +374,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } } } @@ -97,7 +87,7 @@ index 706d976..206e3aa 100644 if (nbttagcompound.hasKeyOfType("TileTicks", 9)) { NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks", 10); -@@ -450,6 +455,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { +@@ -390,6 +395,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } } } @@ -106,10 +96,10 @@ index 706d976..206e3aa 100644 // return chunk; // CraftBukkit } diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 7240af0..da295f3 100644 +index 53b5e87..92dd207 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -20,6 +20,7 @@ import java.io.PrintStream; +@@ -22,6 +22,7 @@ import java.io.PrintStream; import org.apache.logging.log4j.Level; import org.bukkit.craftbukkit.LoggerOutputStream; @@ -117,44 +107,43 @@ index 7240af0..da295f3 100644 import org.bukkit.event.server.ServerCommandEvent; import org.bukkit.craftbukkit.util.Waitable; import org.bukkit.event.server.RemoteServerCommandEvent; -@@ -368,6 +369,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -394,6 +395,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } - public void aO() { + public void aL() { + SpigotTimings.serverCommandTimer.startTiming(); // Spigot - while (!this.l.isEmpty()) { - ServerCommand servercommand = (ServerCommand) this.l.remove(0); + while (!this.serverCommandQueue.isEmpty()) { + ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); -@@ -382,6 +384,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -407,6 +409,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer // CraftBukkit end } + SpigotTimings.serverCommandTimer.stopTiming(); // Spigot } - public boolean ae() { + public boolean aa() { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 914e3f3..dd1005a 100644 +index 4f0098f..63cc105 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -16,6 +16,7 @@ import org.bukkit.entity.Hanging; +@@ -24,6 +24,7 @@ import org.bukkit.block.BlockFace; + import org.bukkit.entity.Hanging; import org.bukkit.entity.LivingEntity; - import org.bukkit.entity.Painting; import org.bukkit.entity.Vehicle; +import org.spigotmc.CustomTimingsHandler; // Spigot import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent; - import org.bukkit.event.painting.PaintingBreakByEntityEvent; -@@ -115,6 +116,8 @@ public abstract class Entity implements ICommandListener { + import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; +@@ -139,6 +140,7 @@ public abstract class Entity implements ICommandListener { + public boolean valid; // CraftBukkit public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949 - + public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getEntityTimings(this); // Spigot -+ - public int getId() { - return this.id; - } -@@ -381,6 +384,7 @@ public abstract class Entity implements ICommandListener { + + public Entity(World world) { + this.id = Entity.entityCount++; +@@ -447,6 +449,7 @@ public abstract class Entity implements ICommandListener { } public void move(double d0, double d1, double d2) { @@ -162,20 +151,20 @@ index 914e3f3..dd1005a 100644 if (this.noclip) { this.a(this.getBoundingBox().c(d0, d1, d2)); this.recalcPosition(); -@@ -717,6 +721,7 @@ public abstract class Entity implements ICommandListener { +@@ -787,6 +790,7 @@ public abstract class Entity implements ICommandListener { this.world.methodProfiler.b(); } + org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot } - private void recalcPosition() { + public void recalcPosition() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 360d2ee..b8920fd 100644 +index 218dc63..3ca9a07 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -23,6 +23,8 @@ import org.bukkit.event.entity.EntityRegainHealthEvent; - import org.bukkit.event.vehicle.VehicleExitEvent; + import org.bukkit.event.player.PlayerItemConsumeEvent; // CraftBukkit end +import org.bukkit.craftbukkit.SpigotTimings; // Spigot @@ -183,41 +172,41 @@ index 360d2ee..b8920fd 100644 public abstract class EntityLiving extends Entity { private static final UUID a = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); -@@ -1435,6 +1437,7 @@ public abstract class EntityLiving extends Entity { +@@ -1673,6 +1675,7 @@ public abstract class EntityLiving extends Entity { } - public void t_() { + public void m() { + SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot - super.t_(); + super.m(); + this.cu(); if (!this.world.isClientSide) { - int i = this.bv(); -@@ -1473,7 +1476,9 @@ public abstract class EntityLiving extends Entity { +@@ -1745,7 +1748,9 @@ public abstract class EntityLiving extends Entity { } } + SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot - this.m(); + this.n(); + SpigotTimings.timerEntityTickRest.startTiming(); // Spigot double d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; float f = (float) (d0 * d0 + d1 * d1); -@@ -1538,6 +1543,7 @@ public abstract class EntityLiving extends Entity { +@@ -1815,6 +1820,7 @@ public abstract class EntityLiving extends Entity { + this.bo = 0; + } - this.world.methodProfiler.b(); - this.aT += f2; + SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot } protected float h(float f, float f1) { -@@ -1602,6 +1608,7 @@ public abstract class EntityLiving extends Entity { +@@ -1879,6 +1885,7 @@ public abstract class EntityLiving extends Entity { } this.world.methodProfiler.a("ai"); + SpigotTimings.timerEntityAI.startTiming(); // Spigot - if (this.bD()) { - this.aY = false; - this.aZ = 0.0F; -@@ -1612,6 +1619,7 @@ public abstract class EntityLiving extends Entity { + if (this.cf()) { + this.bc = false; + this.bd = 0.0F; +@@ -1889,6 +1896,7 @@ public abstract class EntityLiving extends Entity { this.doTick(); this.world.methodProfiler.b(); } @@ -225,43 +214,42 @@ index 360d2ee..b8920fd 100644 this.world.methodProfiler.b(); this.world.methodProfiler.a("jump"); -@@ -1633,11 +1641,15 @@ public abstract class EntityLiving extends Entity { - this.aZ *= 0.98F; - this.ba *= 0.98F; - this.bb *= 0.9F; +@@ -1911,10 +1919,14 @@ public abstract class EntityLiving extends Entity { + this.be *= 0.98F; + this.bf *= 0.9F; + this.r(); + SpigotTimings.timerEntityAIMove.startTiming(); // Spigot - this.g(this.aZ, this.ba); + this.g(this.bd, this.be); + SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot this.world.methodProfiler.b(); this.world.methodProfiler.a("push"); - if (!this.world.isClientSide) { -+ SpigotTimings.timerEntityAICollision.startTiming(); // Spigot - this.bL(); -+ SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot - } - ++ SpigotTimings.timerEntityAICollision.startTiming(); // Spigot + this.cn(); ++ SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot this.world.methodProfiler.b(); + } + diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b79a2e7..5d1aa0b 100644 +index f965592..9061ff2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -45,6 +45,7 @@ import jline.console.ConsoleReader; - import joptsimple.OptionSet; +@@ -45,6 +45,7 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.craftbukkit.Main; -+import org.bukkit.craftbukkit.SpigotTimings; // Spigot + // CraftBukkit start // CraftBukkit end ++import org.bukkit.craftbukkit.SpigotTimings; // Spigot public abstract class MinecraftServer implements Runnable, ICommandListener, IAsyncTaskHandler, IMojangStatistics { -@@ -616,6 +617,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs - protected void z() {} - protected void A() throws ExceptionWorldConflict { // CraftBukkit - added throws +@@ -617,6 +618,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + protected void B() {} + + protected void C() throws ExceptionWorldConflict { // CraftBukkit - added throws + SpigotTimings.serverTickTimer.startTiming(); // Spigot long i = System.nanoTime(); ++this.ticks; -@@ -642,10 +644,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -643,10 +645,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs } if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit @@ -274,7 +262,7 @@ index b79a2e7..5d1aa0b 100644 } this.methodProfiler.a("tallying"); -@@ -662,6 +666,8 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -663,6 +667,8 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.methodProfiler.b(); this.methodProfiler.b(); @@ -282,8 +270,8 @@ index b79a2e7..5d1aa0b 100644 + org.spigotmc.CustomTimingsHandler.tick(); // Spigot } - public void B() { -@@ -676,16 +682,23 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + public void D() { +@@ -677,16 +683,23 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.methodProfiler.c("levels"); @@ -307,7 +295,7 @@ index b79a2e7..5d1aa0b 100644 // Send time updates to everyone, it will get the right time from the world the player is in. if (this.ticks % 20 == 0) { for (int i = 0; i < this.getPlayerList().players.size(); ++i) { -@@ -693,6 +706,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -694,6 +707,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(entityplayer.world.getTime(), entityplayer.getPlayerTime(), entityplayer.world.getGameRules().getBoolean("doDaylightCycle"))); // Add support for per player time } } @@ -315,7 +303,7 @@ index b79a2e7..5d1aa0b 100644 int i; -@@ -716,7 +730,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -717,7 +731,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs CrashReport crashreport; try { @@ -325,7 +313,7 @@ index b79a2e7..5d1aa0b 100644 } catch (Throwable throwable) { crashreport = CrashReport.a(throwable, "Exception ticking world"); worldserver.a(crashreport); -@@ -724,7 +740,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -725,7 +741,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs } try { @@ -335,7 +323,7 @@ index b79a2e7..5d1aa0b 100644 } catch (Throwable throwable1) { crashreport = CrashReport.a(throwable1, "Exception ticking world entities"); worldserver.a(crashreport); -@@ -733,7 +751,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -734,7 +752,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.methodProfiler.b(); this.methodProfiler.a("tracker"); @@ -345,12 +333,12 @@ index b79a2e7..5d1aa0b 100644 this.methodProfiler.b(); this.methodProfiler.b(); // } // CraftBukkit -@@ -742,14 +762,20 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -743,14 +763,20 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs } this.methodProfiler.c("connection"); + SpigotTimings.connectionTimer.startTiming(); // Spigot - this.aq().c(); + this.am().c(); + SpigotTimings.connectionTimer.stopTiming(); // Spigot this.methodProfiler.c("players"); + SpigotTimings.playerListTimer.startTiming(); // Spigot @@ -359,26 +347,26 @@ index b79a2e7..5d1aa0b 100644 this.methodProfiler.c("tickables"); + SpigotTimings.tickablesTimer.startTiming(); // Spigot - for (i = 0; i < this.p.size(); ++i) { - ((IUpdatePlayerListBox) this.p.get(i)).c(); + for (i = 0; i < this.o.size(); ++i) { + ((ITickable) this.o.get(i)).c(); } + SpigotTimings.tickablesTimer.stopTiming(); // Spigot this.methodProfiler.b(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 1ee1abf..10e5032 100644 +index d39d2fe..212c576 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1090,6 +1090,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList +@@ -1234,6 +1234,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { // CraftBukkit end private void handleCommand(String s) { + org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot // CraftBukkit start - whole method - this.c.info(this.player.getName() + " issued server command: " + s); + this.LOGGER.info(this.player.getName() + " issued server command: " + s); -@@ -1099,18 +1100,22 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList +@@ -1243,18 +1244,22 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { this.server.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -402,7 +390,7 @@ index 1ee1abf..10e5032 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 513712d..b8d0961 100644 +index baf1d73..8bbdc11 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -6,10 +6,12 @@ import java.util.concurrent.Callable; @@ -419,19 +407,19 @@ index 513712d..b8d0961 100644 private static Map> f = Maps.newHashMap(); private static Map, String> g = Maps.newHashMap(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 61db17c..e34964f 100644 +index 010374f..b2305d9 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -21,6 +21,7 @@ import org.bukkit.Bukkit; +@@ -18,6 +18,7 @@ import com.google.common.collect.Maps; + import java.util.Map; + import org.bukkit.Bukkit; import org.bukkit.block.BlockState; - import org.bukkit.craftbukkit.util.CraftMagicNumbers; - import org.bukkit.craftbukkit.util.LongHashSet; +import org.bukkit.craftbukkit.SpigotTimings; // Spigot - import org.bukkit.generator.ChunkGenerator; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; -@@ -129,6 +130,8 @@ public abstract class World implements IBlockAccess { - + import org.bukkit.craftbukkit.event.CraftEventFactory; +@@ -99,6 +100,8 @@ public abstract class World implements IBlockAccess { + private int tickPosition; public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot + public final SpigotTimings.WorldTimingsHandler timings; // Spigot @@ -439,51 +427,49 @@ index 61db17c..e34964f 100644 public CraftWorld getWorld() { return this.world; } -@@ -193,6 +196,7 @@ public abstract class World implements IBlockAccess { - }); - this.getServer().addWorld(this.world); - // CraftBukkit end -+ timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings +@@ -131,6 +134,7 @@ public abstract class World implements IBlockAccess { + this.isClientSide = flag; + this.N = worldprovider.getWorldBorder(); + this.getServer().addWorld(this.world); // CraftBukkit ++ timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings } public World b() { -@@ -1302,6 +1306,7 @@ public abstract class World implements IBlockAccess { - this.g.clear(); - this.methodProfiler.c("regular"); +@@ -1303,6 +1307,7 @@ public abstract class World implements IBlockAccess { + CrashReportSystemDetails crashreportsystemdetails1; + CrashReport crashreport1; + timings.entityTick.startTiming(); // Spigot // CraftBukkit start - Use field for loop variable for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) { entity = (Entity) this.entityList.get(this.tickPosition); -@@ -1318,7 +1323,9 @@ public abstract class World implements IBlockAccess { +@@ -1320,7 +1325,9 @@ public abstract class World implements IBlockAccess { this.methodProfiler.a("tick"); - if (!entity.dead) { + if (!entity.dead && !(entity instanceof EntityPlayer)) { try { + SpigotTimings.tickEntityTimer.startTiming(); // Spigot this.g(entity); + SpigotTimings.tickEntityTimer.stopTiming(); // Spigot } catch (Throwable throwable1) { - crashreport = CrashReport.a(throwable1, "Ticking entity"); - crashreportsystemdetails = crashreport.a("Entity being ticked"); -@@ -1343,7 +1350,9 @@ public abstract class World implements IBlockAccess { + crashreport1 = CrashReport.a(throwable1, "Ticking entity"); + crashreportsystemdetails1 = crashreport1.a("Entity being ticked"); +@@ -1346,6 +1353,7 @@ public abstract class World implements IBlockAccess { this.methodProfiler.b(); } + timings.entityTick.stopTiming(); // Spigot this.methodProfiler.c("blockEntities"); -+ timings.tileEntityTick.startTiming(); // Spigot this.M = true; // CraftBukkit start - From below, clean up tile entities before ticking them - if (!this.c.isEmpty()) { -@@ -1362,6 +1371,7 @@ public abstract class World implements IBlockAccess { - +@@ -1366,6 +1374,7 @@ public abstract class World implements IBlockAccess { if (this.isLoaded(blockposition) && this.N.a(blockposition)) { try { + this.methodProfiler.a(tileentity.getClass().getSimpleName()); + tileentity.tickTimer.startTiming(); // Spigot - ((IUpdatePlayerListBox) tileentity).c(); + ((ITickable) tileentity).c(); + this.methodProfiler.b(); } catch (Throwable throwable2) { - CrashReport crashreport1 = CrashReport.a(throwable2, "Ticking block entity"); -@@ -1370,6 +1380,11 @@ public abstract class World implements IBlockAccess { +@@ -1374,6 +1383,11 @@ public abstract class World implements IBlockAccess { tileentity.a(crashreportsystemdetails1); throw new ReportedException(crashreport1); } @@ -495,7 +481,7 @@ index 61db17c..e34964f 100644 } } -@@ -1382,6 +1397,8 @@ public abstract class World implements IBlockAccess { +@@ -1386,6 +1400,8 @@ public abstract class World implements IBlockAccess { } } @@ -503,8 +489,8 @@ index 61db17c..e34964f 100644 + timings.tileEntityPending.startTiming(); // Spigot this.M = false; /* CraftBukkit start - Moved up - if (!this.c.isEmpty()) { -@@ -1414,6 +1431,7 @@ public abstract class World implements IBlockAccess { + if (!this.tileEntityListUnload.isEmpty()) { +@@ -1420,6 +1436,7 @@ public abstract class World implements IBlockAccess { this.b.clear(); } @@ -512,15 +498,15 @@ index 61db17c..e34964f 100644 this.methodProfiler.b(); this.methodProfiler.b(); } -@@ -1458,6 +1476,7 @@ public abstract class World implements IBlockAccess { +@@ -1463,6 +1480,7 @@ public abstract class World implements IBlockAccess { // CraftBukkit start - Use neighbor cache instead of looking up Chunk startingChunk = this.getChunkIfLoaded(i >> 4, j >> 4); if (!flag || (startingChunk != null && startingChunk.areNeighborsLoaded(2)) /* this.isAreaLoaded(i - b0, 0, j - b0, i + b0, 0, j + b0) */) { + entity.tickTimer.startTiming(); // Spigot // CraftBukkit end - entity.P = entity.locX; - entity.Q = entity.locY; -@@ -1521,6 +1540,7 @@ public abstract class World implements IBlockAccess { + entity.M = entity.locX; + entity.N = entity.locY; +@@ -1530,6 +1548,7 @@ public abstract class World implements IBlockAccess { } } @@ -529,25 +515,24 @@ index 61db17c..e34964f 100644 } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index bb0e146..f300850 100644 +index 59b78bb..f8a2195 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -223,10 +223,13 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -219,10 +219,13 @@ public class WorldServer extends World implements IAsyncTaskHandler { // CraftBukkit start - Only call spawner if we have players online and the world allows for mobs or animals long time = this.worldData.getTime(); if (this.getGameRules().getBoolean("doMobSpawning") && this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES && (this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.players.size() > 0)) { + timings.mobSpawn.startTiming(); // Spigot - this.R.a(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L), this.worldData.getTime() % 400L == 0L); + this.spawnerCreature.a(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L), this.worldData.getTime() % 400L == 0L); + timings.mobSpawn.stopTiming(); // Spigot // CraftBukkit end } -- -+ // CraftBukkit end + + timings.doChunkUnload.startTiming(); // Spigot this.methodProfiler.c("chunkSource"); this.chunkProvider.unloadChunks(); int j = this.a(1.0F); -@@ -240,21 +243,34 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -236,21 +239,35 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.worldData.setDayTime(this.worldData.getDayTime() + 1L); } @@ -558,7 +543,7 @@ index bb0e146..f300850 100644 + timings.doTickPending.stopTiming(); // Spigot this.methodProfiler.c("tickBlocks"); + timings.doTickTiles.startTiming(); // Spigot - this.h(); + this.j(); + timings.doTickTiles.stopTiming(); // Spigot this.methodProfiler.c("chunkMap"); + timings.doChunkMap.startTiming(); // Spigot @@ -571,11 +556,12 @@ index bb0e146..f300850 100644 + timings.doVillages.stopTiming(); // Spigot this.methodProfiler.c("portalForcer"); + timings.doPortalForcer.startTiming(); // Spigot - this.Q.a(this.getTime()); + this.portalTravelAgent.a(this.getTime()); + timings.doPortalForcer.stopTiming(); // Spigot this.methodProfiler.b(); + timings.doSounds.startTiming(); // Spigot - this.ak(); + this.ao(); ++ timings.doSounds.stopTiming(); // Spigot this.getWorld().processChunkGC(); // CraftBukkit + timings.doChunkGC.stopTiming(); // Spigot @@ -583,10 +569,10 @@ index bb0e146..f300850 100644 public BiomeBase.BiomeMeta a(EnumCreatureType enumcreaturetype, BlockPosition blockposition) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d296924..a8a8e64 100644 +index 91965c0..261b423 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1652,6 +1652,11 @@ public final class CraftServer implements Server { +@@ -1663,6 +1663,11 @@ public final class CraftServer implements Server { private final Spigot spigot = new Spigot() { @@ -599,17 +585,15 @@ index d296924..a8a8e64 100644 public Spigot spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index dc06dcb..59eb83e 100644 +index eedf49b..2b6928f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -257,9 +257,11 @@ public class CraftWorld implements World { - net.minecraft.server.Chunk chunk = world.chunkProviderServer.chunks.get(LongHash.toLong(x, z)); +@@ -252,7 +252,9 @@ public class CraftWorld implements World { + net.minecraft.server.Chunk chunk = world.getChunkProviderServer().chunks.get(LongHash.toLong(x, z)); if (chunk == null) { + world.timings.syncChunkLoadTimer.startTiming(); // Spigot - chunk = world.chunkProviderServer.loadChunk(x, z); - - chunkLoadPostProcess(chunk, x, z); + chunk = world.getChunkProviderServer().getOrLoadChunkAt(x, z); + world.timings.syncChunkLoadTimer.stopTiming(); // Spigot } return chunk != null; @@ -791,15 +775,15 @@ index 0000000..558574f + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -index c31f17f..1178ad7 100644 +index 6dfef44..482af17 100644 --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -@@ -49,7 +49,9 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider Date: Fri, 21 Jun 2013 17:29:54 +1000 Subject: [PATCH] Fix Mob Spawning Relative to View Distance @@ -8,20 +8,20 @@ Changes the mob spawning algorithm to properly account for view distance and the Needs better documentation. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7e7aa11..746cbce 100644 +index 8345e87..e4725b0 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -42,6 +42,7 @@ public class Chunk { - private long u; - private int v; - private ConcurrentLinkedQueue w; +@@ -43,6 +43,7 @@ public class Chunk { + private long v; + private int w; + private ConcurrentLinkedQueue x; + protected gnu.trove.map.hash.TObjectIntHashMap entityCount = new gnu.trove.map.hash.TObjectIntHashMap(); // Spigot // CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking private int neighbors = 0x1 << 12; -@@ -674,6 +675,22 @@ public class Chunk { - entity.af = k; - entity.ag = this.locZ; +@@ -606,6 +607,22 @@ public class Chunk { + entity.ac = k; + entity.ad = this.locZ; this.entitySlices[k].add(entity); + // Spigot start - increment creature type count + // Keep this synced up with World.a(Class) @@ -42,7 +42,7 @@ index 7e7aa11..746cbce 100644 } public void b(Entity entity) { -@@ -690,6 +707,22 @@ public class Chunk { +@@ -622,6 +639,22 @@ public class Chunk { } this.entitySlices[i].remove(entity); @@ -64,12 +64,12 @@ index 7e7aa11..746cbce 100644 + // Spigot end } - public boolean d(BlockPosition blockposition) { + public boolean c(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index cc1b347..3964e3f 100644 +index b3cb8bb..9e19dfd 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -19,6 +19,25 @@ public final class SpawnerCreature { +@@ -17,6 +17,25 @@ public final class SpawnerCreature { public SpawnerCreature() {} @@ -83,7 +83,7 @@ index cc1b347..3964e3f 100644 + Long coord = it.next(); + int x = LongHash.msw( coord ); + int z = LongHash.lsw( coord ); -+ if ( !server.chunkProviderServer.unloadQueue.contains( coord ) && server.isChunkLoaded( x, z, true ) ) ++ if ( !((ChunkProviderServer)server.chunkProvider).unloadQueue.contains( coord ) && server.isChunkLoaded( x, z, true ) ) + { + i += server.getChunkAt( x, z ).entityCount.get( oClass ); + } @@ -95,7 +95,7 @@ index cc1b347..3964e3f 100644 public int a(WorldServer worldserver, boolean flag, boolean flag1, boolean flag2) { if (!flag && !flag1) { return 0; -@@ -38,6 +57,11 @@ public final class SpawnerCreature { +@@ -36,6 +55,11 @@ public final class SpawnerCreature { j = MathHelper.floor(entityhuman.locZ / 16.0D); byte b0 = 8; @@ -107,7 +107,7 @@ index cc1b347..3964e3f 100644 for (int i1 = -b0; i1 <= b0; ++i1) { for (k = -b0; k <= b0; ++k) { -@@ -87,17 +111,19 @@ public final class SpawnerCreature { +@@ -89,18 +113,20 @@ public final class SpawnerCreature { if (limit == 0) { continue; } @@ -120,34 +120,33 @@ index cc1b347..3964e3f 100644 - if (k <= l1) { + if ((mobcnt = getEntityCount(worldserver, enumcreaturetype.a())) <= limit * i / 256) { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); Iterator iterator1 = this.b.iterator(); + int moblimit = (limit * i / 256) - mobcnt + 1; // Spigot - up to 1 more than limit - label115: + label120: - while (iterator1.hasNext()) { + while (iterator1.hasNext() && (moblimit > 0)) { // Spigot - while more allowed // CraftBukkit start = use LongHash and LongObjectHashMap long key = ((Long) iterator1.next()).longValue(); BlockPosition blockposition1 = getRandomPosition(worldserver, LongHash.msw(key), LongHash.lsw(key)); -@@ -156,6 +182,13 @@ public final class SpawnerCreature { - worldserver.addEntity(entityinsentient, SpawnReason.NATURAL); // CraftBukkit - Added a reason for spawning this creature +@@ -162,7 +188,10 @@ public final class SpawnerCreature { + entityinsentient.die(); } +- if (l2 >= entityinsentient.cJ()) { + // Spigot start -+ if ( --moblimit <= 0 ) -+ { ++ if ( --moblimit <= 0 ) { + // If we're past limit, stop spawn -+ continue label115; -+ } -+ // Spigot end - if (l2 >= entityinsentient.bV()) { - continue label115; ++ // Spigot end + continue label120; } + } diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index a3255eb..a85800d 100644 +index 86300d6..cacb8fc 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -133,4 +133,11 @@ public class SpigotWorldConfig +@@ -122,4 +122,11 @@ public class SpigotWorldConfig viewDistance = getInt( "view-distance", Bukkit.getViewDistance() ); log( "View Distance: " + viewDistance ); } @@ -160,5 +159,5 @@ index a3255eb..a85800d 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0013-Handle-Null-Tile-Entities.patch b/CraftBukkit-Patches/0012-Handle-Null-Tile-Entities.patch similarity index 84% rename from CraftBukkit-Patches/0013-Handle-Null-Tile-Entities.patch rename to CraftBukkit-Patches/0012-Handle-Null-Tile-Entities.patch index 9ec941987d..6017858396 100644 --- a/CraftBukkit-Patches/0013-Handle-Null-Tile-Entities.patch +++ b/CraftBukkit-Patches/0012-Handle-Null-Tile-Entities.patch @@ -1,14 +1,14 @@ -From 5846865ec3ebf4fcc2d6c35617cc6dddc6bc18a2 Mon Sep 17 00:00:00 2001 +From c3f267cdf3016e997fe73dff2eeb4434dd8486ad Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 3 Feb 2013 09:20:19 +1100 Subject: [PATCH] Handle Null Tile Entities diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e34964f..275856f 100644 +index b2305d9..ee249b6 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1365,6 +1365,13 @@ public abstract class World implements IBlockAccess { +@@ -1367,6 +1367,13 @@ public abstract class World implements IBlockAccess { while (iterator.hasNext()) { TileEntity tileentity = (TileEntity) iterator.next(); @@ -23,5 +23,5 @@ index e34964f..275856f 100644 if (!tileentity.x() && tileentity.t()) { BlockPosition blockposition = tileentity.getPosition(); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0043-Item-Despawn-Rate.patch b/CraftBukkit-Patches/0013-Item-Despawn-Rate.patch similarity index 72% rename from CraftBukkit-Patches/0043-Item-Despawn-Rate.patch rename to CraftBukkit-Patches/0013-Item-Despawn-Rate.patch index 849c328b90..8ca2320069 100644 --- a/CraftBukkit-Patches/0043-Item-Despawn-Rate.patch +++ b/CraftBukkit-Patches/0013-Item-Despawn-Rate.patch @@ -1,29 +1,29 @@ -From c2bf94e9b17ef38629028376bce393386400fe09 Mon Sep 17 00:00:00 2001 +From 9d325174af031a978b6485c0cd5d980cc12cfdb9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 22 Sep 2013 19:10:53 +1000 Subject: [PATCH] Item Despawn Rate diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index b80801a..abd85b0 100644 +index 7ea1150..eb0f8eb 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -108,7 +108,7 @@ public class EntityItem extends Entity { +@@ -109,7 +109,7 @@ public class EntityItem extends Entity { + // Craftbukkit end */ - - this.W(); + this.aj(); - if (!this.world.isClientSide && this.age >= 6000) { + if (!this.world.isClientSide && this.age >= world.spigotConfig.itemDespawnRate) { // Spigot // CraftBukkit start - fire ItemDespawnEvent if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { this.age = 0; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 15cb6b4..efbfa2e 100644 +index cacb8fc..ca888fc 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -200,4 +200,11 @@ public class SpigotWorldConfig - log( "*** WARNING *** Please use this option with caution, SpigotMC is not responsible for any issues this option may cause in the future!" ); - } +@@ -129,4 +129,11 @@ public class SpigotWorldConfig + mobSpawnRange = (byte) getInt( "mob-spawn-range", 4 ); + log( "Mob Spawn Range: " + mobSpawnRange ); } + + public int itemDespawnRate; @@ -34,5 +34,5 @@ index 15cb6b4..efbfa2e 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0014-Entity-Activation-Range.patch b/CraftBukkit-Patches/0014-Entity-Activation-Range.patch index 52be693122..23e715c3e4 100644 --- a/CraftBukkit-Patches/0014-Entity-Activation-Range.patch +++ b/CraftBukkit-Patches/0014-Entity-Activation-Range.patch @@ -1,4 +1,4 @@ -From e1f60c92d7fecfb32ad0a17e038abe5bbfca92f4 Mon Sep 17 00:00:00 2001 +From c71914cc83d2736d7ea1c2d8a44b5e93653f3f92 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 3 Feb 2013 05:10:21 -0500 Subject: [PATCH] Entity Activation Range @@ -9,44 +9,35 @@ This will drastically cut down on tick timings for entities that are not in rang This change can have dramatic impact on gameplay if configured too low. Balance according to your servers desired gameplay. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index dd1005a..2f386ac 100644 +index 63cc105..1817e6d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -89,14 +89,14 @@ public abstract class Entity implements ICommandListener { +@@ -107,7 +107,7 @@ public abstract class Entity implements ICommandListener { public int ticksLived; public int maxFireTicks; public int fireTicks; -- protected boolean inWater; +- public boolean inWater; + public boolean inWater; // Spigot - protected -> public // PAIL public int noDamageTicks; protected boolean justCreated; protected boolean fireProof; - protected DataWatcher datawatcher; - private double ar; - private double as; -- public boolean ad; -+ public boolean ad; public boolean isAddedToChunk() { return ad; } // Spigot // PAIL - public int ae; - public int af; - public int ag; -@@ -116,7 +116,13 @@ public abstract class Entity implements ICommandListener { +@@ -141,6 +141,12 @@ public abstract class Entity implements ICommandListener { public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949 - -+ // Spigot start public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getEntityTimings(this); // Spigot ++ // Spigot start + public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); + public final boolean defaultActivationState; + public long activatedTick = Integer.MIN_VALUE; + public void inactiveTick() { } + // Spigot end - public int getId() { - return this.id; -@@ -146,7 +152,12 @@ public abstract class Entity implements ICommandListener { + public Entity(World world) { + this.id = Entity.entityCount++; +@@ -160,7 +166,12 @@ public abstract class Entity implements ICommandListener { this.setPosition(0.0D, 0.0D, 0.0D); if (world != null) { - this.dimension = world.worldProvider.getDimension(); + this.dimension = world.worldProvider.getDimensionManager().getDimensionID(); + // Spigot start + this.defaultActivationState = org.spigotmc.ActivationRange.initializeEntityActivationState(this, world.spigotConfig); + } else { @@ -55,14 +46,14 @@ index dd1005a..2f386ac 100644 + // Spigot end this.datawatcher = new DataWatcher(this); - this.datawatcher.a(0, Byte.valueOf((byte) 0)); + this.datawatcher.register(Entity.ax, Byte.valueOf((byte) 0)); diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java -index 8a74059..09d4335 100644 +index e4a02bc..dbede68 100644 --- a/src/main/java/net/minecraft/server/EntityAgeable.java +++ b/src/main/java/net/minecraft/server/EntityAgeable.java -@@ -9,6 +9,31 @@ public abstract class EntityAgeable extends EntityCreature { - private float bn; - public boolean ageLocked = false; // CraftBukkit +@@ -10,6 +10,31 @@ public abstract class EntityAgeable extends EntityCreature { + private float bx; + public boolean ageLocked; // CraftBukkit + // Spigot start + @Override @@ -93,20 +84,20 @@ index 8a74059..09d4335 100644 super(world); } diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index 04863b3..3359160 100644 +index 1cda4e6..a40f3ec 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -15,7 +15,7 @@ public class EntityArrow extends Entity implements IProjectile { - private int f = -1; - private Block g; - private int h; -- private boolean inGround; -+ public boolean inGround = false; // Spigot - private -> public - public int fromPlayer; +@@ -27,7 +27,7 @@ public abstract class EntityArrow extends Entity implements IProjectile { + private int at; + private Block au; + private int av; +- protected boolean inGround; ++ public boolean inGround; // Spigot - protected -> public + protected int b; + public EntityArrow.PickupStatus fromPlayer; public int shake; - public Entity shooter; -@@ -24,6 +24,18 @@ public class EntityArrow extends Entity implements IProjectile { - private double damage = 2.0D; +@@ -37,6 +37,18 @@ public abstract class EntityArrow extends Entity implements IProjectile { + private double damage; public int knockbackStrength; + // Spigot Start @@ -115,7 +106,7 @@ index 04863b3..3359160 100644 + { + if ( this.inGround ) + { -+ this.ar += 1; // Despawn counter. First int after shooter ++ this.aw += 1; // Despawn counter. First int after shooter + } + super.inactiveTick(); + } @@ -123,32 +114,31 @@ index 04863b3..3359160 100644 + public EntityArrow(World world) { super(world); - this.j = 10.0D; + this.h = -1; diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java -index 34820c5..d7be6c2 100644 +index 7454fde..ff44aa4 100644 --- a/src/main/java/net/minecraft/server/EntityFireworks.java +++ b/src/main/java/net/minecraft/server/EntityFireworks.java -@@ -5,6 +5,15 @@ public class EntityFireworks extends Entity { - private int ticksFlown; - public int expectedLifespan; +@@ -13,6 +13,14 @@ public class EntityFireworks extends Entity { + this.setSize(0.25F, 0.25F); + } + // Spigot Start + @Override -+ public void inactiveTick() -+ { ++ public void inactiveTick() { + this.ticksFlown += 1; + super.inactiveTick(); + } + // Spigot End + - public EntityFireworks(World world) { - super(world); - this.setSize(0.25F, 0.25F); + protected void i() { + this.datawatcher.register(EntityFireworks.FIREWORK_ITEM, Optional.absent()); + } diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 8b7cd86..fe9a000 100644 +index eb0f8eb..39af5d5 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -121,6 +121,28 @@ public class EntityItem extends Entity { +@@ -122,6 +122,28 @@ public class EntityItem extends Entity { } } @@ -174,16 +164,16 @@ index 8b7cd86..fe9a000 100644 + } + // Spigot end + - private void w() { + private void x() { // Spigot start double radius = world.spigotConfig.itemMerge; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index b8920fd..bd30895 100644 +index e5704fd..1ed0400 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -89,6 +89,13 @@ public abstract class EntityLiving extends Entity { - public int maxAirTicks = 300; - ArrayList drops = null; +@@ -102,6 +102,13 @@ public abstract class EntityLiving extends Entity { + ArrayList drops; + public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes; // CraftBukkit end + // Spigot start + public void inactiveTick() @@ -193,21 +183,21 @@ index b8920fd..bd30895 100644 + } + // Spigot end - public void G() { + public void Q() { this.damageEntity(DamageSource.OUT_OF_WORLD, Float.MAX_VALUE); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 275856f..b959a79 100644 +index ee249b6..2eaa1cb 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1306,6 +1306,7 @@ public abstract class World implements IBlockAccess { - this.g.clear(); - this.methodProfiler.c("regular"); +@@ -1307,6 +1307,7 @@ public abstract class World implements IBlockAccess { + CrashReportSystemDetails crashreportsystemdetails1; + CrashReport crashreport1; + org.spigotmc.ActivationRange.activateEntities(this); // Spigot timings.entityTick.startTiming(); // Spigot // CraftBukkit start - Use field for loop variable for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) { -@@ -1480,9 +1481,11 @@ public abstract class World implements IBlockAccess { +@@ -1484,9 +1485,11 @@ public abstract class World implements IBlockAccess { int j = MathHelper.floor(entity.locZ); byte b0 = 32; @@ -221,7 +211,7 @@ index 275856f..b959a79 100644 + } else { entity.tickTimer.startTiming(); // Spigot // CraftBukkit end - entity.P = entity.locX; + entity.M = entity.locX; diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java index 558574f..41d2d87 100644 --- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java @@ -238,14 +228,12 @@ index 558574f..41d2d87 100644 public static final HashMap pluginTaskTimingMap = new HashMap(); diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java new file mode 100644 -index 0000000..3da76ff +index 0000000..70d8ab1 --- /dev/null +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -0,0 +1,289 @@ +@@ -0,0 +1,286 @@ +package org.spigotmc; + -+import java.util.ArrayList; -+import java.util.List; +import java.util.Set; +import net.minecraft.server.AxisAlignedBB; +import net.minecraft.server.Chunk; @@ -275,15 +263,14 @@ index 0000000..3da76ff +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.World; +import org.bukkit.craftbukkit.SpigotTimings; -+import org.bukkit.entity.Creeper; + +public class ActivationRange +{ + -+ static AxisAlignedBB maxBB = AxisAlignedBB.a( 0, 0, 0, 0, 0, 0 ); -+ static AxisAlignedBB miscBB = AxisAlignedBB.a( 0, 0, 0, 0, 0, 0 ); -+ static AxisAlignedBB animalBB = AxisAlignedBB.a( 0, 0, 0, 0, 0, 0 ); -+ static AxisAlignedBB monsterBB = AxisAlignedBB.a( 0, 0, 0, 0, 0, 0 ); ++ static AxisAlignedBB maxBB = new AxisAlignedBB( 0, 0, 0, 0, 0, 0 ); ++ static AxisAlignedBB miscBB = new AxisAlignedBB( 0, 0, 0, 0, 0, 0 ); ++ static AxisAlignedBB animalBB = new AxisAlignedBB( 0, 0, 0, 0, 0, 0 ); ++ static AxisAlignedBB monsterBB = new AxisAlignedBB( 0, 0, 0, 0, 0, 0 ); + + /** + * Initializes an entities type on construction to specify what group this @@ -352,7 +339,7 @@ index 0000000..3da76ff + maxRange = Math.max( maxRange, miscActivationRange ); + maxRange = Math.min( ( world.spigotConfig.viewDistance << 4 ) - 8, maxRange ); + -+ for ( Entity player : (List) world.players ) ++ for ( EntityHuman player : world.players ) + { + + player.activatedTick = MinecraftServer.currentTick; @@ -434,14 +421,13 @@ index 0000000..3da76ff + public static boolean checkEntityImmunities(Entity entity) + { + // quick checks. -+ if ( entity.inWater /* isInWater */ || entity.fireTicks > 0 ) ++ if ( entity.inWater || entity.fireTicks > 0 ) + { + return true; + } + if ( !( entity instanceof EntityArrow ) ) + { -+ if ( !entity.onGround || entity.passenger != null -+ || entity.vehicle != null ) ++ if ( !entity.onGround || !entity.passengers.isEmpty() || entity.getVehicle()!= null ) + { + return true; + } @@ -461,14 +447,14 @@ index 0000000..3da76ff + { + return true; + } -+ if ( entity instanceof EntityVillager && ( (EntityVillager) entity ).ck() /* Getter for first boolean */ ) ++ if ( entity instanceof EntityVillager && ( (EntityVillager) entity ).da() /* Getter for first boolean */ ) + { + return true; + } + if ( entity instanceof EntityAnimal ) + { + EntityAnimal animal = (EntityAnimal) entity; -+ if ( animal.isBaby() || animal.cp() /*love*/ ) ++ if ( animal.isBaby() || animal.isInLove() ) + { + return true; + } @@ -477,7 +463,7 @@ index 0000000..3da76ff + return true; + } + } -+ if (entity instanceof EntityCreeper && ((EntityCreeper) entity).cn()) { // isExplosive ++ if (entity instanceof EntityCreeper && ((EntityCreeper) entity).isIgnited()) { // isExplosive + return true; + } + } @@ -494,7 +480,8 @@ index 0000000..3da76ff + { + SpigotTimings.checkIfActiveTimer.startTiming(); + // Never safe to skip fireworks or entities not yet added to chunk -+ if ( !entity.isAddedToChunk() || entity instanceof EntityFireworks ) { ++ // PAIL: inChunk ++ if ( !entity.aa || entity instanceof EntityFireworks ) { + SpigotTimings.checkIfActiveTimer.stopTiming(); + return true; + } @@ -532,12 +519,12 @@ index 0000000..3da76ff + } +} diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index a85800d..da8563b 100644 +index ca888fc..92dbe54 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -140,4 +140,15 @@ public class SpigotWorldConfig - mobSpawnRange = (byte) getInt( "mob-spawn-range", 4 ); - log( "Mob Spawn Range: " + mobSpawnRange ); +@@ -136,4 +136,15 @@ public class SpigotWorldConfig + itemDespawnRate = getInt( "item-despawn-rate", 6000 ); + log( "Item Despawn Rate: " + itemDespawnRate ); } + + public int animalActivationRange = 32; @@ -552,5 +539,5 @@ index a85800d..da8563b 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0015-Metrics.patch b/CraftBukkit-Patches/0015-Metrics.patch index 46aa46a4ca..1755b08f35 100644 --- a/CraftBukkit-Patches/0015-Metrics.patch +++ b/CraftBukkit-Patches/0015-Metrics.patch @@ -1,4 +1,4 @@ -From c5caf2c18d39f621e699a03c53e2e6d64d5ad5cb Mon Sep 17 00:00:00 2001 +From 4b8c1087a9000829b757e6d26a03637efe538dd1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 23 Feb 2013 08:58:35 +1100 Subject: [PATCH] Metrics @@ -687,5 +687,5 @@ index cb88089..dcca493 100644 static void readConfig(Class clazz, Object instance) -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0016-PlayerItemDamageEvent.patch b/CraftBukkit-Patches/0016-PlayerItemDamageEvent.patch index a13c1d7325..3f7b11174c 100644 --- a/CraftBukkit-Patches/0016-PlayerItemDamageEvent.patch +++ b/CraftBukkit-Patches/0016-PlayerItemDamageEvent.patch @@ -1,14 +1,14 @@ -From 927b1e1f6463fc52c8718735deb38f5b315c7260 Mon Sep 17 00:00:00 2001 +From 1083cb33e05d7bcf0b099fd46c68f1c361093bd1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 4 Mar 2013 18:45:52 +1100 Subject: [PATCH] PlayerItemDamageEvent diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 2821afa..b722be5 100644 +index 32d9fd4..acc5bd2 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -339,6 +339,11 @@ public final class ItemStack { +@@ -335,6 +335,11 @@ public final class ItemStack { } public boolean isDamaged(int i, Random random) { @@ -20,7 +20,7 @@ index 2821afa..b722be5 100644 if (!this.e()) { return false; } else { -@@ -353,7 +358,16 @@ public final class ItemStack { +@@ -349,7 +354,16 @@ public final class ItemStack { } i -= k; @@ -38,15 +38,15 @@ index 2821afa..b722be5 100644 return false; } } -@@ -366,7 +380,7 @@ public final class ItemStack { +@@ -362,7 +376,7 @@ public final class ItemStack { public void damage(int i, EntityLiving entityliving) { if (!(entityliving instanceof EntityHuman) || !((EntityHuman) entityliving).abilities.canInstantlyBuild) { if (this.e()) { -- if (this.isDamaged(i, entityliving.bc())) { -+ if (this.isDamaged(i, entityliving.bc(), entityliving)) { // Spigot +- if (this.isDamaged(i, entityliving.getRandom())) { ++ if (this.isDamaged(i, entityliving.getRandom(), entityliving)) { // Spigot entityliving.b(this); --this.count; if (entityliving instanceof EntityHuman) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0017-Prevent-NPE-in-CraftSign.patch b/CraftBukkit-Patches/0017-Prevent-NPE-in-CraftSign.patch index ccc754976f..1fe13c94bc 100644 --- a/CraftBukkit-Patches/0017-Prevent-NPE-in-CraftSign.patch +++ b/CraftBukkit-Patches/0017-Prevent-NPE-in-CraftSign.patch @@ -1,4 +1,4 @@ -From 6c4714ec822f04f5edd10bd57cc8db50df6d3b17 Mon Sep 17 00:00:00 2001 +From e8ad8786c6328c9a01462f0dd6c3c1b03473bfd1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 18 Mar 2013 20:01:44 +1100 Subject: [PATCH] Prevent NPE in CraftSign @@ -23,5 +23,5 @@ index 42a6f9a..43adfcc 100644 System.arraycopy(revertComponents(sign.lines), 0, lines, 0, lines.length); } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0018-Entity-Tracking-Ranges.patch b/CraftBukkit-Patches/0018-Entity-Tracking-Ranges.patch index d5f2c6d2e9..011d312f71 100644 --- a/CraftBukkit-Patches/0018-Entity-Tracking-Ranges.patch +++ b/CraftBukkit-Patches/0018-Entity-Tracking-Ranges.patch @@ -1,4 +1,4 @@ -From 9af363974598c5f5b89a7ca2c88232b2941b5330 Mon Sep 17 00:00:00 2001 +From 4cf6a4c069827b34e5d1ee8007baa6c62848352c Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 20 Feb 2013 11:58:47 -0500 Subject: [PATCH] Entity Tracking Ranges @@ -12,61 +12,22 @@ This has multiple benefits: 4) Less client lag - Not trying to render distant item frames and paintings and entities will reduce entity count on the client, which is major for shop/town worlds which may use tons of item frames. diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java -index e1ff4f0..cb72b36 100644 +index 0c19e5a..3773bb1 100644 --- a/src/main/java/net/minecraft/server/EntityTracker.java +++ b/src/main/java/net/minecraft/server/EntityTracker.java -@@ -95,6 +95,7 @@ public class EntityTracker { +@@ -103,6 +103,7 @@ public class EntityTracker { public void addEntity(Entity entity, int i, final int j, boolean flag) { org.spigotmc.AsyncCatcher.catchOp( "entity track"); // Spigot + i = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, i); // Spigot - if (i > this.e) { - i = this.e; - } -diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 3da76ff..ccf6d93 100644 ---- a/src/main/java/org/spigotmc/ActivationRange.java -+++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -108,7 +108,7 @@ public class ActivationRange - maxRange = Math.max( maxRange, miscActivationRange ); - maxRange = Math.min( ( world.spigotConfig.viewDistance << 4 ) - 8, maxRange ); - -- for ( Entity player : (List) world.players ) -+ for ( Entity player : (List) (List) world.players ) - { - - player.activatedTick = MinecraftServer.currentTick; -@@ -190,7 +190,7 @@ public class ActivationRange - public static boolean checkEntityImmunities(Entity entity) - { - // quick checks. -- if ( entity.inWater /* isInWater */ || entity.fireTicks > 0 ) -+ if ( entity.inWater || entity.fireTicks > 0 ) - { - return true; - } -@@ -217,14 +217,14 @@ public class ActivationRange - { - return true; - } -- if ( entity instanceof EntityVillager && ( (EntityVillager) entity ).ck() /* Getter for first boolean */ ) -+ if ( entity instanceof EntityVillager && ( (EntityVillager) entity ).cm() /* Getter for first boolean */ ) - { - return true; - } - if ( entity instanceof EntityAnimal ) - { - EntityAnimal animal = (EntityAnimal) entity; -- if ( animal.isBaby() || animal.cp() /*love*/ ) -+ if ( animal.isBaby() || animal.isInLove() ) - { - return true; - } + try { + if (this.trackedEntities.b(entity.getId())) { + throw new IllegalStateException("Entity is already tracked!"); diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index da8563b..3d4896b 100644 +index 92dbe54..1369657 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -151,4 +151,19 @@ public class SpigotWorldConfig +@@ -147,4 +147,19 @@ public class SpigotWorldConfig miscActivationRange = getInt( "entity-activation-range.misc", miscActivationRange ); log( "Entity Activation Range: An " + animalActivationRange + " / Mo " + monsterActivationRange + " / Mi " + miscActivationRange ); } @@ -144,5 +105,5 @@ index 0000000..4bf4d2a + } +} -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0019-Thread-Naming-and-Tweaks.patch b/CraftBukkit-Patches/0019-Thread-Naming-and-Tweaks.patch index ec987ff0c3..af61fd0320 100644 --- a/CraftBukkit-Patches/0019-Thread-Naming-and-Tweaks.patch +++ b/CraftBukkit-Patches/0019-Thread-Naming-and-Tweaks.patch @@ -1,4 +1,4 @@ -From 11b631871b5943607fc15ec70a841a8af7020aa9 Mon Sep 17 00:00:00 2001 +From 8ff8b8fec0b8f1f483ba928a405ed0946ef4a6a3 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 23 Apr 2013 11:50:27 +1000 Subject: [PATCH] Thread Naming and Tweaks @@ -19,5 +19,5 @@ index 8442ecb..93d8d42 100644 private CraftAsyncDebugger debugTail = debugHead; private static final int RECENT_TICKS; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0020-Close-Unloaded-Save-Files.patch b/CraftBukkit-Patches/0020-Close-Unloaded-Save-Files.patch index b705282125..18f729998f 100644 --- a/CraftBukkit-Patches/0020-Close-Unloaded-Save-Files.patch +++ b/CraftBukkit-Patches/0020-Close-Unloaded-Save-Files.patch @@ -1,4 +1,4 @@ -From 621d8db4243864d2a6c265877e56ad14dd54d57f Mon Sep 17 00:00:00 2001 +From 5f99873d4186a6be4ce9bbf25c86328c2135edb7 Mon Sep 17 00:00:00 2001 From: Antony Riley Date: Wed, 27 Mar 2013 01:41:54 +0200 Subject: [PATCH] Close Unloaded Save Files @@ -18,10 +18,10 @@ index b07e7d5..5528019 100644 public static synchronized RegionFile a(File file, int i, int j) { File file1 = new File(file, "region"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a8a8e64..9e9435e 100644 +index 261b423..f906f60 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -962,6 +962,31 @@ public final class CraftServer implements Server { +@@ -966,6 +966,31 @@ public final class CraftServer implements Server { worlds.remove(world.getName().toLowerCase()); console.worlds.remove(console.worlds.indexOf(handle)); @@ -54,5 +54,5 @@ index a8a8e64..9e9435e 100644 } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0021-Remove-o-Option.patch b/CraftBukkit-Patches/0021-Remove-o-Option.patch index d54e4e7fda..c1616f41c2 100644 --- a/CraftBukkit-Patches/0021-Remove-o-Option.patch +++ b/CraftBukkit-Patches/0021-Remove-o-Option.patch @@ -1,4 +1,4 @@ -From 561aaac2d5dc20515d3b4161fa880b9ba70962b0 Mon Sep 17 00:00:00 2001 +From 8a37308b1c8dd725d5662048b005bc6f1b163a37 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 19 May 2013 18:29:48 +1000 Subject: [PATCH] Remove -o Option @@ -6,7 +6,7 @@ Subject: [PATCH] Remove -o Option Serves no purpose other than to confuse users. diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java -index 856ae39..0ee7fe8 100644 +index 8ee534b..80ec702 100644 --- a/src/main/java/net/minecraft/server/PropertyManager.java +++ b/src/main/java/net/minecraft/server/PropertyManager.java @@ -54,7 +54,7 @@ public class PropertyManager { @@ -19,5 +19,5 @@ index 856ae39..0ee7fe8 100644 } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0022-Recipe-Deconstruction.patch b/CraftBukkit-Patches/0022-Recipe-Deconstruction.patch index 0c1887dc0b..46ac87865f 100644 --- a/CraftBukkit-Patches/0022-Recipe-Deconstruction.patch +++ b/CraftBukkit-Patches/0022-Recipe-Deconstruction.patch @@ -1,4 +1,4 @@ -From 40711de0bf9bd0111c07ac647f806bf899992af5 Mon Sep 17 00:00:00 2001 +From 25813993ae1e7b40a6b58c7fde1ce61cb71e9108 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 1 Jun 2013 16:34:38 +1000 Subject: [PATCH] Recipe Deconstruction @@ -6,7 +6,7 @@ Subject: [PATCH] Recipe Deconstruction Some non API methods contributed by Asphodan to allow recipe deconstruction. diff --git a/src/main/java/net/minecraft/server/IRecipe.java b/src/main/java/net/minecraft/server/IRecipe.java -index babf604..e7aba17 100644 +index f963104..ffc65a2 100644 --- a/src/main/java/net/minecraft/server/IRecipe.java +++ b/src/main/java/net/minecraft/server/IRecipe.java @@ -13,4 +13,6 @@ public interface IRecipe { @@ -17,7 +17,7 @@ index babf604..e7aba17 100644 + java.util.List getIngredients(); // Spigot } diff --git a/src/main/java/net/minecraft/server/ShapedRecipes.java b/src/main/java/net/minecraft/server/ShapedRecipes.java -index a387e2d..825b6d9 100644 +index 28adcdb..cac2e78 100644 --- a/src/main/java/net/minecraft/server/ShapedRecipes.java +++ b/src/main/java/net/minecraft/server/ShapedRecipes.java @@ -10,7 +10,7 @@ public class ShapedRecipes implements IRecipe { @@ -42,7 +42,7 @@ index a387e2d..825b6d9 100644 + // Spigot end } diff --git a/src/main/java/net/minecraft/server/ShapelessRecipes.java b/src/main/java/net/minecraft/server/ShapelessRecipes.java -index b13dcb7..aa0e9aa 100644 +index 8570889..e9934f9 100644 --- a/src/main/java/net/minecraft/server/ShapelessRecipes.java +++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java @@ -12,7 +12,7 @@ import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe; @@ -67,5 +67,5 @@ index b13dcb7..aa0e9aa 100644 + // Spigot end } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0023-Implement-Arrow-API.patch b/CraftBukkit-Patches/0023-Implement-Arrow-API.patch index 5abc9d173e..a502121351 100644 --- a/CraftBukkit-Patches/0023-Implement-Arrow-API.patch +++ b/CraftBukkit-Patches/0023-Implement-Arrow-API.patch @@ -1,11 +1,11 @@ -From b362f88b396a1220b9e55a48ec6ee08fb400db39 Mon Sep 17 00:00:00 2001 +From 9b4f5137f204ffb2f3eeeeca0787ae133fdc8257 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 2 Jun 2013 15:16:05 +1000 Subject: [PATCH] Implement Arrow API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -index bf48e6e..ad489cc 100644 +index bf48e6e..2a3482c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java @@ -75,6 +75,17 @@ public class CraftArrow extends AbstractProjectile implements Arrow { @@ -15,17 +15,17 @@ index bf48e6e..ad489cc 100644 + @Override + public double getDamage() + { -+ return getHandle().j(); ++ return getHandle().k(); + } + + @Override + public void setDamage(double damage) + { -+ getHandle().b( damage ); ++ getHandle().c( damage ); + } }; public Arrow.Spigot spigot() -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0024-Hopper-Customisations.patch b/CraftBukkit-Patches/0024-Hopper-Customisations.patch index 6734f5d61d..505d7196d8 100644 --- a/CraftBukkit-Patches/0024-Hopper-Customisations.patch +++ b/CraftBukkit-Patches/0024-Hopper-Customisations.patch @@ -1,4 +1,4 @@ -From f0d8e184d3c543840e50a775dd7aebc5b733eaba Mon Sep 17 00:00:00 2001 +From 68ce95ca445ea5500f1ef9e7ab0cfdf910b51e2d Mon Sep 17 00:00:00 2001 From: erocs Date: Sun, 8 Sep 2013 12:06:15 -0700 Subject: [PATCH] Hopper Customisations @@ -6,15 +6,15 @@ Subject: [PATCH] Hopper Customisations Allows editing hopper cooldowns and amount transferred per tick. diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index 8f771af..6785b71 100644 +index 7b00f6a..c01acb9 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java -@@ -194,12 +194,11 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU +@@ -174,12 +174,11 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi } if (flag) { -- this.d(8); -+ this.d(world.spigotConfig.hopperTransfer); // Spigot +- this.setCooldown(8); ++ this.setCooldown(world.spigotConfig.hopperTransfer); // Spigot this.update(); return true; } @@ -23,7 +23,7 @@ index 8f771af..6785b71 100644 return false; } else { return false; -@@ -253,7 +252,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU +@@ -233,7 +232,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi // ItemStack itemstack1 = addItem(iinventory, this.splitStack(i, 1), enumdirection); // CraftBukkit start - Call event when pushing items into other inventories @@ -32,19 +32,19 @@ index 8f771af..6785b71 100644 Inventory destinationInventory; // Have to special case large chests as they work oddly -@@ -267,9 +266,10 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU +@@ -247,9 +246,10 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi this.getWorld().getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { this.setItem(i, itemstack); -- this.d(8); // Delay hopper checks -+ this.d(world.spigotConfig.hopperTransfer); // Spigot +- this.setCooldown(8); // Delay hopper checks ++ this.setCooldown(world.spigotConfig.hopperTransfer); // Spigot return false; } + int origCount = event.getItem().getAmount(); // Spigot ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), enumdirection); if (itemstack1 == null || itemstack1.count == 0) { -@@ -281,7 +281,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU +@@ -261,7 +261,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi // CraftBukkit end return true; } @@ -53,7 +53,7 @@ index 8f771af..6785b71 100644 this.setItem(i, itemstack); } } -@@ -391,7 +391,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU +@@ -371,7 +371,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi ItemStack itemstack1 = itemstack.cloneItemStack(); // ItemStack itemstack2 = addItem(ihopper, iinventory.splitStack(i, 1), (EnumDirection) null); // CraftBukkit start - Call event on collection of items from inventories into the hopper @@ -62,15 +62,15 @@ index 8f771af..6785b71 100644 Inventory sourceInventory; // Have to special case large chests as they work oddly -@@ -408,13 +408,13 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU +@@ -388,13 +388,13 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi iinventory.setItem(i, itemstack1); if (ihopper instanceof TileEntityHopper) { -- ((TileEntityHopper) ihopper).d(8); // Delay hopper checks -+ ((TileEntityHopper) ihopper).d(ihopper.getWorld().spigotConfig.hopperTransfer); // Spigot +- ((TileEntityHopper) ihopper).setCooldown(8); // Delay hopper checks ++ ((TileEntityHopper) ihopper).setCooldown(ihopper.getWorld().spigotConfig.hopperTransfer); // Spigot } else if (ihopper instanceof EntityMinecartHopper) { -- ((EntityMinecartHopper) ihopper).m(4); // Delay hopper minecart checks -+ ((EntityMinecartHopper) ihopper).m(ihopper.getWorld().spigotConfig.hopperTransfer / 2); // Spigot +- ((EntityMinecartHopper) ihopper).setCooldown(4); // Delay hopper minecart checks ++ ((EntityMinecartHopper) ihopper).setCooldown(ihopper.getWorld().spigotConfig.hopperTransfer / 2); // Spigot } - return false; @@ -79,7 +79,7 @@ index 8f771af..6785b71 100644 ItemStack itemstack2 = addItem(ihopper, CraftItemStack.asNMSCopy(event.getItem()), null); if (itemstack2 == null || itemstack2.count == 0) { -@@ -426,6 +426,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU +@@ -406,6 +406,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi // CraftBukkit end return true; } @@ -87,20 +87,20 @@ index 8f771af..6785b71 100644 iinventory.setItem(i, itemstack1); } -@@ -515,7 +516,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU +@@ -495,7 +496,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi TileEntityHopper tileentityhopper = (TileEntityHopper) iinventory; - if (tileentityhopper.o()) { -- tileentityhopper.d(8); -+ tileentityhopper.d(tileentityhopper.world.spigotConfig.hopperTransfer); // Spigot + if (tileentityhopper.p()) { +- tileentityhopper.setCooldown(8); ++ tileentityhopper.setCooldown(tileentityhopper.world.spigotConfig.hopperTransfer); // Spigot } iinventory.update(); diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 3d4896b..f0e3b97 100644 +index 1369657..4de0a98 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -166,4 +166,19 @@ public class SpigotWorldConfig +@@ -162,4 +162,19 @@ public class SpigotWorldConfig otherTrackingRange = getInt( "entity-tracking-range.other", otherTrackingRange ); log( "Entity Tracking Range: Pl " + playerTrackingRange + " / An " + animalTrackingRange + " / Mo " + monsterTrackingRange + " / Mi " + miscTrackingRange + " / Other " + otherTrackingRange ); } @@ -121,5 +121,5 @@ index 3d4896b..f0e3b97 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0026-Firework-Meta-Crash-Fix.patch b/CraftBukkit-Patches/0025-Firework-Meta-Crash-Fix.patch similarity index 93% rename from CraftBukkit-Patches/0026-Firework-Meta-Crash-Fix.patch rename to CraftBukkit-Patches/0025-Firework-Meta-Crash-Fix.patch index c8f5ab7df0..ac18d70d8e 100644 --- a/CraftBukkit-Patches/0026-Firework-Meta-Crash-Fix.patch +++ b/CraftBukkit-Patches/0025-Firework-Meta-Crash-Fix.patch @@ -1,4 +1,4 @@ -From 7de3bb97d2030311993a14f4e59c30569956d16e Mon Sep 17 00:00:00 2001 +From d5fcc142f5bdb75438c67490e1293e89cb2194ab Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 15 Jun 2013 21:34:48 +1000 Subject: [PATCH] Firework Meta Crash Fix @@ -27,5 +27,5 @@ index 0f7da6b..5a409ae 100644 } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0025-Implement-SpawnerSpawnEvent.patch b/CraftBukkit-Patches/0025-Implement-SpawnerSpawnEvent.patch deleted file mode 100644 index fee0af1ca4..0000000000 --- a/CraftBukkit-Patches/0025-Implement-SpawnerSpawnEvent.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 69d3535e743af676c4b77b3f2af1781062ae1216 Mon Sep 17 00:00:00 2001 -From: Andy Shulman -Date: Mon, 15 Apr 2013 20:06:37 -0500 -Subject: [PATCH] Implement SpawnerSpawnEvent. - -Adds BUKKIT-267 - -diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 7b10821..35ed213 100644 ---- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -4,7 +4,11 @@ import com.google.common.collect.Lists; - import java.util.Iterator; - import java.util.List; - --import org.bukkit.event.entity.CreatureSpawnEvent; // CraftBukkit -+// CraftBukkit start -+import org.bukkit.craftbukkit.event.CraftEventFactory; -+import org.bukkit.event.entity.CreatureSpawnEvent; -+import org.bukkit.event.entity.SpawnerSpawnEvent; -+// CraftBukkit end - - public abstract class MobSpawnerAbstract { - -@@ -136,7 +140,12 @@ public abstract class MobSpawnerAbstract { - - entity.f(nbttagcompound); - if (entity.world != null && flag) { -- entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit -+ // CraftBukkit start - call SpawnerSpawnEvent, abort if cancelled -+ SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b().getX(), this.b().getY(), this.b().getZ()); -+ if (!event.isCancelled()) { -+ entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit -+ } -+ // CraftBukkit end - } - - NBTTagCompound nbttagcompound1; -@@ -160,6 +169,11 @@ public abstract class MobSpawnerAbstract { - - entity2.f(nbttagcompound2); - entity2.setPositionRotation(entity1.locX, entity1.locY, entity1.locZ, entity1.yaw, entity1.pitch); -+ // CraftBukkit start - call SpawnerSpawnEvent, skip if cancelled -+ SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity2, this.b().getX(), this.b().getY(), this.b().getZ()); -+ if (event.isCancelled()) { -+ continue; -+ } - if (entity.world != null && flag) { - entity.world.addEntity(entity2, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit - } -@@ -173,8 +187,12 @@ public abstract class MobSpawnerAbstract { - if (entity instanceof EntityInsentient) { - ((EntityInsentient) entity).prepare(entity.world.E(new BlockPosition(entity)), (GroupDataEntity) null); - } -- -- entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit -+ // Spigot start - call SpawnerSpawnEvent, abort if cancelled -+ SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b().getX(), this.b().getY(), this.b().getZ()); -+ if (!event.isCancelled()) { -+ entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit -+ } -+ // Spigot end - } - - return entity; -diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index f0d3f75..2771b28 100644 ---- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -18,6 +18,7 @@ import org.bukkit.Statistic.Type; - import org.bukkit.block.Block; - import org.bukkit.block.BlockFace; - import org.bukkit.block.BlockState; -+import org.bukkit.block.CreatureSpawner; - import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.craftbukkit.CraftStatistic; - import org.bukkit.craftbukkit.CraftWorld; -@@ -129,6 +130,22 @@ public class CraftEventFactory { - } - - /** -+ * Mob spawner event -+ */ -+ public static SpawnerSpawnEvent callSpawnerSpawnEvent(Entity spawnee, int spawnerX, int spawnerY, int spawnerZ) { -+ org.bukkit.craftbukkit.entity.CraftEntity entity = spawnee.getBukkitEntity(); -+ BlockState state = entity.getWorld().getBlockAt(spawnerX, spawnerY, spawnerZ).getState(); -+ -+ if (!(state instanceof CreatureSpawner)) { -+ state = null; -+ } -+ -+ SpawnerSpawnEvent event = new SpawnerSpawnEvent(entity, (CreatureSpawner) state); -+ entity.getServer().getPluginManager().callEvent(event); -+ return event; -+ } -+ -+ /** - * Bucket methods - */ - public static PlayerBucketEmptyEvent callPlayerBucketEmptyEvent(EntityHuman who, int clickedX, int clickedY, int clickedZ, EnumDirection clickedFace, ItemStack itemInHand) { --- -2.1.4 - diff --git a/CraftBukkit-Patches/0027-Allow-Disabling-of-Command-Logging.patch b/CraftBukkit-Patches/0026-Allow-Disabling-of-Command-Logging.patch similarity index 81% rename from CraftBukkit-Patches/0027-Allow-Disabling-of-Command-Logging.patch rename to CraftBukkit-Patches/0026-Allow-Disabling-of-Command-Logging.patch index e035118b86..f1fa0af35a 100644 --- a/CraftBukkit-Patches/0027-Allow-Disabling-of-Command-Logging.patch +++ b/CraftBukkit-Patches/0026-Allow-Disabling-of-Command-Logging.patch @@ -1,19 +1,19 @@ -From b33bb999524e6ccfbfdc394517e9ce7f55bc3a8c Mon Sep 17 00:00:00 2001 +From fd54e0852c6b1ce70392ce2596a2f93c493c9349 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 21 Jun 2013 18:01:29 +1000 Subject: [PATCH] Allow Disabling of Command Logging diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 10e5032..9ff5828 100644 +index 212c576..c13a2be 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1092,6 +1092,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList +@@ -1236,6 +1236,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { private void handleCommand(String s) { org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot // CraftBukkit start - whole method + if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot - this.c.info(this.player.getName() + " issued server command: " + s); + this.LOGGER.info(this.player.getName() + " issued server command: " + s); CraftPlayer player = this.getPlayer(); diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java @@ -32,5 +32,5 @@ index dcca493..3999f5b 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0028-Allow-Disabling-of-Command-TabComplete.patch b/CraftBukkit-Patches/0027-Allow-Disabling-of-Command-TabComplete.patch similarity index 91% rename from CraftBukkit-Patches/0028-Allow-Disabling-of-Command-TabComplete.patch rename to CraftBukkit-Patches/0027-Allow-Disabling-of-Command-TabComplete.patch index 0bc5fecf09..ff3fd3a9ce 100644 --- a/CraftBukkit-Patches/0028-Allow-Disabling-of-Command-TabComplete.patch +++ b/CraftBukkit-Patches/0027-Allow-Disabling-of-Command-TabComplete.patch @@ -1,14 +1,14 @@ -From aa91333687133d4f19f3659526a058d970366de1 Mon Sep 17 00:00:00 2001 +From 1ecd0d2095dc90232d8d4ece718453ed83ea336e Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 21 Jun 2013 18:05:54 +1000 Subject: [PATCH] Allow Disabling of Command TabComplete diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9e9435e..5ef5f5a 100644 +index f906f60..fa21527 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1566,6 +1566,13 @@ public final class CraftServer implements Server { +@@ -1572,6 +1572,13 @@ public final class CraftServer implements Server { } public List tabCompleteCommand(Player player, String message) { @@ -49,5 +49,5 @@ index 3999f5b..ca001e9 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0029-Configurable-Messages.patch b/CraftBukkit-Patches/0028-Configurable-Messages.patch similarity index 85% rename from CraftBukkit-Patches/0029-Configurable-Messages.patch rename to CraftBukkit-Patches/0028-Configurable-Messages.patch index 4ce70daaaf..eeb32072ec 100644 --- a/CraftBukkit-Patches/0029-Configurable-Messages.patch +++ b/CraftBukkit-Patches/0028-Configurable-Messages.patch @@ -1,32 +1,32 @@ -From 172258793066b82c106ae96b396420d0872326cb Mon Sep 17 00:00:00 2001 +From 9eef4f3b94672d8e232be0ff3474a93514dd5faf Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 21 Jun 2013 19:21:58 +1000 Subject: [PATCH] Configurable Messages diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index 2d937c1..a1cae86 100644 +index 37c13c5..ee987b9 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -62,11 +62,11 @@ public class HandshakeListener implements PacketHandshakingInListener { // CraftBukkit end - if (packethandshakinginsetprotocol.b() > 47) { -- chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.8.8"); -+ chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), "1.8.8" ) ); // Spigot - this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext)); + if (packethandshakinginsetprotocol.b() > 107) { +- chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.9"); ++ chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), "1.9" ) ); // Spigot + this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext)); this.b.close(chatcomponenttext); - } else if (packethandshakinginsetprotocol.b() < 47) { -- chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.8.8"); -+ chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), "1.8.8" ) ); // Spigot - this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext)); + } else if (packethandshakinginsetprotocol.b() < 107) { +- chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.9"); ++ chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), "1.9" ) ); // Spigot + this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext)); this.b.close(chatcomponenttext); } else { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index dd3ccd9..4050dba 100644 +index 2095242..b21a5b7 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -418,7 +418,7 @@ public abstract class PlayerList { +@@ -466,7 +466,7 @@ public abstract class PlayerList { event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s); } else if (!this.isWhitelisted(gameprofile)) { // return "You are not white-listed on this server!"; @@ -35,7 +35,7 @@ index dd3ccd9..4050dba 100644 } else if (getIPBans().isBanned(socketaddress) && !getIPBans().get(socketaddress).hasExpired()) { IpBanEntry ipbanentry = this.l.get(socketaddress); -@@ -432,7 +432,7 @@ public abstract class PlayerList { +@@ -480,7 +480,7 @@ public abstract class PlayerList { } else { // return this.players.size() >= this.maxPlayers && !this.f(gameprofile) ? "The server is full!" : null; if (this.players.size() >= this.maxPlayers && !this.f(gameprofile)) { @@ -45,10 +45,10 @@ index dd3ccd9..4050dba 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3be88a3..c0f1d3c 100644 +index fa21527..7cdba38 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -623,11 +623,7 @@ public final class CraftServer implements Server { +@@ -627,11 +627,7 @@ public final class CraftServer implements Server { return true; } diff --git a/CraftBukkit-Patches/0030-Allow-Disabling-of-Random-Lighting-Updates.patch b/CraftBukkit-Patches/0029-Allow-Disabling-of-Random-Lighting-Updates.patch similarity index 61% rename from CraftBukkit-Patches/0030-Allow-Disabling-of-Random-Lighting-Updates.patch rename to CraftBukkit-Patches/0029-Allow-Disabling-of-Random-Lighting-Updates.patch index 7406f7f205..f514dd38a3 100644 --- a/CraftBukkit-Patches/0030-Allow-Disabling-of-Random-Lighting-Updates.patch +++ b/CraftBukkit-Patches/0029-Allow-Disabling-of-Random-Lighting-Updates.patch @@ -1,40 +1,40 @@ -From 28575eda69652a901509418b5b274bc58756bb36 Mon Sep 17 00:00:00 2001 +From 9d14fa9c9d1a1748c38afef3f9350807b4373e66 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 22 Jun 2013 16:12:02 +1000 Subject: [PATCH] Allow Disabling of Random Lighting Updates diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 746cbce..155bccf 100644 +index e4725b0..20b945c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -1019,7 +1019,7 @@ public class Chunk { +@@ -967,7 +967,7 @@ public class Chunk { } - this.p = true; + this.q = true; - if (!this.lit && this.done) { + if (!this.lit && this.done && this.world.spigotConfig.randomLightUpdates) { // Spigot - also use random light updates setting to determine if we should relight - this.n(); + this.o(); } -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b959a79..b07b3db 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -2088,7 +2088,7 @@ public abstract class World implements IBlockAccess { - } +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index f8a2195..7823174 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -373,7 +373,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + protected void i() { this.methodProfiler.a("playerCheckLight"); - if (!this.players.isEmpty()) { + if (spigotConfig.randomLightUpdates && !this.players.isEmpty()) { // Spigot - i = this.random.nextInt(this.players.size()); - entityhuman = (EntityHuman) this.players.get(i); - j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5; + int i = this.random.nextInt(this.players.size()); + EntityHuman entityhuman = (EntityHuman) this.players.get(i); + int j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index f0e3b97..2b98acb 100644 +index 4de0a98..c2452d6 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -181,4 +181,11 @@ public class SpigotWorldConfig +@@ -177,4 +177,11 @@ public class SpigotWorldConfig hopperAmount = getInt( "hopper-amount", 1 ); log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck + " Hopper Amount: " + hopperAmount ); } @@ -47,5 +47,5 @@ index f0e3b97..2b98acb 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0031-Properly-Close-Inventories.patch b/CraftBukkit-Patches/0030-Properly-Close-Inventories.patch similarity index 71% rename from CraftBukkit-Patches/0031-Properly-Close-Inventories.patch rename to CraftBukkit-Patches/0030-Properly-Close-Inventories.patch index b136558a9a..9ec9af9d7f 100644 --- a/CraftBukkit-Patches/0031-Properly-Close-Inventories.patch +++ b/CraftBukkit-Patches/0030-Properly-Close-Inventories.patch @@ -1,4 +1,4 @@ -From e67e56dcd5be50fa323dbb6c5e5111238295acaa Mon Sep 17 00:00:00 2001 +From 846fc496d915908dcc67a043e0261ade0b4f82ff 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,10 +6,10 @@ 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 155bccf..6460ab1 100644 +index 20b945c..f68abb4 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -828,6 +828,18 @@ public class Chunk { +@@ -761,6 +761,18 @@ public class Chunk { while (iterator.hasNext()) { TileEntity tileentity = (TileEntity) iterator.next(); @@ -28,7 +28,7 @@ index 155bccf..6460ab1 100644 this.world.b(tileentity); } -@@ -838,6 +850,18 @@ public class Chunk { +@@ -771,6 +783,18 @@ public class Chunk { java.util.Iterator iter = newList.iterator(); while (iter.hasNext()) { Entity entity = iter.next(); @@ -47,23 +47,6 @@ index 155bccf..6460ab1 100644 // Do not pass along players, as doing so can get them stuck outside of time. // (which for example disables inventory icon updates and prevents block breaking) -diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -index 712018a..17b5714 100644 ---- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java -+++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -@@ -127,6 +127,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp - } - - public void c(int i) { -+ // Spigot Start -+ for ( HumanEntity human : new java.util.ArrayList( transaction ) ) -+ { -+ human.closeInventory(); -+ } -+ // Spigot End - this.b = false; - super.c(i); - } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0032-Disallow-Interaction-With-Self.patch b/CraftBukkit-Patches/0031-Disallow-Interaction-With-Self.patch similarity index 73% rename from CraftBukkit-Patches/0032-Disallow-Interaction-With-Self.patch rename to CraftBukkit-Patches/0031-Disallow-Interaction-With-Self.patch index 9b3f41065a..7c2f18136c 100644 --- a/CraftBukkit-Patches/0032-Disallow-Interaction-With-Self.patch +++ b/CraftBukkit-Patches/0031-Disallow-Interaction-With-Self.patch @@ -1,15 +1,15 @@ -From 416a5d8363e7e87d07ceff5d97e61f547e87cf86 Mon Sep 17 00:00:00 2001 +From 7f19d7e7e7ded0f3a6287ce0587e62ad5bfeb544 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 28 Jun 2013 19:52:54 +1000 Subject: [PATCH] Disallow Interaction With Self diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 9ff5828..8d6d3c7 100644 +index c13a2be..f785d9f 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1227,6 +1227,13 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.u()); +@@ -1397,6 +1397,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + if (this.player.dead) return; // CraftBukkit WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); Entity entity = packetplayinuseentity.a((World) worldserver); + // Spigot Start @@ -23,5 +23,5 @@ index 9ff5828..8d6d3c7 100644 this.player.resetIdleTimer(); if (entity != null) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0032-Entity-Mount-and-Dismount-Events.patch b/CraftBukkit-Patches/0032-Entity-Mount-and-Dismount-Events.patch new file mode 100644 index 0000000000..070487035c --- /dev/null +++ b/CraftBukkit-Patches/0032-Entity-Mount-and-Dismount-Events.patch @@ -0,0 +1,35 @@ +From dff771cb23a66e9f7681e33108bcc7c7be1e9be9 Mon Sep 17 00:00:00 2001 +From: md_5 +Date: Sat, 27 Feb 2016 10:07:58 +1100 +Subject: [PATCH] Entity Mount and Dismount Events + + +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index 1817e6d..1eec160 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -1679,6 +1679,13 @@ public abstract class Entity implements ICommandListener { + } + } + // CraftBukkit end ++ // Spigot start ++ org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent(this.getBukkitEntity(), entity.getBukkitEntity()); ++ Bukkit.getPluginManager().callEvent(event); ++ if (event.isCancelled()) { ++ return; ++ } ++ // Spigot end + if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bt() instanceof EntityHuman)) { + this.passengers.add(0, entity); + } else { +@@ -1708,6 +1715,7 @@ public abstract class Entity implements ICommandListener { + } + } + // CraftBukkit end ++ Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), entity.getBukkitEntity() ) ); // Spigot + this.passengers.remove(entity); + entity.j = 60; + } +-- +2.5.0 + diff --git a/CraftBukkit-Patches/0033-Entity-Mount-and-Dismount-Events.patch b/CraftBukkit-Patches/0033-Entity-Mount-and-Dismount-Events.patch deleted file mode 100644 index 8eaa98f280..0000000000 --- a/CraftBukkit-Patches/0033-Entity-Mount-and-Dismount-Events.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 0f04f35d6d781efc9d91d42c47c05ba41598de43 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Tue, 2 Jul 2013 20:32:49 +1000 -Subject: [PATCH] Entity Mount and Dismount Events - - -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 2f386ac..bf3ce15 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1541,6 +1541,7 @@ public abstract class Entity implements ICommandListener { - } - } - // CraftBukkit end -+ pluginManager.callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), this.vehicle.getBukkitEntity() ) ); // Spigot - this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch); - this.vehicle.passenger = null; - } -@@ -1575,6 +1576,18 @@ public abstract class Entity implements ICommandListener { - } - } - // CraftBukkit end -+ // Spigot Start -+ if ( entity.world.isChunkLoaded( (int) entity.locX >> 4, (int) entity.locZ >> 4, true ) ) -+ { -+ org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent( this.getBukkitEntity(), entity.getBukkitEntity() ); -+ pluginManager.callEvent( event ); -+ if ( event.isCancelled() ) -+ { -+ return; -+ } -+ } -+ // Spigot End -+ - if (this.vehicle != null) { - this.vehicle.passenger = null; - } -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index bd30895..b42cd36 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1709,6 +1709,7 @@ public abstract class EntityLiving extends Entity { - } - } - // CraftBukkit end -+ org.bukkit.Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), this.vehicle.getBukkitEntity() ) ); // Spigot - - if (!this.world.isClientSide) { - this.q(this.vehicle); --- -2.6.2 - diff --git a/CraftBukkit-Patches/0034-Prevent-Ghost-Players-Caused-by-Plugins.patch b/CraftBukkit-Patches/0033-Prevent-Ghost-Players-Caused-by-Plugins.patch similarity index 86% rename from CraftBukkit-Patches/0034-Prevent-Ghost-Players-Caused-by-Plugins.patch rename to CraftBukkit-Patches/0033-Prevent-Ghost-Players-Caused-by-Plugins.patch index bdc4de80c2..f9654f0c71 100644 --- a/CraftBukkit-Patches/0034-Prevent-Ghost-Players-Caused-by-Plugins.patch +++ b/CraftBukkit-Patches/0033-Prevent-Ghost-Players-Caused-by-Plugins.patch @@ -1,4 +1,4 @@ -From d828c679ff0cacc857fe380616c5e9753e3f9b32 Mon Sep 17 00:00:00 2001 +From 9c1352075b542d480fa211a8f80e3a3f4fbebf40 Mon Sep 17 00:00:00 2001 From: Alex Ciuba Date: Tue, 11 Jun 2013 15:23:03 -0400 Subject: [PATCH] Prevent Ghost Players Caused by Plugins @@ -6,10 +6,10 @@ Subject: [PATCH] Prevent Ghost Players Caused by Plugins Check if the player is still connected after firing event. Fixes BUKKIT-4327 diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 49b908d..747d708 100644 +index b21a5b7..f878dfc 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -548,6 +548,11 @@ public abstract class PlayerList { +@@ -605,6 +605,11 @@ public abstract class PlayerList { Player respawnPlayer = cserver.getPlayer(entityplayer1); PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn); cserver.getPluginManager().callEvent(respawnEvent); @@ -22,5 +22,5 @@ index 49b908d..747d708 100644 location = respawnEvent.getRespawnLocation(); entityplayer.reset(); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0035-Plug-World-Unload-Memory-Leak.patch b/CraftBukkit-Patches/0034-Plug-World-Unload-Memory-Leak.patch similarity index 80% rename from CraftBukkit-Patches/0035-Plug-World-Unload-Memory-Leak.patch rename to CraftBukkit-Patches/0034-Plug-World-Unload-Memory-Leak.patch index 75e60ddce7..5688f421db 100644 --- a/CraftBukkit-Patches/0035-Plug-World-Unload-Memory-Leak.patch +++ b/CraftBukkit-Patches/0034-Plug-World-Unload-Memory-Leak.patch @@ -1,22 +1,22 @@ -From fc446e6747d22f32433ee0fcd83002cd7b16968b Mon Sep 17 00:00:00 2001 +From 5d3bb1f3aa738f787b50eeca611e901225094f43 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 3 Aug 2013 19:02:59 +1000 Subject: [PATCH] Plug World Unload Memory Leak diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java -index 125cefe..6a7e7b3 100644 +index c6c0ab2..b4d1741 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java @@ -10,7 +10,7 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit public class BlockRedstoneTorch extends BlockTorch { -- private static Map> b = Maps.newHashMap(); -+ private static Map> b = new java.util.WeakHashMap(); // Spigot +- private static Map> g = Maps.newHashMap(); ++ private static Map> g = new java.util.WeakHashMap(); // Spigot private final boolean isOn; private boolean a(World world, BlockPosition blockposition, boolean flag) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0036-Player-Collision-API.patch b/CraftBukkit-Patches/0035-Player-Collision-API.patch similarity index 65% rename from CraftBukkit-Patches/0036-Player-Collision-API.patch rename to CraftBukkit-Patches/0035-Player-Collision-API.patch index 0ee84ae0bd..83ceea2c03 100644 --- a/CraftBukkit-Patches/0036-Player-Collision-API.patch +++ b/CraftBukkit-Patches/0035-Player-Collision-API.patch @@ -1,23 +1,23 @@ -From 3fe39dbb7f7395a69b32f2a1055eadd08f930f3a Mon Sep 17 00:00:00 2001 +From 5b1adb577f1517f238a6330131d4b7153db07132 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 3 Aug 2013 19:27:07 +1000 Subject: [PATCH] Player Collision API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index ab4373a..f571649 100644 +index 95bf165..b7355b0 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -427,6 +427,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -376,6 +376,7 @@ public abstract class EntityHuman extends EntityLiving { List list = this.world.getEntities(this, axisalignedbb); -+ if (this.ae()) { // Spigot: Add this.ae() condition (second !this.isDead near bottom of EntityLiving) ++ if (this.isCollidable()) { // Spigot: Add isCollidable() condition (second !this.isDead near bottom of EntityLiving) for (int i = 0; i < list.size(); ++i) { Entity entity = (Entity) list.get(i); -@@ -434,6 +435,7 @@ public abstract class EntityHuman extends EntityLiving { - this.d(entity); +@@ -383,6 +384,7 @@ public abstract class EntityHuman extends EntityLiving { + this.c(entity); } } + } // Spigot @@ -25,23 +25,23 @@ index ab4373a..f571649 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index bd30895..6d1a743 100644 +index aba9047..b78b273 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1675,7 +1675,7 @@ public abstract class EntityLiving extends Entity { - } - })); +@@ -1966,7 +1966,7 @@ public abstract class EntityLiving extends Entity { + protected void cn() { + List list = this.world.a((Entity) this, this.getBoundingBox(), IEntitySelector.a(this)); - if (!list.isEmpty()) { -+ if (this.ad() && !list.isEmpty()) { // Spigot: Add this.ad() condition ++ if (this.isInteractable() && !list.isEmpty()) { // Spigot: Add isInteractable() condition for (int i = 0; i < list.size(); ++i) { Entity entity = (Entity) list.get(i); - + // TODO better check now? diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index a7a0516..4a415f6 100644 +index 846566e..6cda7b9 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -62,6 +62,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -65,6 +65,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public double maxHealthCache; public boolean joining = true; // CraftBukkit end @@ -49,25 +49,25 @@ index a7a0516..4a415f6 100644 + public boolean collidesWithEntities = true; + + @Override -+ public boolean ad() ++ public boolean isInteractable() + { -+ return this.collidesWithEntities && super.ad(); // (first !this.isDead near bottom of EntityLiving) ++ return this.collidesWithEntities && super.isInteractable(); // (first !this.isDead near bottom of EntityLiving) + } + + @Override -+ public boolean ae() ++ public boolean isCollidable() + { -+ return this.collidesWithEntities && super.ae(); // (second !this.isDead near bottom of EntityLiving) ++ return this.collidesWithEntities && super.isCollidable(); // (second !this.isDead near bottom of EntityLiving) + } + // Spigot end public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { super(worldserver, gameprofile); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d4d6259..3a07a7b 100644 +index cd51b41..17a074a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1345,6 +1345,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1411,6 +1411,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Spigot start private final Player.Spigot spigot = new Player.Spigot() { @@ -82,11 +82,11 @@ index d4d6259..3a07a7b 100644 + public void setCollidesWithEntities(boolean collides) + { + getHandle().collidesWithEntities = collides; -+ getHandle().k = collides; // First boolean of Entity ++ getHandle().i = collides; // First boolean of Entity + } }; public Player.Spigot spigot() -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0037-Fully-Disable-Snooper-When-Not-Required.patch b/CraftBukkit-Patches/0036-Fully-Disable-Snooper-When-Not-Required.patch similarity index 69% rename from CraftBukkit-Patches/0037-Fully-Disable-Snooper-When-Not-Required.patch rename to CraftBukkit-Patches/0036-Fully-Disable-Snooper-When-Not-Required.patch index 9c90511c2f..858c9d46b3 100644 --- a/CraftBukkit-Patches/0037-Fully-Disable-Snooper-When-Not-Required.patch +++ b/CraftBukkit-Patches/0036-Fully-Disable-Snooper-When-Not-Required.patch @@ -1,27 +1,27 @@ -From fd42204f5757b7af9451bdc9dcf68d7eafa22901 Mon Sep 17 00:00:00 2001 +From accd1742de8b965b819198e95f1edf8599be21b1 Mon Sep 17 00:00:00 2001 From: agentk20 Date: Sat, 3 Aug 2013 19:28:48 +1000 Subject: [PATCH] Fully Disable Snooper When Not Required diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5d1aa0b..2acf3bd 100644 +index 9061ff2..ea7e0bd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -656,11 +656,11 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -657,11 +657,11 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.h[this.ticks % 100] = System.nanoTime() - i; this.methodProfiler.b(); this.methodProfiler.a("snooper"); -- if (!this.n.d() && this.ticks > 100) { -+ if (getSnooperEnabled() && !this.n.d() && this.ticks > 100) { // Spigot - this.n.a(); +- if (!this.m.d() && this.ticks > 100) { ++ if (getSnooperEnabled() && !this.m.d() && this.ticks > 100) { // Spigot + this.m.a(); } - if (this.ticks % 6000 == 0) { + if (getSnooperEnabled() && this.ticks % 6000 == 0) { // Spigot - this.n.b(); + this.m.b(); } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0038-Add-Getter-for-Entity-Invulnerability.patch b/CraftBukkit-Patches/0037-Add-Getter-for-Entity-Invulnerability.patch similarity index 81% rename from CraftBukkit-Patches/0038-Add-Getter-for-Entity-Invulnerability.patch rename to CraftBukkit-Patches/0037-Add-Getter-for-Entity-Invulnerability.patch index dc384bc14d..01e7470635 100644 --- a/CraftBukkit-Patches/0038-Add-Getter-for-Entity-Invulnerability.patch +++ b/CraftBukkit-Patches/0037-Add-Getter-for-Entity-Invulnerability.patch @@ -1,14 +1,14 @@ -From e5bb74a1c2832936bc46cb42915f39abebc51a94 Mon Sep 17 00:00:00 2001 +From 01364dbf67a69279c652d89160b45a96b7bb1470 Mon Sep 17 00:00:00 2001 From: DerFlash Date: Sat, 3 Aug 2013 19:53:48 +1000 Subject: [PATCH] Add Getter for Entity Invulnerability diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 4c0ac67..0234fe3 100644 +index 97dfc54..1e51d4c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -542,6 +542,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -559,6 +559,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { // Spigot start private final Spigot spigot = new Spigot() { @@ -21,5 +21,5 @@ index 4c0ac67..0234fe3 100644 public Spigot spigot() -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0039-Cap-Minimum-Player-Speed.patch b/CraftBukkit-Patches/0038-Cap-Minimum-Player-Speed.patch similarity index 81% rename from CraftBukkit-Patches/0039-Cap-Minimum-Player-Speed.patch rename to CraftBukkit-Patches/0038-Cap-Minimum-Player-Speed.patch index 284d196785..7d3355494f 100644 --- a/CraftBukkit-Patches/0039-Cap-Minimum-Player-Speed.patch +++ b/CraftBukkit-Patches/0038-Cap-Minimum-Player-Speed.patch @@ -1,14 +1,14 @@ -From aae347ac688cad34a2bf4684deb4b14a185fde1b Mon Sep 17 00:00:00 2001 +From be15a2a5088b43317c26933b1645cdbd40ae76eb Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 5 Aug 2013 20:17:20 +1000 Subject: [PATCH] Cap Minimum Player Speed diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3a07a7b..9d240c9 100644 +index 17a074a..b20ccc1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1178,7 +1178,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1179,7 +1179,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void setFlySpeed(float value) { validateSpeed(value); EntityPlayer player = getHandle(); @@ -17,7 +17,7 @@ index 3a07a7b..9d240c9 100644 player.updateAbilities(); } -@@ -1187,7 +1187,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1188,7 +1188,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void setWalkSpeed(float value) { validateSpeed(value); EntityPlayer player = getHandle(); @@ -27,5 +27,5 @@ index 3a07a7b..9d240c9 100644 } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0041-Call-EntityChangeBlockEvent-for-Fire-Arrows-hitting-.patch b/CraftBukkit-Patches/0039-Call-EntityChangeBlockEvent-for-Fire-Arrows-hitting-.patch similarity index 87% rename from CraftBukkit-Patches/0041-Call-EntityChangeBlockEvent-for-Fire-Arrows-hitting-.patch rename to CraftBukkit-Patches/0039-Call-EntityChangeBlockEvent-for-Fire-Arrows-hitting-.patch index 1ee25d02de..75a06756d1 100644 --- a/CraftBukkit-Patches/0041-Call-EntityChangeBlockEvent-for-Fire-Arrows-hitting-.patch +++ b/CraftBukkit-Patches/0039-Call-EntityChangeBlockEvent-for-Fire-Arrows-hitting-.patch @@ -1,4 +1,4 @@ -From 4b13a7bb4f86b86b104d512f730b058734df7ff4 Mon Sep 17 00:00:00 2001 +From 56a850636f2d5ea0d5bb4632a26e662d119be4b7 Mon Sep 17 00:00:00 2001 From: BlackHole Date: Tue, 16 Jul 2013 22:34:50 +0200 Subject: [PATCH] Call EntityChangeBlockEvent for Fire Arrows hitting TNT @@ -6,10 +6,10 @@ Subject: [PATCH] Call EntityChangeBlockEvent for Fire Arrows hitting TNT Adds BUKKIT-4355 diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java -index f15b199..40c0a87 100644 +index 54140f7..f794167 100644 --- a/src/main/java/net/minecraft/server/BlockTNT.java +++ b/src/main/java/net/minecraft/server/BlockTNT.java -@@ -77,6 +77,11 @@ public class BlockTNT extends Block { +@@ -73,6 +73,11 @@ public class BlockTNT extends Block { EntityArrow entityarrow = (EntityArrow) entity; if (entityarrow.isBurning()) { @@ -22,5 +22,5 @@ index f15b199..40c0a87 100644 world.setAir(blockposition); } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0042-Allow-Disabling-of-1.6.3-Structure-Saving.patch b/CraftBukkit-Patches/0040-Allow-Disabling-of-1.6.3-Structure-Saving.patch similarity index 65% rename from CraftBukkit-Patches/0042-Allow-Disabling-of-1.6.3-Structure-Saving.patch rename to CraftBukkit-Patches/0040-Allow-Disabling-of-1.6.3-Structure-Saving.patch index c139c5f478..0360e1d4db 100644 --- a/CraftBukkit-Patches/0042-Allow-Disabling-of-1.6.3-Structure-Saving.patch +++ b/CraftBukkit-Patches/0040-Allow-Disabling-of-1.6.3-Structure-Saving.patch @@ -1,34 +1,33 @@ -From b61bd159a881d8e31de9c8d640815e720420a77c Mon Sep 17 00:00:00 2001 +From 82fbb6298f22d11a2ed1c53d3f47c21f7e7e3e78 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 21 Sep 2013 12:33:09 +1000 Subject: [PATCH] Allow Disabling of 1.6.3 Structure Saving diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index 0bced98..bb1a11e 100644 +index dacba33..4a4d2af 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java -@@ -195,7 +195,15 @@ public abstract class StructureGenerator extends WorldGenBase { +@@ -197,7 +197,13 @@ public abstract class StructureGenerator extends WorldGenBase { - private void a(World world) { - if (this.d == null) { + protected void a(World world) { + if (this.a == null) { +- this.a = (PersistentStructure) world.a(PersistentStructure.class, this.a()); + // Spigot Start -+ if ( world.spigotConfig.saveStructureInfo ) -+ { - this.d = (PersistentStructure) world.a(PersistentStructure.class, this.a()); -+ } else -+ { -+ this.d = new PersistentStructure( this.a() ); ++ if (world.spigotConfig.saveStructureInfo) { ++ this.a = (PersistentStructure) world.a(PersistentStructure.class, this.a()); ++ } else { ++ this.a = new PersistentStructure(this.a()); + } + // Spigot End - if (this.d == null) { - this.d = new PersistentStructure(this.a()); - world.a(this.a(), (PersistentBase) this.d); + if (this.a == null) { + this.a = new PersistentStructure(this.a()); + world.a(this.a(), (PersistentBase) this.a); diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 2b98acb..15cb6b4 100644 +index c2452d6..89f9bc3 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -188,4 +188,16 @@ public class SpigotWorldConfig +@@ -184,4 +184,16 @@ public class SpigotWorldConfig randomLightUpdates = getBoolean( "random-light-updates", false ); log( "Random Lighting Updates: " + randomLightUpdates ); } @@ -46,5 +45,5 @@ index 2b98acb..15cb6b4 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0040-Update-Inventory-and-Health-for-PlayerConsumeItemEve.patch b/CraftBukkit-Patches/0040-Update-Inventory-and-Health-for-PlayerConsumeItemEve.patch deleted file mode 100644 index 94b4d1ca52..0000000000 --- a/CraftBukkit-Patches/0040-Update-Inventory-and-Health-for-PlayerConsumeItemEve.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 4a01fe5baa2c8bc6ff8b4ddabe047dde8f3231e0 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sat, 14 Sep 2013 10:16:38 +1000 -Subject: [PATCH] Update Inventory and Health for PlayerConsumeItemEvent - - -diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index c93a5da..17c9f64 100644 ---- a/src/main/java/net/minecraft/server/EntityHuman.java -+++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -300,6 +300,10 @@ public abstract class EntityHuman extends EntityLiving { - // Update client - if (this instanceof EntityPlayer) { - ((EntityPlayer) this).playerConnection.sendPacket(new PacketPlayOutSetSlot((byte) 0, activeContainer.getSlot((IInventory) this.inventory, this.inventory.itemInHandIndex).index, this.g)); -+ // Spigot Start -+ ((EntityPlayer) this).getBukkitEntity().updateInventory(); -+ ((EntityPlayer) this).getBukkitEntity().updateScaledHealth(); -+ // Spigot End - } - return; - } --- -2.1.4 - diff --git a/CraftBukkit-Patches/0044-Don-t-Special-Case-X-Move-Value.patch b/CraftBukkit-Patches/0041-Don-t-Special-Case-X-Move-Value.patch similarity index 82% rename from CraftBukkit-Patches/0044-Don-t-Special-Case-X-Move-Value.patch rename to CraftBukkit-Patches/0041-Don-t-Special-Case-X-Move-Value.patch index ea00227784..789ac956f7 100644 --- a/CraftBukkit-Patches/0044-Don-t-Special-Case-X-Move-Value.patch +++ b/CraftBukkit-Patches/0041-Don-t-Special-Case-X-Move-Value.patch @@ -1,14 +1,14 @@ -From acbb89c50b0a24da787bd49dd472f57ac885f45c Mon Sep 17 00:00:00 2001 +From f5f87701e5a6ab0f80580fb892c7f5c52ee40e06 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 6 Oct 2013 17:36:28 +1100 Subject: [PATCH] Don't Special Case X Move Value diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 8d6d3c7..36f0684 100644 +index f785d9f..83a4551 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -112,6 +112,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList +@@ -124,6 +124,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { private float lastPitch = Float.MAX_VALUE; private float lastYaw = Float.MAX_VALUE; private boolean justTeleported = false; @@ -16,8 +16,8 @@ index 8d6d3c7..36f0684 100644 public CraftPlayer getPlayer() { return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity(); -@@ -223,6 +224,18 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - } +@@ -324,6 +325,18 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + // CraftBukkit start - fire PlayerMoveEvent Player player = this.getPlayer(); + // Spigot Start @@ -35,7 +35,7 @@ index 8d6d3c7..36f0684 100644 Location from = new Location(player.getWorld(), lastPosX, lastPosY, lastPosZ, lastYaw, lastPitch); // Get the Players previous Event location. Location to = player.getLocation().clone(); // Start off the To location as the Players current location. -@@ -251,7 +264,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList +@@ -349,7 +362,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { this.lastPitch = to.getPitch(); // Skip the first time we do this @@ -45,5 +45,5 @@ index 8d6d3c7..36f0684 100644 PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); this.server.getPluginManager().callEvent(event); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0045-Implement-respawn-API.patch b/CraftBukkit-Patches/0042-Implement-respawn-API.patch similarity index 77% rename from CraftBukkit-Patches/0045-Implement-respawn-API.patch rename to CraftBukkit-Patches/0042-Implement-respawn-API.patch index 083c90fa40..929d4edd13 100644 --- a/CraftBukkit-Patches/0045-Implement-respawn-API.patch +++ b/CraftBukkit-Patches/0042-Implement-respawn-API.patch @@ -1,16 +1,16 @@ -From abebbbac98d7d10cdd59763777a847de2eb81b3b Mon Sep 17 00:00:00 2001 +From a823d20f36d8f9b643f84546223db8a75205b5ef Mon Sep 17 00:00:00 2001 From: ninja- Date: Tue, 8 Oct 2013 14:34:49 +0200 Subject: [PATCH] Implement respawn API. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9d240c9..6c1a092 100644 +index b20ccc1..d62cc5b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1358,6 +1358,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1424,6 +1424,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getHandle().collidesWithEntities = collides; - getHandle().k = collides; // First boolean of Entity + getHandle().i = collides; // First boolean of Entity } + + @Override @@ -25,5 +25,5 @@ index 9d240c9..6c1a092 100644 public Player.Spigot spigot() -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0046-Arrow-Despawn-Rate.patch b/CraftBukkit-Patches/0043-Arrow-Despawn-Rate.patch similarity index 59% rename from CraftBukkit-Patches/0046-Arrow-Despawn-Rate.patch rename to CraftBukkit-Patches/0043-Arrow-Despawn-Rate.patch index 9eefdd966b..ee0807047e 100644 --- a/CraftBukkit-Patches/0046-Arrow-Despawn-Rate.patch +++ b/CraftBukkit-Patches/0043-Arrow-Despawn-Rate.patch @@ -1,29 +1,29 @@ -From 2d9a2afdc3d508a398d1d274597aa22a3b8740cd Mon Sep 17 00:00:00 2001 +From f52d6627b4e07c0c661637dc166311f3db6432e1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 14 Oct 2013 19:20:10 +1100 Subject: [PATCH] Arrow Despawn Rate diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index 3359160..3a80776 100644 +index a40f3ec..e40642f 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -155,7 +155,7 @@ public class EntityArrow extends Entity implements IProjectile { +@@ -144,7 +144,7 @@ public abstract class EntityArrow extends Entity implements IProjectile { - if (block == this.g && i == this.h) { - ++this.ar; -- if (this.ar >= 1200) { -+ if (this.ar >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter + if (block == this.au && i == this.av) { + ++this.aw; +- if (this.aw >= 1200) { ++ if (this.aw >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter this.die(); } } else { diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index efbfa2e..d8433ac 100644 +index 89f9bc3..28643c5 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -207,4 +207,11 @@ public class SpigotWorldConfig - itemDespawnRate = getInt( "item-despawn-rate", 6000 ); - log( "Item Despawn Rate: " + itemDespawnRate ); +@@ -196,4 +196,11 @@ public class SpigotWorldConfig + log( "*** WARNING *** Please use this option with caution, SpigotMC is not responsible for any issues this option may cause in the future!" ); + } } + + public int arrowDespawnRate; @@ -34,5 +34,5 @@ index efbfa2e..d8433ac 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0048-Watchdog-Thread.patch b/CraftBukkit-Patches/0044-Watchdog-Thread.patch similarity index 95% rename from CraftBukkit-Patches/0048-Watchdog-Thread.patch rename to CraftBukkit-Patches/0044-Watchdog-Thread.patch index c977fb0532..4c3ee6a547 100644 --- a/CraftBukkit-Patches/0048-Watchdog-Thread.patch +++ b/CraftBukkit-Patches/0044-Watchdog-Thread.patch @@ -1,27 +1,27 @@ -From d80a8985f88927ef527f5959f32ec1d2c47ab765 Mon Sep 17 00:00:00 2001 +From fc6573b98957b800678afa46130eac7c5493fab4 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 5 Aug 2014 17:20:19 +0100 Subject: [PATCH] Watchdog Thread. diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index da295f3..113049a 100644 +index 92dd207..93ace97 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -270,7 +270,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -276,7 +276,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } // CraftBukkit end -- if (this.aS() > 0L) { -+ if (false && this.aS() > 0L) { // Spigot - disable +- if (this.aP() > 0L) { ++ if (false && this.aP() > 0L) { // Spigot - disable Thread thread1 = new Thread(new ThreadWatchdog(this)); thread1.setName("Server Watchdog"); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2acf3bd..d5f58f1 100644 +index ea7e0bd..04c36fe 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -566,6 +566,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -563,6 +563,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.a(crashreport); } finally { try { @@ -29,7 +29,7 @@ index 2acf3bd..d5f58f1 100644 this.isStopped = true; this.stop(); } catch (Throwable throwable1) { -@@ -666,6 +667,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -667,6 +668,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.methodProfiler.b(); this.methodProfiler.b(); @@ -38,10 +38,10 @@ index 2acf3bd..d5f58f1 100644 org.spigotmc.CustomTimingsHandler.tick(); // Spigot } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ff60351..63b5d67 100644 +index 7cdba38..72e1e2f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1685,6 +1685,11 @@ public final class CraftServer implements Server { +@@ -1696,6 +1696,11 @@ public final class CraftServer implements Server { { return org.spigotmc.SpigotConfig.config; } @@ -330,5 +330,5 @@ index 0000000..de08ad6 + } +} -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0050-Fix-some-chunks-not-being-sent-to-the-client.patch b/CraftBukkit-Patches/0045-Fix-some-chunks-not-being-sent-to-the-client.patch similarity index 82% rename from CraftBukkit-Patches/0050-Fix-some-chunks-not-being-sent-to-the-client.patch rename to CraftBukkit-Patches/0045-Fix-some-chunks-not-being-sent-to-the-client.patch index 29f2c8cf9e..aea7c97a6f 100644 --- a/CraftBukkit-Patches/0050-Fix-some-chunks-not-being-sent-to-the-client.patch +++ b/CraftBukkit-Patches/0045-Fix-some-chunks-not-being-sent-to-the-client.patch @@ -1,18 +1,18 @@ -From 4780ccafe1a89c999b2be1124c3a08edfa190041 Mon Sep 17 00:00:00 2001 +From 12d2f54389e8f6303e5e98cc11d08701efc9a2bc 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 6460ab1..f461f50 100644 +index f68abb4..47ef0db 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -1061,7 +1061,15 @@ public class Chunk { +@@ -1009,7 +1009,15 @@ public class Chunk { } public boolean isReady() { -- return this.p && this.done && this.lit; +- return this.q && this.done && this.lit; + // Spigot Start + /* + * As of 1.7, Mojang added a check to make sure that only chunks which have been lit are sent to the client. @@ -24,7 +24,7 @@ index 6460ab1..f461f50 100644 + // Spigot End } - public ChunkCoordIntPair j() { + public boolean j() { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0051-Fix-Broken-Async-Chat.patch b/CraftBukkit-Patches/0046-Fix-Broken-Async-Chat.patch similarity index 95% rename from CraftBukkit-Patches/0051-Fix-Broken-Async-Chat.patch rename to CraftBukkit-Patches/0046-Fix-Broken-Async-Chat.patch index a0a35bc9ba..6e032b89a8 100644 --- a/CraftBukkit-Patches/0051-Fix-Broken-Async-Chat.patch +++ b/CraftBukkit-Patches/0046-Fix-Broken-Async-Chat.patch @@ -1,4 +1,4 @@ -From cc4c9041be7f3626120940a3d403c5266c101f91 Mon Sep 17 00:00:00 2001 +From 88078807067fbb7644b68ed4cba439069f8eba0d Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 5 Dec 2013 13:55:53 +1100 Subject: [PATCH] Fix Broken Async Chat @@ -35,5 +35,5 @@ index 0ab90f3..18358b4 100644 } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0054-Fire-PreLogin-Events-in-Offline-Mode.patch b/CraftBukkit-Patches/0047-Fire-PreLogin-Events-in-Offline-Mode.patch similarity index 80% rename from CraftBukkit-Patches/0054-Fire-PreLogin-Events-in-Offline-Mode.patch rename to CraftBukkit-Patches/0047-Fire-PreLogin-Events-in-Offline-Mode.patch index 2802e7c41f..a751571342 100644 --- a/CraftBukkit-Patches/0054-Fire-PreLogin-Events-in-Offline-Mode.patch +++ b/CraftBukkit-Patches/0047-Fire-PreLogin-Events-in-Offline-Mode.patch @@ -1,11 +1,11 @@ -From 6b1f5316e3a221a450333e195178f5e29e84381d Mon Sep 17 00:00:00 2001 +From b2e96c15b5a2e7d0230b712608d26d883ad2a850 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 18 Dec 2013 13:32:10 +1100 Subject: [PATCH] Fire PreLogin Events in Offline Mode diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 97c88ea..1fa9626 100644 +index 3cca9ff..71d24b2 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -13,6 +13,7 @@ import java.util.Arrays; @@ -16,7 +16,7 @@ index 97c88ea..1fa9626 100644 import javax.crypto.SecretKey; import org.apache.commons.lang3.Validate; import org.apache.logging.log4j.LogManager; -@@ -80,10 +81,23 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo +@@ -80,10 +81,23 @@ public class LoginListener implements PacketLoginInListener, ITickable { } @@ -40,29 +40,36 @@ index 97c88ea..1fa9626 100644 // CraftBukkit start - fire PlayerLoginEvent EntityPlayer s = this.server.getPlayerList().attemptLogin(this, this.i, hostname); -@@ -133,7 +147,15 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo +@@ -133,7 +147,22 @@ public class LoginListener implements PacketLoginInListener, ITickable { this.g = LoginListener.EnumProtocolState.KEY; - this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.Q().getPublic(), this.e)); + this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin(this.j, this.server.O().getPublic(), this.e)); } else { - this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; + // Spigot start -+ try { -+ initUUID(); -+ new LoginHandler().fireEvents(); -+ } catch (Exception ex) { -+ disconnect("Failed to verify username!"); -+ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex); -+ } ++ new Thread("User Authenticator #" + LoginListener.b.incrementAndGet()) { ++ ++ @Override ++ public void run() { ++ try { ++ initUUID(); ++ new LoginHandler().fireEvents(); ++ LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; ++ } catch (Exception ex) { ++ disconnect("Failed to verify username!"); ++ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex); ++ } ++ } ++ }.start(); + // Spigot end } } -@@ -162,6 +184,40 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo +@@ -162,6 +191,39 @@ public class LoginListener implements PacketLoginInListener, ITickable { return; } + new LoginHandler().fireEvents(); -+ } else if (LoginListener.this.server.T()) { ++ } else if (LoginListener.this.server.R()) { + LoginListener.c.warn("Failed to verify username but will let them in anyway!"); + LoginListener.this.i = LoginListener.this.a(gameprofile); + LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; @@ -71,7 +78,7 @@ index 97c88ea..1fa9626 100644 + LoginListener.c.error("Username \'" + gameprofile.getName() + "\' tried to join with an invalid session"); // CraftBukkit - fix null pointer + } + } catch (AuthenticationUnavailableException authenticationunavailableexception) { -+ if (LoginListener.this.server.T()) { ++ if (LoginListener.this.server.R()) { + LoginListener.c.warn("Authentication servers are down but will let them in anyway!"); + LoginListener.this.i = LoginListener.this.a(gameprofile); + LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; @@ -85,7 +92,6 @@ index 97c88ea..1fa9626 100644 + server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + gameprofile.getName(), exception); + // CraftBukkit end + } -+ + } + }).start(); + } @@ -98,11 +104,11 @@ index 97c88ea..1fa9626 100644 String playerName = i.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress(); java.util.UUID uniqueId = i.getId(); -@@ -196,34 +252,9 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo +@@ -196,34 +258,9 @@ public class LoginListener implements PacketLoginInListener, ITickable { // CraftBukkit end LoginListener.c.info("UUID of player " + LoginListener.this.i.getName() + " is " + LoginListener.this.i.getId()); LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; -- } else if (LoginListener.this.server.T()) { +- } else if (LoginListener.this.server.R()) { - LoginListener.c.warn("Failed to verify username but will let them in anyway!"); - LoginListener.this.i = LoginListener.this.a(gameprofile); - LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; @@ -111,7 +117,7 @@ index 97c88ea..1fa9626 100644 - LoginListener.c.error("Username \'" + gameprofile.getName() + "\' tried to join with an invalid session"); // CraftBukkit - fix null pointer - } - } catch (AuthenticationUnavailableException authenticationunavailableexception) { -- if (LoginListener.this.server.T()) { +- if (LoginListener.this.server.R()) { - LoginListener.c.warn("Authentication servers are down but will let them in anyway!"); - LoginListener.this.i = LoginListener.this.a(gameprofile); - LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; @@ -126,14 +132,14 @@ index 97c88ea..1fa9626 100644 - // CraftBukkit end - } - -- } + } - }).start(); } - } +- } + // Spigot end protected GameProfile a(GameProfile gameprofile) { UUID uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + gameprofile.getName()).getBytes(Charsets.UTF_8)); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0047-Fix-packed-ice-generation.patch b/CraftBukkit-Patches/0047-Fix-packed-ice-generation.patch deleted file mode 100644 index 94fa197e24..0000000000 --- a/CraftBukkit-Patches/0047-Fix-packed-ice-generation.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f0d250f577da79657fec78fcdc267d3b4b221653 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Sun, 1 Dec 2013 17:52:14 +1100 -Subject: [PATCH] Fix packed ice generation - - -diff --git a/src/main/java/net/minecraft/server/WorldGenPackedIce2.java b/src/main/java/net/minecraft/server/WorldGenPackedIce2.java -index dcd085a..3d08a82 100644 ---- a/src/main/java/net/minecraft/server/WorldGenPackedIce2.java -+++ b/src/main/java/net/minecraft/server/WorldGenPackedIce2.java -@@ -40,13 +40,13 @@ public class WorldGenPackedIce2 extends WorldGenerator { - Block block = world.getType(blockposition.a(i1, k, j1)).getBlock(); - - if (block.getMaterial() == Material.AIR || block == Blocks.DIRT || block == Blocks.SNOW || block == Blocks.ICE) { -- this.a(world, blockposition.a(i1, k, j1), Blocks.PACKED_ICE.getBlockData()); -+ world.setTypeUpdate(blockposition.a(i1, k, j1), Blocks.PACKED_ICE.getBlockData()); // Spigot - } - - if (k != 0 && l > 1) { - block = world.getType(blockposition.a(i1, -k, j1)).getBlock(); - if (block.getMaterial() == Material.AIR || block == Blocks.DIRT || block == Blocks.SNOW || block == Blocks.ICE) { -- this.a(world, blockposition.a(i1, -k, j1), Blocks.PACKED_ICE.getBlockData()); -+ world.setTypeUpdate(blockposition.a(i1, -k, j1), Blocks.PACKED_ICE.getBlockData()); // Spigot - } - } - } -@@ -77,7 +77,7 @@ public class WorldGenPackedIce2 extends WorldGenerator { - Block block1 = world.getType(blockposition1).getBlock(); - - if (block1.getMaterial() == Material.AIR || block1 == Blocks.DIRT || block1 == Blocks.SNOW || block1 == Blocks.ICE || block1 == Blocks.PACKED_ICE) { -- this.a(world, blockposition1, Blocks.PACKED_ICE.getBlockData()); -+ world.setTypeUpdate(blockposition1, Blocks.PACKED_ICE.getBlockData()); // Spigot - blockposition1 = blockposition1.down(); - --l1; - if (l1 <= 0) { --- -2.1.4 - diff --git a/CraftBukkit-Patches/0055-BungeeCord-Support.patch b/CraftBukkit-Patches/0048-BungeeCord-Support.patch similarity index 78% rename from CraftBukkit-Patches/0055-BungeeCord-Support.patch rename to CraftBukkit-Patches/0048-BungeeCord-Support.patch index 7c913df517..98545fe569 100644 --- a/CraftBukkit-Patches/0055-BungeeCord-Support.patch +++ b/CraftBukkit-Patches/0048-BungeeCord-Support.patch @@ -1,4 +1,4 @@ -From 179f4c4ec3ac77456f264ce16885fe01257c24c4 Mon Sep 17 00:00:00 2001 +From cbc5ee4521288a2da2b9aeae62759f7e324f9652 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 1 Dec 2013 18:18:41 +1100 Subject: [PATCH] BungeeCord Support @@ -6,7 +6,7 @@ Subject: [PATCH] BungeeCord Support Provides support for IP forwarding via BungeeCord. diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index 53823c6..64f6a9b 100644 +index 8ee721e..4fd9995 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -7,6 +7,7 @@ import java.util.HashMap; @@ -20,7 +20,7 @@ index 53823c6..64f6a9b 100644 @@ -71,6 +72,26 @@ public class HandshakeListener implements PacketHandshakingInListener { this.b.close(chatcomponenttext); } else { - this.b.a((PacketListener) (new LoginListener(this.a, this.b))); + this.b.setPacketListener(new LoginListener(this.a, this.b)); + // Spigot Start + if (org.spigotmc.SpigotConfig.bungee) { + String[] split = packethandshakinginsetprotocol.hostname.split("\00"); @@ -31,7 +31,7 @@ index 53823c6..64f6a9b 100644 + } else + { + chatcomponenttext = new ChatComponentText("If you wish to use IP forwarding, please enable it in your BungeeCord config as well!"); -+ this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext)); ++ this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext)); + this.b.close(chatcomponenttext); + return; + } @@ -41,14 +41,14 @@ index 53823c6..64f6a9b 100644 + } + } + // Spigot End - ((LoginListener) this.b.getPacketListener()).hostname = packethandshakinginsetprotocol.hostname + ":" + packethandshakinginsetprotocol.port; // CraftBukkit - set hostname + ((LoginListener) this.b.i()).hostname = packethandshakinginsetprotocol.hostname + ":" + packethandshakinginsetprotocol.port; // CraftBukkit - set hostname } break; diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 1fa9626..541cec7 100644 +index 71d24b2..efa785f 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java -@@ -84,9 +84,24 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo +@@ -84,9 +84,24 @@ public class LoginListener implements PacketLoginInListener, ITickable { // Spigot start public void initUUID() { @@ -74,38 +74,11 @@ index 1fa9626..541cec7 100644 } // Spigot end -@@ -148,13 +163,19 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo - this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.Q().getPublic(), this.e)); - } else { - // Spigot start -- try { -- initUUID(); -- new LoginHandler().fireEvents(); -- } catch (Exception ex) { -- disconnect("Failed to verify username!"); -- server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex); -- } -+ initUUID(); -+ new Thread(new Runnable() { -+ -+ @Override -+ public void run() { -+ try{ -+ new LoginHandler().fireEvents(); -+ } catch (Exception ex) { -+ disconnect("Failed to verify username!"); -+ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex); -+ } -+ } -+ }).start(); - // Spigot end - } - diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 7623b42..7959242 100644 +index 5ed2c96..c3ff6c2 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -64,7 +64,11 @@ public class NetworkManager extends SimpleChannelInboundHandler { +@@ -64,7 +64,11 @@ public class NetworkManager extends SimpleChannelInboundHandler> { private final Queue i = Queues.newConcurrentLinkedQueue(); private final ReentrantReadWriteLock j = new ReentrantReadWriteLock(); public Channel channel; @@ -118,7 +91,7 @@ index 7623b42..7959242 100644 private PacketListener m; private IChatBaseComponent n; private boolean o; -@@ -322,4 +326,11 @@ public class NetworkManager extends SimpleChannelInboundHandler { +@@ -323,4 +327,11 @@ public class NetworkManager extends SimpleChannelInboundHandler> { this.b = agenericfuturelistener; } } @@ -131,23 +104,23 @@ index 7623b42..7959242 100644 + // Spigot End } diff --git a/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java b/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java -index 9c7b691..fba8bba 100644 +index 86f1be7..e6ab607 100644 --- a/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java +++ b/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java @@ -13,7 +13,7 @@ public class PacketHandshakingInSetProtocol implements Packet Date: Thu, 12 Dec 2013 18:05:03 -0600 Subject: [PATCH] Allow Disabling Zombie Villager Aggression @@ -6,31 +6,25 @@ Subject: [PATCH] Allow Disabling Zombie Villager Aggression Ability to configure if Zombies will be aggressive towards Villagers. diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 91bb046..1a8d3d8 100644 +index d5f508b..ba2f12f 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -38,12 +38,12 @@ public class EntityZombie extends EntityMonster { - } - - protected void n() { -- this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityVillager.class, 1.0D, true)); -+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityVillager.class, 1.0D, true)); // Spigot - this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityIronGolem.class, 1.0D, true)); +@@ -46,7 +46,7 @@ public class EntityZombie extends EntityMonster { this.goalSelector.a(6, new PathfinderGoalMoveThroughVillage(this, 1.0D, false)); this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, true, new Class[] { EntityPigZombie.class})); this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, true)); -- this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false)); -+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false)); // Spigot - this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityIronGolem.class, true)); +- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false)); ++ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false)); // Spigot + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityIronGolem.class, true)); } diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 5d2b755..f6fc0a2 100644 +index 28643c5..6df2186 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -247,4 +247,11 @@ public class SpigotWorldConfig - - antiXrayInstance = new AntiXray( this ); +@@ -203,4 +203,11 @@ public class SpigotWorldConfig + arrowDespawnRate = getInt( "arrow-despawn-rate", 1200 ); + log( "Arrow Despawn Rate: " + arrowDespawnRate ); } + + public boolean zombieAggressiveTowardsVillager; @@ -41,5 +35,5 @@ index 5d2b755..f6fc0a2 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0049-Clear-Flower-Pot-on-Drop.patch b/CraftBukkit-Patches/0049-Clear-Flower-Pot-on-Drop.patch deleted file mode 100644 index 93ac15bdc8..0000000000 --- a/CraftBukkit-Patches/0049-Clear-Flower-Pot-on-Drop.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 89eb6b05e7135406df9ca8300dd018432b763e27 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Tue, 3 Dec 2013 11:07:48 +1100 -Subject: [PATCH] Clear Flower Pot on Drop - - -diff --git a/src/main/java/net/minecraft/server/BlockFlowerPot.java b/src/main/java/net/minecraft/server/BlockFlowerPot.java -index fd77047..ce46138 100644 ---- a/src/main/java/net/minecraft/server/BlockFlowerPot.java -+++ b/src/main/java/net/minecraft/server/BlockFlowerPot.java -@@ -95,6 +95,7 @@ public class BlockFlowerPot extends BlockContainer { - - if (tileentityflowerpot != null && tileentityflowerpot.b() != null) { - a(world, blockposition, new ItemStack(tileentityflowerpot.b(), 1, tileentityflowerpot.c())); -+ tileentityflowerpot.a( null, 0 ); // Spigot - } - - super.remove(world, blockposition, iblockdata); --- -2.1.4 - diff --git a/CraftBukkit-Patches/0057-Configurable-Amount-of-Netty-Threads.patch b/CraftBukkit-Patches/0050-Configurable-Amount-of-Netty-Threads.patch similarity index 64% rename from CraftBukkit-Patches/0057-Configurable-Amount-of-Netty-Threads.patch rename to CraftBukkit-Patches/0050-Configurable-Amount-of-Netty-Threads.patch index 1aba4eebe5..4bc3a4666f 100644 --- a/CraftBukkit-Patches/0057-Configurable-Amount-of-Netty-Threads.patch +++ b/CraftBukkit-Patches/0050-Configurable-Amount-of-Netty-Threads.patch @@ -1,4 +1,4 @@ -From 8d59cbbb21000192b238c74addd28a4a625cf65e Mon Sep 17 00:00:00 2001 +From 37d742e73b2e9e710633315d64fdae33abd658e6 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 13 Dec 2013 11:58:58 +1100 Subject: [PATCH] Configurable Amount of Netty Threads @@ -6,36 +6,36 @@ Subject: [PATCH] Configurable Amount of Netty Threads This brings back the option that the Spigot version of netty saw. By default Netty will try and use cores*2 threads, however if running multiple servers on the same machine, this can be too many threads. Additionally some people have 16 core servers. If 32 Netty threads are allowed in this setup, then the lock contention, and thus blocking between threads becomes much greater, leading to decreased performance. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d5f58f1..cdf7e0a 100644 +index 04c36fe..8602ac6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -59,7 +59,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs - private final List p = Lists.newArrayList(); +@@ -57,7 +57,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + private final List o = Lists.newArrayList(); protected final ICommandHandler b; public final MethodProfiler methodProfiler = new MethodProfiler(); -- private final ServerConnection q; -+ private ServerConnection q; // Spigot - private final ServerPing r = new ServerPing(); - private final Random s = new Random(); - private String serverIp; -@@ -121,7 +121,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs - this.e = proxy; - MinecraftServer.l = this; +- private final ServerConnection p; ++ private ServerConnection p; // Spigot + private final ServerPing q = new ServerPing(); + private final Random r = new Random(); + private final DataConverterManager dataConverterManager; +@@ -122,7 +122,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + this.W = gameprofilerepository; + this.X = usercache; // this.universe = file; // CraftBukkit -- this.q = new ServerConnection(this); -+ // this.q = new ServerConnection(this); // Spigot - this.Z = new UserCache(this, file1); - this.b = this.h(); +- this.p = new ServerConnection(this); ++ // this.p = new ServerConnection(this); // Spigot + this.b = this.i(); // this.convertable = new WorldLoaderServer(file); // CraftBukkit - moved to DedicatedServer.init -@@ -1322,7 +1322,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + this.dataConverterManager = dataconvertermanager; +@@ -1298,7 +1298,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs } // Spigot End - public ServerConnection aq() { -- return this.q; -+ return this.q == null ? this.q = new ServerConnection(this) : this.q; // Spigot + public ServerConnection am() { +- return this.p; ++ return this.p == null ? this.p = new ServerConnection(this) : this.p; // Spigot } - public boolean as() { + public boolean ao() { diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java index 824ba7a..a306266 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java @@ -53,5 +53,5 @@ index 824ba7a..a306266 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0051-Prevent-Mineshaft-Saving.patch b/CraftBukkit-Patches/0051-Prevent-Mineshaft-Saving.patch new file mode 100644 index 0000000000..045b7ba602 --- /dev/null +++ b/CraftBukkit-Patches/0051-Prevent-Mineshaft-Saving.patch @@ -0,0 +1,22 @@ +From d1c933de9b89ebda7e58a6c6d717f8af7ef8cd0c Mon Sep 17 00:00:00 2001 +From: md_5 +Date: Fri, 13 Dec 2013 15:21:02 +1100 +Subject: [PATCH] Prevent Mineshaft Saving + + +diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java +index 4a4d2af..22d96e9 100644 +--- a/src/main/java/net/minecraft/server/StructureGenerator.java ++++ b/src/main/java/net/minecraft/server/StructureGenerator.java +@@ -198,7 +198,7 @@ public abstract class StructureGenerator extends WorldGenBase { + protected void a(World world) { + if (this.a == null) { + // Spigot Start +- if (world.spigotConfig.saveStructureInfo) { ++ if (world.spigotConfig.saveStructureInfo && !this.a().equals( "Mineshaft" )) { + this.a = (PersistentStructure) world.a(PersistentStructure.class, this.a()); + } else { + this.a = new PersistentStructure(this.a()); +-- +2.5.0 + diff --git a/CraftBukkit-Patches/0059-Log-Cause-of-Unexpected-Exceptions.patch b/CraftBukkit-Patches/0052-Log-Cause-of-Unexpected-Exceptions.patch similarity index 84% rename from CraftBukkit-Patches/0059-Log-Cause-of-Unexpected-Exceptions.patch rename to CraftBukkit-Patches/0052-Log-Cause-of-Unexpected-Exceptions.patch index 01cdd40b59..66c1de565d 100644 --- a/CraftBukkit-Patches/0059-Log-Cause-of-Unexpected-Exceptions.patch +++ b/CraftBukkit-Patches/0052-Log-Cause-of-Unexpected-Exceptions.patch @@ -1,14 +1,14 @@ -From 6a7da9b465c656b8c77602d8180a707c5e3349c6 Mon Sep 17 00:00:00 2001 +From 2a2925c6b015c6423b77e307fde7646c5d3012c0 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 18 Dec 2013 13:39:14 +1100 Subject: [PATCH] Log Cause of Unexpected Exceptions diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index cdf7e0a..0637df9 100644 +index 8602ac6..0aab39b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -547,6 +547,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -544,6 +544,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs } } catch (Throwable throwable) { MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable); @@ -22,5 +22,5 @@ index cdf7e0a..0637df9 100644 if (throwable instanceof ReportedException) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0052-Orebfuscator.patch b/CraftBukkit-Patches/0052-Orebfuscator.patch deleted file mode 100644 index a83ac8cbbf..0000000000 --- a/CraftBukkit-Patches/0052-Orebfuscator.patch +++ /dev/null @@ -1,414 +0,0 @@ -From e298bca4fcf0fbf6cf2f63ca2b43e4815b72bce5 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Thu, 16 May 2013 18:51:05 +1000 -Subject: [PATCH] Orebfuscator - - -diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 9e0d5ad..ce91553 100644 ---- a/src/main/java/net/minecraft/server/EntityFallingBlock.java -+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java -@@ -60,6 +60,7 @@ public class EntityFallingBlock extends Entity { - blockposition = new BlockPosition(this); - if (this.world.getType(blockposition).getBlock() == block && !CraftEventFactory.callEntityChangeBlockEvent(this, blockposition.getX(), blockposition.getY(), blockposition.getZ(), Blocks.AIR, 0).isCancelled()) { - this.world.setAir(blockposition); -+ world.spigotConfig.antiXrayInstance.updateNearbyBlocks(world, blockposition); // Spigot - } else if (!this.world.isClientSide) { - this.die(); - return; -@@ -85,6 +86,7 @@ public class EntityFallingBlock extends Entity { - return; - } - this.world.setTypeAndData(blockposition, this.block, 3); -+ world.spigotConfig.antiXrayInstance.updateNearbyBlocks(world, blockposition); // Spigot - // CraftBukkit end - if (block instanceof BlockFalling) { - ((BlockFalling) block).a_(this.world, blockposition); -diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 23f852e..c41b911 100644 ---- a/src/main/java/net/minecraft/server/Explosion.java -+++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -211,6 +211,7 @@ public class Explosion { - blockposition = (BlockPosition) iterator.next(); - Block block = this.world.getType(blockposition).getBlock(); - -+ world.spigotConfig.antiXrayInstance.updateNearbyBlocks(world, blockposition); // Spigot - if (flag) { - double d0 = (double) ((float) blockposition.getX() + this.world.random.nextFloat()); - double d1 = (double) ((float) blockposition.getY() + this.world.random.nextFloat()); -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 6e368f5..58c0275 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -@@ -19,6 +19,7 @@ public class PacketPlayOutMapChunk implements Packet { - this.b = chunk.locZ; - this.d = flag; - this.c = a(chunk, flag, !chunk.getWorld().worldProvider.o(), i); -+ chunk.world.spigotConfig.antiXrayInstance.obfuscateSync(chunk.locX, chunk.locZ, c.b, c.a, chunk.world); - } - - public void a(PacketDataSerializer packetdataserializer) throws IOException { -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java -index 63b90f7..10c0e34 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java -+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java -@@ -9,6 +9,7 @@ public class PacketPlayOutMapChunkBulk implements Packet - private int[] b; - private PacketPlayOutMapChunk.ChunkMap[] c; - private boolean d; -+ private World world; // Spigot - - public PacketPlayOutMapChunkBulk() {} - -@@ -28,7 +29,8 @@ public class PacketPlayOutMapChunkBulk implements Packet - this.b[j] = chunk.locZ; - this.c[j] = packetplayoutmapchunk_chunkmap; - } -- -+ -+ world = ((Chunk) list.get(0)).getWorld(); // Spigot - } - - public void a(PacketDataSerializer packetdataserializer) throws IOException { -@@ -68,6 +70,7 @@ public class PacketPlayOutMapChunkBulk implements Packet - } - - for (i = 0; i < this.a.length; ++i) { -+ world.spigotConfig.antiXrayInstance.obfuscate(this.a[i], this.b[i], this.c[i].b, this.c[i].a, world); // Spigot - packetdataserializer.writeBytes(this.c[i].a); - } - -diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index 58fd07d..33a0a09 100644 ---- a/src/main/java/net/minecraft/server/PlayerInteractManager.java -+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java -@@ -197,6 +197,7 @@ public class PlayerInteractManager { - } - - } -+ world.spigotConfig.antiXrayInstance.updateNearbyBlocks(world, blockposition); // Spigot - } - - public void a(BlockPosition blockposition) { -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b07b3db..2c5c6b0 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -497,6 +497,7 @@ public abstract class World implements IBlockAccess { - this.d(blockposition.up(), block); - this.d(blockposition.north(), block); - this.d(blockposition.south(), block); -+ spigotConfig.antiXrayInstance.updateNearbyBlocks(this, blockposition); // Spigot - } - - public void a(BlockPosition blockposition, Block block, EnumDirection enumdirection) { -@@ -722,9 +723,16 @@ public abstract class World implements IBlockAccess { - return this.worldProvider.p()[this.getLightLevel(blockposition)]; - } - -- public IBlockData getType(BlockPosition blockposition) { -+ // Spigot start -+ public IBlockData getType(BlockPosition blockposition) -+ { -+ return getType( blockposition, true ); -+ } -+ -+ public IBlockData getType(BlockPosition blockposition, boolean useCaptured) { - // CraftBukkit start - tree generation -- if (captureTreeGeneration) { -+ if (captureTreeGeneration && useCaptured) { -+ // Spigot end - Iterator it = capturedBlockStates.iterator(); - while (it.hasNext()) { - BlockState previous = it.next(); -diff --git a/src/main/java/org/spigotmc/AntiXray.java b/src/main/java/org/spigotmc/AntiXray.java -new file mode 100644 -index 0000000..7221b50 ---- /dev/null -+++ b/src/main/java/org/spigotmc/AntiXray.java -@@ -0,0 +1,234 @@ -+package org.spigotmc; -+ -+import gnu.trove.set.TByteSet; -+import gnu.trove.set.hash.TByteHashSet; -+import net.minecraft.server.Block; -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.Blocks; -+import net.minecraft.server.World; -+import org.bukkit.craftbukkit.util.CraftMagicNumbers; -+ -+public class AntiXray -+{ -+ -+ private static final CustomTimingsHandler update = new CustomTimingsHandler( "xray - update" ); -+ private static final CustomTimingsHandler obfuscate = new CustomTimingsHandler( "xray - obfuscate" ); -+ /*========================================================================*/ -+ // Used to keep track of which blocks to obfuscate -+ private final boolean[] obfuscateBlocks = new boolean[ Short.MAX_VALUE ]; -+ // Used to select a random replacement ore -+ private final byte[] replacementOres; -+ -+ public AntiXray(SpigotWorldConfig config) -+ { -+ // Set all listed blocks as true to be obfuscated -+ for ( int id : ( config.engineMode == 1 ) ? config.hiddenBlocks : config.replaceBlocks ) -+ { -+ obfuscateBlocks[id] = true; -+ } -+ -+ // For every block -+ TByteSet blocks = new TByteHashSet(); -+ for ( Integer i : config.hiddenBlocks ) -+ { -+ Block block = Block.getById( i ); -+ // Check it exists and is not a tile entity -+ if ( block != null && !block.isTileEntity() ) -+ { -+ // Add it to the set of replacement blocks -+ blocks.add( (byte) (int) i ); -+ } -+ } -+ // Bake it to a flat array of replacements -+ replacementOres = blocks.toArray(); -+ } -+ -+ /** -+ * Starts the timings handler, then updates all blocks within the set radius -+ * of the given coordinate, revealing them if they are hidden ores. -+ */ -+ public void updateNearbyBlocks(World world, BlockPosition position) -+ { -+ if ( world.spigotConfig.antiXray ) -+ { -+ update.startTiming(); -+ updateNearbyBlocks( world, position, 2, false ); // 2 is the radius, we shouldn't change it as that would make it exponentially slower -+ update.stopTiming(); -+ } -+ } -+ -+ /** -+ * Starts the timings handler, and then removes all non exposed ores from -+ * the chunk buffer. -+ */ -+ public void obfuscateSync(int chunkX, int chunkY, int bitmask, byte[] buffer, World world) -+ { -+ if ( world.spigotConfig.antiXray ) -+ { -+ obfuscate.startTiming(); -+ obfuscate( chunkX, chunkY, bitmask, buffer, world ); -+ obfuscate.stopTiming(); -+ } -+ } -+ -+ /** -+ * Removes all non exposed ores from the chunk buffer. -+ */ -+ public void obfuscate(int chunkX, int chunkY, int bitmask, byte[] buffer, World world) -+ { -+ // If the world is marked as obfuscated -+ if ( world.spigotConfig.antiXray ) -+ { -+ // Initial radius to search around for air -+ int initialRadius = 1; -+ // Which block in the buffer we are looking at, anywhere from 0 to 16^4 -+ int index = 0; -+ // The iterator marking which random ore we should use next -+ int randomOre = 0; -+ -+ // Chunk corner X and Z blocks -+ int startX = chunkX << 4; -+ int startZ = chunkY << 4; -+ -+ byte replaceWithTypeId; -+ switch ( world.getWorld().getEnvironment() ) -+ { -+ case NETHER: -+ replaceWithTypeId = (byte) CraftMagicNumbers.getId(Blocks.NETHERRACK); -+ break; -+ case THE_END: -+ replaceWithTypeId = (byte) CraftMagicNumbers.getId(Blocks.END_STONE); -+ break; -+ default: -+ replaceWithTypeId = (byte) CraftMagicNumbers.getId(Blocks.STONE); -+ break; -+ } -+ -+ // Chunks can have up to 16 sections -+ for ( int i = 0; i < 16; i++ ) -+ { -+ // If the bitmask indicates this chunk is sent... -+ if ( ( bitmask & 1 << i ) != 0 ) -+ { -+ // Work through all blocks in the chunk, y,z,x -+ for ( int y = 0; y < 16; y++ ) -+ { -+ for ( int z = 0; z < 16; z++ ) -+ { -+ for ( int x = 0; x < 16; x++ ) -+ { -+ // For some reason we can get too far ahead of ourselves (concurrent modification on bulk chunks?) so if we do, just abort and move on -+ if ( index >= buffer.length ) -+ { -+ index++; -+ continue; -+ } -+ // Grab the block ID in the buffer. -+ // TODO: extended IDs are not yet supported -+ int blockId = (buffer[index << 1] & 0xFF) -+ | ((buffer[(index << 1) + 1] & 0xFF) << 8); -+ blockId >>>= 4; -+ // Check if the block should be obfuscated -+ if ( obfuscateBlocks[blockId] ) -+ { -+ // The world isn't loaded, bail out -+ if ( !isLoaded( world, new BlockPosition( startX + x, ( i << 4 ) + y, startZ + z ), initialRadius ) ) -+ { -+ index++; -+ continue; -+ } -+ // On the otherhand, if radius is 0, or the nearby blocks are all non air, we can obfuscate -+ if ( !hasTransparentBlockAdjacent( world, new BlockPosition( startX + x, ( i << 4 ) + y, startZ + z ), initialRadius ) ) -+ { -+ int newId = blockId; -+ switch ( world.spigotConfig.engineMode ) -+ { -+ case 1: -+ // Replace with replacement material -+ newId = replaceWithTypeId & 0xFF; -+ break; -+ case 2: -+ // Replace with random ore. -+ if ( randomOre >= replacementOres.length ) -+ { -+ randomOre = 0; -+ } -+ newId = replacementOres[randomOre++] & 0xFF; -+ break; -+ } -+ newId <<= 4; -+ buffer[index << 1] = (byte) (newId & 0xFF); -+ buffer[(index << 1) + 1] = (byte) ((newId >> 8) & 0xFF); -+ } -+ } -+ -+ index++; -+ } -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ private void updateNearbyBlocks(World world, BlockPosition position, int radius, boolean updateSelf) -+ { -+ // If the block in question is loaded -+ if ( world.isLoaded( position ) ) -+ { -+ // Get block id -+ Block block = world.getType(position).getBlock(); -+ -+ // See if it needs update -+ if ( updateSelf && obfuscateBlocks[Block.getId( block )] ) -+ { -+ // Send the update -+ world.notify( position ); -+ } -+ -+ // Check other blocks for updates -+ if ( radius > 0 ) -+ { -+ updateNearbyBlocks( world, position.east(), radius - 1, true ); -+ updateNearbyBlocks( world, position.west(), radius - 1, true ); -+ updateNearbyBlocks( world, position.up(), radius - 1, true ); -+ updateNearbyBlocks( world, position.down(), radius - 1, true ); -+ updateNearbyBlocks( world, position.south(), radius - 1, true ); -+ updateNearbyBlocks( world, position.north(), radius - 1, true ); -+ } -+ } -+ } -+ -+ private static boolean isLoaded(World world, BlockPosition position, int radius) -+ { -+ return world.isLoaded( position ) -+ && ( radius == 0 || -+ ( isLoaded( world, position.east(), radius - 1 ) -+ && isLoaded( world, position.west(), radius - 1 ) -+ && isLoaded( world, position.up(), radius - 1 ) -+ && isLoaded( world, position.down(), radius - 1 ) -+ && isLoaded( world, position.south(), radius - 1 ) -+ && isLoaded( world, position.north(), radius - 1 ) ) ); -+ } -+ -+ private static boolean hasTransparentBlockAdjacent(World world, BlockPosition position, int radius) -+ { -+ return !isSolidBlock(world.getType(position, false).getBlock()) /* isSolidBlock */ -+ || ( radius > 0 -+ && ( hasTransparentBlockAdjacent( world, position.east(), radius - 1 ) -+ || hasTransparentBlockAdjacent( world, position.west(), radius - 1 ) -+ || hasTransparentBlockAdjacent( world, position.up(), radius - 1 ) -+ || hasTransparentBlockAdjacent( world, position.down(), radius - 1 ) -+ || hasTransparentBlockAdjacent( world, position.south(), radius - 1 ) -+ || hasTransparentBlockAdjacent( world, position.north(), radius - 1 ) ) ); -+ } -+ -+ private static boolean isSolidBlock(Block block) { -+ // Mob spawners are treated as solid blocks as far as the -+ // game is concerned for lighting and other tasks but for -+ // rendering they can be seen through therefor we special -+ // case them so that the antixray doesn't show the fake -+ // blocks around them. -+ return block.isOccluding() && block != Blocks.MOB_SPAWNER && block != Blocks.BARRIER; -+ } -+} -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index d8433ac..5d2b755 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -1,5 +1,6 @@ - package org.spigotmc; - -+import java.util.Arrays; - import java.util.List; - import org.bukkit.Bukkit; - import org.bukkit.configuration.file.YamlConfiguration; -@@ -214,4 +215,36 @@ public class SpigotWorldConfig - arrowDespawnRate = getInt( "arrow-despawn-rate", 1200 ); - log( "Arrow Despawn Rate: " + arrowDespawnRate ); - } -+ -+ public boolean antiXray; -+ public int engineMode; -+ public List hiddenBlocks; -+ public List replaceBlocks; -+ public AntiXray antiXrayInstance; -+ private void antiXray() -+ { -+ antiXray = getBoolean( "anti-xray.enabled", true ); -+ log( "Anti X-Ray: " + antiXray ); -+ -+ engineMode = getInt( "anti-xray.engine-mode", 1 ); -+ log( "\tEngine Mode: " + engineMode ); -+ -+ if ( SpigotConfig.version < 5 ) -+ { -+ set( "anti-xray.blocks", null ); -+ } -+ hiddenBlocks = getList( "anti-xray.hide-blocks", Arrays.asList( new Integer[] -+ { -+ 14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130 -+ } ) ); -+ log( "\tHidden Blocks: " + hiddenBlocks ); -+ -+ replaceBlocks = getList( "anti-xray.replace-blocks", Arrays.asList( new Integer[] -+ { -+ 1, 5 -+ } ) ); -+ log( "\tReplace Blocks: " + replaceBlocks ); -+ -+ antiXrayInstance = new AntiXray( this ); -+ } - } --- -2.1.4 - diff --git a/CraftBukkit-Patches/0053-Optimize-DataWatcher.patch b/CraftBukkit-Patches/0053-Optimize-DataWatcher.patch deleted file mode 100644 index 03e8c95aff..0000000000 --- a/CraftBukkit-Patches/0053-Optimize-DataWatcher.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 4e418f9a238858b1c13a6290ff5b667331073cb0 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Fri, 13 Dec 2013 11:45:47 +1100 -Subject: [PATCH] Optimize DataWatcher - -Use primitive orientated collections, as well as more effective copies across collections. - -diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java -index 2bf9196..aa46c28 100644 ---- a/src/main/java/net/minecraft/server/DataWatcher.java -+++ b/src/main/java/net/minecraft/server/DataWatcher.java -@@ -15,8 +15,13 @@ public class DataWatcher { - - private final Entity a; - private boolean b = true; -- private static final Map, Integer> c = Maps.newHashMap(); -- private final Map d = Maps.newHashMap(); -+ // Spigot Start -+ private static final gnu.trove.map.TObjectIntMap classToId = new gnu.trove.map.hash.TObjectIntHashMap( 10, 0.5f, -1 ); -+ private final gnu.trove.map.TIntObjectMap dataValues = new gnu.trove.map.hash.TIntObjectHashMap( 10, 0.5f, -1 ); -+ // These exist as an attempt at backwards compatability for (broken) NMS plugins -+ private static final Map, Integer> c = gnu.trove.TDecorators.wrap( classToId ); -+ private final Map d = gnu.trove.TDecorators.wrap( dataValues ); -+ // Spigot End - private boolean e; - private ReadWriteLock f = new ReentrantReadWriteLock(); - -@@ -25,19 +30,19 @@ public class DataWatcher { - } - - public void a(int i, T t0) { -- Integer integer = (Integer) DataWatcher.c.get(t0.getClass()); -+ int integer = classToId.get(t0.getClass()); // Spigot - -- if (integer == null) { -+ if (integer == -1) { // Spigot - throw new IllegalArgumentException("Unknown data type: " + t0.getClass()); - } else if (i > 31) { - throw new IllegalArgumentException("Data value id is too big with " + i + "! (Max is " + 31 + ")"); -- } else if (this.d.containsKey(Integer.valueOf(i))) { -+ } else if (this.dataValues.containsKey(i)) { // Spigot - throw new IllegalArgumentException("Duplicate id value for " + i + "!"); - } else { -- DataWatcher.WatchableObject datawatcher_watchableobject = new DataWatcher.WatchableObject(integer.intValue(), i, t0); -+ DataWatcher.WatchableObject datawatcher_watchableobject = new DataWatcher.WatchableObject(integer, i, t0); // Spigot - - this.f.writeLock().lock(); -- this.d.put(Integer.valueOf(i), datawatcher_watchableobject); -+ this.dataValues.put(i, datawatcher_watchableobject); // Spigot - this.f.writeLock().unlock(); - this.b = false; - } -@@ -47,7 +52,7 @@ public class DataWatcher { - DataWatcher.WatchableObject datawatcher_watchableobject = new DataWatcher.WatchableObject(j, i, (Object) null); - - this.f.writeLock().lock(); -- this.d.put(Integer.valueOf(i), datawatcher_watchableobject); -+ this.dataValues.put(i, datawatcher_watchableobject); // Spigot - this.f.writeLock().unlock(); - this.b = false; - } -@@ -82,7 +87,7 @@ public class DataWatcher { - DataWatcher.WatchableObject datawatcher_watchableobject; - - try { -- datawatcher_watchableobject = (DataWatcher.WatchableObject) this.d.get(Integer.valueOf(i)); -+ datawatcher_watchableobject = (DataWatcher.WatchableObject) this.dataValues.get(i); // Spigot - } catch (Throwable throwable) { - CrashReport crashreport = CrashReport.a(throwable, "Getting synched entity data"); - CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Synched entity data"); -@@ -139,7 +144,7 @@ public class DataWatcher { - - if (this.e) { - this.f.readLock().lock(); -- Iterator iterator = this.d.values().iterator(); -+ Iterator iterator = this.dataValues.valueCollection().iterator(); // Spigot - - while (iterator.hasNext()) { - DataWatcher.WatchableObject datawatcher_watchableobject = (DataWatcher.WatchableObject) iterator.next(); -@@ -163,7 +168,7 @@ public class DataWatcher { - - public void a(PacketDataSerializer packetdataserializer) throws IOException { - this.f.readLock().lock(); -- Iterator iterator = this.d.values().iterator(); -+ Iterator iterator = this.dataValues.valueCollection().iterator(); // Spigot - - while (iterator.hasNext()) { - DataWatcher.WatchableObject datawatcher_watchableobject = (DataWatcher.WatchableObject) iterator.next(); -@@ -176,18 +181,11 @@ public class DataWatcher { - } - - public List c() { -- ArrayList arraylist = null; -+ ArrayList arraylist = Lists.newArrayList(); // Spigot - - this.f.readLock().lock(); - -- DataWatcher.WatchableObject datawatcher_watchableobject; -- -- for (Iterator iterator = this.d.values().iterator(); iterator.hasNext(); arraylist.add(datawatcher_watchableobject)) { -- datawatcher_watchableobject = (DataWatcher.WatchableObject) iterator.next(); -- if (arraylist == null) { -- arraylist = Lists.newArrayList(); -- } -- } -+ arraylist.addAll(this.dataValues.valueCollection()); // Spigot - - this.f.readLock().unlock(); - return arraylist; -@@ -310,14 +308,16 @@ public class DataWatcher { - } - - static { -- DataWatcher.c.put(Byte.class, Integer.valueOf(0)); -- DataWatcher.c.put(Short.class, Integer.valueOf(1)); -- DataWatcher.c.put(Integer.class, Integer.valueOf(2)); -- DataWatcher.c.put(Float.class, Integer.valueOf(3)); -- DataWatcher.c.put(String.class, Integer.valueOf(4)); -- DataWatcher.c.put(ItemStack.class, Integer.valueOf(5)); -- DataWatcher.c.put(BlockPosition.class, Integer.valueOf(6)); -- DataWatcher.c.put(Vector3f.class, Integer.valueOf(7)); -+ // Spigot Start - remove valueOf -+ classToId.put(Byte.class, 0); -+ classToId.put(Short.class, 1); -+ classToId.put(Integer.class, 2); -+ classToId.put(Float.class, 3); -+ classToId.put(String.class, 4); -+ classToId.put(ItemStack.class, 5); -+ classToId.put(BlockPosition.class, 6); -+ classToId.put(Vector3f.class, 7); -+ // Spigot End - } - - public static class WatchableObject { --- -2.1.4 - diff --git a/CraftBukkit-Patches/0060-Particle-API.patch b/CraftBukkit-Patches/0053-Particle-API.patch similarity index 96% rename from CraftBukkit-Patches/0060-Particle-API.patch rename to CraftBukkit-Patches/0053-Particle-API.patch index d4ecdb3d6a..33ac560242 100644 --- a/CraftBukkit-Patches/0060-Particle-API.patch +++ b/CraftBukkit-Patches/0053-Particle-API.patch @@ -1,4 +1,4 @@ -From bf78106f695dd8d9f1c06e7af4eb466e3350220a Mon Sep 17 00:00:00 2001 +From d2d688e7e76a2711493cef900b44f251875f6692 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Fri, 20 Dec 2013 21:36:06 +0000 Subject: [PATCH] Particle API @@ -19,10 +19,10 @@ index 7de0de5..13f9e9d 100644 datavalue = 0; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index fc2a1ab..20e2416 100644 +index 2b6928f..84b6e41 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -836,28 +836,18 @@ public class CraftWorld implements World { +@@ -828,28 +828,18 @@ public class CraftWorld implements World { Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!"); } @@ -60,7 +60,7 @@ index fc2a1ab..20e2416 100644 } public T spawn(Location location, Class clazz) throws IllegalArgumentException { -@@ -1388,6 +1378,70 @@ public class CraftWorld implements World { +@@ -1459,6 +1449,70 @@ public class CraftWorld implements World { // Spigot start private final Spigot spigot = new Spigot() { @@ -132,10 +132,10 @@ index fc2a1ab..20e2416 100644 public Spigot spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 39a73bd..499c6d2 100644 +index 1f11c9d..30cef72 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -318,9 +318,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -319,9 +319,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void playEffect(Location loc, Effect effect, int data) { if (getHandle().playerConnection == null) return; @@ -146,7 +146,7 @@ index 39a73bd..499c6d2 100644 } @Override -@@ -1373,6 +1371,63 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1439,6 +1437,63 @@ public class CraftPlayer extends CraftHumanEntity implements Player { server.getServer().getPlayerList().moveToWorld( getHandle(), 0, false ); } } @@ -211,5 +211,5 @@ index 39a73bd..499c6d2 100644 public Player.Spigot spigot() -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0061-Save-ticks-lived-to-nbttag.patch b/CraftBukkit-Patches/0054-Save-ticks-lived-to-nbttag.patch similarity index 81% rename from CraftBukkit-Patches/0061-Save-ticks-lived-to-nbttag.patch rename to CraftBukkit-Patches/0054-Save-ticks-lived-to-nbttag.patch index 21efc5380a..e5fe68ded8 100644 --- a/CraftBukkit-Patches/0061-Save-ticks-lived-to-nbttag.patch +++ b/CraftBukkit-Patches/0054-Save-ticks-lived-to-nbttag.patch @@ -1,22 +1,22 @@ -From 2952e571862ec9c07862a9bab3409cad2493f4ea Mon Sep 17 00:00:00 2001 +From f788b71da021723020948f5fc4bf3f4607f16570 Mon Sep 17 00:00:00 2001 From: DerFlash Date: Tue, 9 Jul 2013 00:11:12 +0200 Subject: [PATCH] Save ticks lived to nbttag diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index bf3ce15..b96c6d6 100644 +index 1eec160..5955732 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1192,6 +1192,7 @@ public abstract class Entity implements ICommandListener { +@@ -1292,6 +1292,7 @@ public abstract class Entity implements ICommandListener { nbttagcompound.setLong("WorldUUIDLeast", this.world.getDataManager().getUUID().getLeastSignificantBits()); nbttagcompound.setLong("WorldUUIDMost", this.world.getDataManager().getUUID().getMostSignificantBits()); nbttagcompound.setInt("Bukkit.updateLevel", CURRENT_LEVEL); + nbttagcompound.setInt("Spigot.ticksLived", this.ticksLived); // CraftBukkit end - if (this.getCustomName() != null && this.getCustomName().length() > 0) { + if (this.getCustomName() != null && !this.getCustomName().isEmpty()) { nbttagcompound.setString("CustomName", this.getCustomName()); -@@ -1283,6 +1284,8 @@ public abstract class Entity implements ICommandListener { +@@ -1428,6 +1429,8 @@ public abstract class Entity implements ICommandListener { if (this instanceof EntityLiving) { EntityLiving entity = (EntityLiving) this; @@ -26,5 +26,5 @@ index bf3ce15..b96c6d6 100644 if (entity instanceof EntityTameableAnimal && !isLevelAtLeast(nbttagcompound, 2) && !nbttagcompound.getBoolean("PersistenceRequired")) { EntityInsentient entityinsentient = (EntityInsentient) entity; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0063-Add-Option-to-Nerf-Mobs-from-Spawner-s.patch b/CraftBukkit-Patches/0055-Add-Option-to-Nerf-Mobs-from-Spawner-s.patch similarity index 61% rename from CraftBukkit-Patches/0063-Add-Option-to-Nerf-Mobs-from-Spawner-s.patch rename to CraftBukkit-Patches/0055-Add-Option-to-Nerf-Mobs-from-Spawner-s.patch index 7884f679ca..b0c635b945 100644 --- a/CraftBukkit-Patches/0063-Add-Option-to-Nerf-Mobs-from-Spawner-s.patch +++ b/CraftBukkit-Patches/0055-Add-Option-to-Nerf-Mobs-from-Spawner-s.patch @@ -1,14 +1,14 @@ -From 3f74786e9e903c56de3e8cde33ae1a7bf1f14707 Mon Sep 17 00:00:00 2001 +From f5654f47ab5ba129f0337f5e00bc5f5e46beeb29 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 2 Feb 2014 16:55:46 +0000 Subject: [PATCH] Add Option to Nerf Mobs from Spawner's diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b96c6d6..027b1f1 100644 +index 5955732..eb552e2 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -121,6 +121,7 @@ public abstract class Entity implements ICommandListener { +@@ -145,6 +145,7 @@ public abstract class Entity implements ICommandListener { public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; public long activatedTick = Integer.MIN_VALUE; @@ -17,12 +17,12 @@ index b96c6d6..027b1f1 100644 // Spigot end diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 0608c3f..a8a327d 100644 +index ba69133..7d4bb9f 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -457,6 +457,12 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -626,6 +626,12 @@ public abstract class EntityInsentient extends EntityLiving { this.world.methodProfiler.a("checkDespawn"); - this.D(); + this.L(); this.world.methodProfiler.b(); + // Spigot Start + if ( this.fromMobSpawner ) @@ -31,43 +31,31 @@ index 0608c3f..a8a327d 100644 + } + // Spigot End this.world.methodProfiler.a("sensing"); - this.bk.a(); + this.bu.a(); this.world.methodProfiler.b(); diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 35ed213..6004e23 100644 +index 01cbd71..efe792b 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -144,6 +144,12 @@ public abstract class MobSpawnerAbstract { - SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b().getX(), this.b().getY(), this.b().getZ()); - if (!event.isCancelled()) { - entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit -+ // Spigot Start -+ if ( entity.world.spigotConfig.nerfSpawnerMobs ) -+ { -+ entity.fromMobSpawner = true; -+ } -+ // Spigot End - } - // CraftBukkit end - } -@@ -191,6 +197,12 @@ public abstract class MobSpawnerAbstract { - SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b().getX(), this.b().getY(), this.b().getZ()); - if (!event.isCancelled()) { - entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit +@@ -94,7 +94,12 @@ public abstract class MobSpawnerAbstract { + if (this.spawnData.b().d() == 1 && this.spawnData.b().hasKeyOfType("id", 8) && entity instanceof EntityInsentient) { + ((EntityInsentient) entity).prepare(world.D(new BlockPosition(entity)), (GroupDataEntity) null); + } +- + // Spigot Start + if ( entity.world.spigotConfig.nerfSpawnerMobs ) + { + entity.fromMobSpawner = true; + } + // Spigot End - } - // Spigot end - } + ChunkRegionLoader.a(entity, world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit + world.triggerEffect(2004, blockposition, 0); + if (entityinsentient != null) { diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index f6fc0a2..20800ed 100644 +index 6df2186..3854195 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -254,4 +254,11 @@ public class SpigotWorldConfig +@@ -210,4 +210,11 @@ public class SpigotWorldConfig zombieAggressiveTowardsVillager = getBoolean( "zombie-aggressive-towards-villager", true ); log( "Zombie Aggressive Towards Villager: " + zombieAggressiveTowardsVillager ); } @@ -80,5 +68,5 @@ index f6fc0a2..20800ed 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0064-Warn-if-PermGen-may-be-insufficient.patch b/CraftBukkit-Patches/0056-Warn-if-PermGen-may-be-insufficient.patch similarity index 96% rename from CraftBukkit-Patches/0064-Warn-if-PermGen-may-be-insufficient.patch rename to CraftBukkit-Patches/0056-Warn-if-PermGen-may-be-insufficient.patch index bc30c098e8..a48507b47c 100644 --- a/CraftBukkit-Patches/0064-Warn-if-PermGen-may-be-insufficient.patch +++ b/CraftBukkit-Patches/0056-Warn-if-PermGen-may-be-insufficient.patch @@ -1,4 +1,4 @@ -From fffa67446ecf4048eb314ed7abd8758a7287daa4 Mon Sep 17 00:00:00 2001 +From fdb8e3f808c10f65cb25429e7885b742becc6582 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 23 Dec 2013 14:07:41 +1100 Subject: [PATCH] Warn if PermGen may be insufficient @@ -32,5 +32,5 @@ index aca0d97..337aa29 100644 MinecraftServer.main(options); } catch (Throwable t) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0065-Disable-Connected-Check-on-setScoreboard.patch b/CraftBukkit-Patches/0057-Disable-Connected-Check-on-setScoreboard.patch similarity index 85% rename from CraftBukkit-Patches/0065-Disable-Connected-Check-on-setScoreboard.patch rename to CraftBukkit-Patches/0057-Disable-Connected-Check-on-setScoreboard.patch index 0fb8a908b2..ad347fe2dd 100644 --- a/CraftBukkit-Patches/0065-Disable-Connected-Check-on-setScoreboard.patch +++ b/CraftBukkit-Patches/0057-Disable-Connected-Check-on-setScoreboard.patch @@ -1,14 +1,14 @@ -From 9bacce598c5544cba0339a9ff3da446c4a8d4a3c Mon Sep 17 00:00:00 2001 +From 92ea11e122a121b244220db0d91cbfbfac386e20 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 23 Dec 2013 15:57:57 +1100 Subject: [PATCH] Disable Connected Check on setScoreboard diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 499c6d2..9998ed8 100644 +index 30cef72..7c9f8e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1237,7 +1237,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1238,7 +1238,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { throw new IllegalStateException("Cannot set scoreboard yet"); } if (playerConnection.isDisconnected()) { @@ -18,5 +18,5 @@ index 499c6d2..9998ed8 100644 this.server.getScoreboardManager().setPlayerBoard(this, scoreboard); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0066-Add-Late-Bind-Option.patch b/CraftBukkit-Patches/0058-Add-Late-Bind-Option.patch similarity index 80% rename from CraftBukkit-Patches/0066-Add-Late-Bind-Option.patch rename to CraftBukkit-Patches/0058-Add-Late-Bind-Option.patch index 7212a50391..3a79a43143 100644 --- a/CraftBukkit-Patches/0066-Add-Late-Bind-Option.patch +++ b/CraftBukkit-Patches/0058-Add-Late-Bind-Option.patch @@ -1,4 +1,4 @@ -From ab7f3c1ab5d1c13a9f0a95e347bd9be9b499af54 Mon Sep 17 00:00:00 2001 +From 07a28ec70f33b9e7b16d76f412bf06d060c8f191 Mon Sep 17 00:00:00 2001 From: slide23 Date: Fri, 20 Dec 2013 20:15:33 -0600 Subject: [PATCH] Add Late Bind Option @@ -6,18 +6,18 @@ Subject: [PATCH] Add Late Bind Option Add late-bind config option to delay binding until loading is done. diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index be30d17..8801164 100644 +index 93ace97..852f8b4 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -173,6 +173,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -176,6 +176,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer this.a(MinecraftEncryption.b()); - DedicatedServer.LOGGER.info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.R()); + DedicatedServer.LOGGER.info("Starting Minecraft server on " + (this.getServerIp().isEmpty() ? "*" : this.getServerIp()) + ":" + this.P()); + if (!org.spigotmc.SpigotConfig.lateBind) { try { - this.aq().a(inetaddress, this.R()); + this.am().a(inetaddress, this.P()); } catch (IOException ioexception) { -@@ -181,6 +182,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -184,6 +185,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer DedicatedServer.LOGGER.warn("Perhaps a server is already running on that port?"); return false; } @@ -25,13 +25,13 @@ index be30d17..8801164 100644 // Spigot Start - Move DedicatedPlayerList up and bring plugin loading from CraftServer to here // this.a((PlayerList) (new DedicatedPlayerList(this))); // CraftBukkit -@@ -270,6 +272,17 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -276,6 +278,17 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } // CraftBukkit end + if (org.spigotmc.SpigotConfig.lateBind) { + try { -+ this.aq().a(inetaddress, this.R()); ++ this.am().a(inetaddress, this.P()); + } catch (IOException ioexception) { + DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!"); + DedicatedServer.LOGGER.warn("The exception was: {}", new Object[] { ioexception.toString()}); @@ -40,7 +40,7 @@ index be30d17..8801164 100644 + } + } + - if (false && this.aS() > 0L) { // Spigot - disable + if (false && this.aP() > 0L) { // Spigot - disable Thread thread1 = new Thread(new ThreadWatchdog(this)); diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java @@ -58,5 +58,5 @@ index a306266..4edc6af 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0058-Prevent-Mineshaft-Saving.patch b/CraftBukkit-Patches/0058-Prevent-Mineshaft-Saving.patch deleted file mode 100644 index c4b142a5f8..0000000000 --- a/CraftBukkit-Patches/0058-Prevent-Mineshaft-Saving.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 352eba0eb3c150efd3233443ec6eb2d5deaa9d83 Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Fri, 13 Dec 2013 15:21:02 +1100 -Subject: [PATCH] Prevent Mineshaft Saving - - -diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index bb1a11e..0f8211a 100644 ---- a/src/main/java/net/minecraft/server/StructureGenerator.java -+++ b/src/main/java/net/minecraft/server/StructureGenerator.java -@@ -196,7 +196,7 @@ public abstract class StructureGenerator extends WorldGenBase { - private void a(World world) { - if (this.d == null) { - // Spigot Start -- if ( world.spigotConfig.saveStructureInfo ) -+ if ( world.spigotConfig.saveStructureInfo && !this.a().equals( "Mineshaft" ) ) - { - this.d = (PersistentStructure) world.a(PersistentStructure.class, this.a()); - } else --- -2.1.4 - diff --git a/CraftBukkit-Patches/0067-Allow-statistics-to-be-disabled-forced.patch b/CraftBukkit-Patches/0059-Allow-statistics-to-be-disabled-forced.patch similarity index 97% rename from CraftBukkit-Patches/0067-Allow-statistics-to-be-disabled-forced.patch rename to CraftBukkit-Patches/0059-Allow-statistics-to-be-disabled-forced.patch index 30b2bf56e5..097e66141e 100644 --- a/CraftBukkit-Patches/0067-Allow-statistics-to-be-disabled-forced.patch +++ b/CraftBukkit-Patches/0059-Allow-statistics-to-be-disabled-forced.patch @@ -1,11 +1,11 @@ -From d3e32f4d2fa2684eb2942b93b4bcfb237056915b Mon Sep 17 00:00:00 2001 +From c15db6fb5a3859e3b1423257eb673310e2a6e7a3 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Tue, 7 Jan 2014 15:56:26 +0000 Subject: [PATCH] Allow statistics to be disabled/forced diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java -index 46845cd..22c2ffd 100644 +index 76bd9c1..a08eb77 100644 --- a/src/main/java/net/minecraft/server/ServerStatisticManager.java +++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java @@ -31,6 +31,14 @@ public class ServerStatisticManager extends StatisticManager { @@ -89,5 +89,5 @@ index 4edc6af..a2be9df 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0068-Fix-ItemStack-Unbreakable-Code.patch b/CraftBukkit-Patches/0060-Fix-ItemStack-Unbreakable-Code.patch similarity index 84% rename from CraftBukkit-Patches/0068-Fix-ItemStack-Unbreakable-Code.patch rename to CraftBukkit-Patches/0060-Fix-ItemStack-Unbreakable-Code.patch index 9c12344369..5f5b4ea803 100644 --- a/CraftBukkit-Patches/0068-Fix-ItemStack-Unbreakable-Code.patch +++ b/CraftBukkit-Patches/0060-Fix-ItemStack-Unbreakable-Code.patch @@ -1,14 +1,14 @@ -From 3133f7ad7c02420bd68fbc080d70da3144d506cb Mon Sep 17 00:00:00 2001 +From dae46463bd9260d31d69fd7f581933bd54aa7c41 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 10 Jan 2014 15:15:50 +1100 Subject: [PATCH] Fix ItemStack Unbreakable Code diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index b722be5..6808a46 100644 +index acc5bd2..3d02391 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -287,7 +287,13 @@ public final class ItemStack { +@@ -283,7 +283,13 @@ public final class ItemStack { } public boolean e() { @@ -24,5 +24,5 @@ index b722be5..6808a46 100644 public boolean usesData() { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0069-Try-and-Debug-Crash-Reports-Crashing.patch b/CraftBukkit-Patches/0061-Try-and-Debug-Crash-Reports-Crashing.patch similarity index 88% rename from CraftBukkit-Patches/0069-Try-and-Debug-Crash-Reports-Crashing.patch rename to CraftBukkit-Patches/0061-Try-and-Debug-Crash-Reports-Crashing.patch index 8a97c7718b..784ea9fdeb 100644 --- a/CraftBukkit-Patches/0069-Try-and-Debug-Crash-Reports-Crashing.patch +++ b/CraftBukkit-Patches/0061-Try-and-Debug-Crash-Reports-Crashing.patch @@ -1,14 +1,14 @@ -From bf215730a200db2cd4d457d58b1d310e72174209 Mon Sep 17 00:00:00 2001 +From b48d48b32f53d99a57e02f5c1f01a4a55a3036d2 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 0637df9..db360fb 100644 +index 0aab39b..49524b1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -742,7 +742,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -743,7 +743,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs worldserver.doTick(); worldserver.timings.doTick.stopTiming(); // Spigot } catch (Throwable throwable) { @@ -22,7 +22,7 @@ index 0637df9..db360fb 100644 worldserver.a(crashreport); throw new ReportedException(crashreport); } -@@ -752,7 +758,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -753,7 +759,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs worldserver.tickEntities(); worldserver.timings.tickEntities.stopTiming(); // Spigot } catch (Throwable throwable1) { @@ -37,5 +37,5 @@ index 0637df9..db360fb 100644 throw new ReportedException(crashreport); } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0070-Improve-AutoSave-Mechanism.patch b/CraftBukkit-Patches/0062-Improve-AutoSave-Mechanism.patch similarity index 84% rename from CraftBukkit-Patches/0070-Improve-AutoSave-Mechanism.patch rename to CraftBukkit-Patches/0062-Improve-AutoSave-Mechanism.patch index c1cbf80fe6..30fc085b7d 100644 --- a/CraftBukkit-Patches/0070-Improve-AutoSave-Mechanism.patch +++ b/CraftBukkit-Patches/0062-Improve-AutoSave-Mechanism.patch @@ -1,4 +1,4 @@ -From 5d9662a42d3dfafe3ee455e83fdfc8cd6530d9f4 Mon Sep 17 00:00:00 2001 +From a80d57a9e6782a14b839f6fab8908a18377440f7 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 12 Jan 2014 21:07:18 +1100 Subject: [PATCH] Improve AutoSave Mechanism @@ -11,23 +11,23 @@ Instead we will mimic the save-all command in its behaviour, which is both safe Also, only save modified chunks, or chunks with entities after 4 auto save passes diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index f461f50..994903f 100644 +index 47ef0db..277a6ad 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -942,7 +942,7 @@ public class Chunk { - if (this.r && this.world.getTime() != this.lastSaved || this.q) { +@@ -875,7 +875,7 @@ public class Chunk { + if (this.s && this.world.getTime() != this.lastSaved || this.r) { return true; } -- } else if (this.r && this.world.getTime() >= this.lastSaved + 600L) { -+ } else if (this.r && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification +- } else if (this.s && this.world.getTime() >= this.lastSaved + 600L) { ++ } else if (this.s && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification return true; } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index af77eef..975d666 100644 +index 8f3cd56..fd3f457 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -323,7 +323,7 @@ public class ChunkProviderServer implements IChunkProvider { +@@ -257,7 +257,7 @@ public class ChunkProviderServer implements IChunkProvider { this.saveChunk(chunk); chunk.f(false); ++i; @@ -37,10 +37,10 @@ index af77eef..975d666 100644 } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index db360fb..b7ba79a 100644 +index 49524b1..254e4bd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -654,7 +654,17 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -655,7 +655,17 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs SpigotTimings.worldSaveTimer.startTiming(); // Spigot this.methodProfiler.a("save"); this.v.savePlayers(); @@ -60,10 +60,10 @@ index db360fb..b7ba79a 100644 SpigotTimings.worldSaveTimer.stopTiming(); // Spigot } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e0d2bfb..70912d6 100644 +index 84b6e41..2063185 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -740,12 +740,17 @@ public class CraftWorld implements World { +@@ -732,12 +732,17 @@ public class CraftWorld implements World { } public void save() { @@ -83,5 +83,5 @@ index e0d2bfb..70912d6 100644 world.savingDisabled = oldSave; } catch (ExceptionWorldConflict ex) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0062-More-Efficient-GetCubes.patch b/CraftBukkit-Patches/0062-More-Efficient-GetCubes.patch deleted file mode 100644 index ecbadf0f91..0000000000 --- a/CraftBukkit-Patches/0062-More-Efficient-GetCubes.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 6387a4ad1c7e96f16dc8e84eadeb9179f814c6ec Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Tue, 11 Jun 2013 12:17:37 +1000 -Subject: [PATCH] More Efficient GetCubes - - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2c5c6b0..a09de8e 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1104,28 +1104,56 @@ public abstract class World implements IBlockAccess { - IBlockData iblockdata = Blocks.STONE.getBlockData(); - BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); - -- for (int k1 = i; k1 < j; ++k1) { -- for (int l1 = i1; l1 < j1; ++l1) { -- if (this.isLoaded(blockposition_mutableblockposition.c(k1, 64, l1))) { -- for (int i2 = k - 1; i2 < l; ++i2) { -- blockposition_mutableblockposition.c(k1, i2, l1); -- if (flag && flag1) { -- entity.h(false); -- } else if (!flag && !flag1) { -- entity.h(true); -- } -- -- IBlockData iblockdata1 = iblockdata; -+ // Spigot start -+ int ystart = ( ( k - 1 ) < 0 ) ? 0 : ( k - 1 ); -+ for ( int chunkx = ( i >> 4 ); chunkx <= ( ( j - 1 ) >> 4 ); chunkx++ ) -+ { -+ int cx = chunkx << 4; -+ for ( int chunkz = ( i1 >> 4 ); chunkz <= ( ( j1 - 1 ) >> 4 ); chunkz++ ) -+ { -+ if ( !this.isChunkLoaded( chunkx, chunkz, true ) ) -+ { -+ continue; -+ } -+ int cz = chunkz << 4; -+ Chunk chunk = this.getChunkAt( chunkx, chunkz ); -+ // Compute ranges within chunk -+ int xstart = ( i < cx ) ? cx : i; -+ int xend = ( j < ( cx + 16 ) ) ? j : ( cx + 16 ); -+ int zstart = ( i1 < cz ) ? cz : i1; -+ int zend = ( j1 < ( cz + 16 ) ) ? j1 : ( cz + 16 ); -+ // Loop through blocks within chunk -+ for ( int x = xstart; x < xend; x++ ) -+ { -+ for ( int z = zstart; z < zend; z++ ) -+ { -+ for ( int y = ystart; y < l; y++ ) -+ { -+ BlockPosition blockposition = new BlockPosition( x, y, z ); -+ -+ if (flag && flag1) { -+ entity.h(false); -+ } else if (!flag && !flag1) { -+ entity.h(true); -+ } - -- if (worldborder.a((BlockPosition) blockposition_mutableblockposition) || !flag1) { -- iblockdata1 = this.getType(blockposition_mutableblockposition); -+ IBlockData block; -+ if (!this.getWorldBorder().a(blockposition) && flag1) { -+ block = Blocks.STONE.getBlockData(); -+ } else -+ { -+ block = chunk.getBlockData( blockposition ); -+ } -+ if ( block != null ) -+ { -+ block.getBlock().a(this, blockposition, block, axisalignedbb, arraylist, entity); -+ } - } -- -- iblockdata1.getBlock().a(this, blockposition_mutableblockposition, iblockdata1, axisalignedbb, arraylist, entity); - } - } - } - } -+ // Spigot end - - double d0 = 0.25D; - List list = this.getEntities(entity, axisalignedbb.grow(d0, d0, d0)); --- -2.1.4 - diff --git a/CraftBukkit-Patches/0071-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch b/CraftBukkit-Patches/0063-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch similarity index 95% rename from CraftBukkit-Patches/0071-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch rename to CraftBukkit-Patches/0063-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch index 4e508fecaa..50f3208cf0 100644 --- a/CraftBukkit-Patches/0071-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch +++ b/CraftBukkit-Patches/0063-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch @@ -1,4 +1,4 @@ -From cd2075b5bc30ca288ccac63f55c4f9dce31414d3 Mon Sep 17 00:00:00 2001 +From 8fb434691394ab4b9de38a4c61ecb5f5717a3449 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 20 Jan 2014 13:44:07 +1100 Subject: [PATCH] Catch stalling on corrupted map data / NBT arrays. @@ -29,5 +29,5 @@ index 5f17034..e206e50 100644 nbtreadlimiter.a((long) (32 * j)); this.data = new int[j]; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0072-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch b/CraftBukkit-Patches/0064-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch similarity index 87% rename from CraftBukkit-Patches/0072-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch rename to CraftBukkit-Patches/0064-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch index 03b0944f76..c8d6f69596 100644 --- a/CraftBukkit-Patches/0072-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch +++ b/CraftBukkit-Patches/0064-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch @@ -1,14 +1,14 @@ -From a7a8f2c276f387edd4dc0937db74731132124b99 Mon Sep 17 00:00:00 2001 +From 2aaf2dce8108cd38f4107ef765439502d8efb823 Mon Sep 17 00:00:00 2001 From: Dmck2b Date: Mon, 20 Jan 2014 20:18:23 +0000 Subject: [PATCH] Allow toggling of ZombiePigmen spawning in portal blocks diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java -index 030f4e9..4dc40eb 100644 +index 05f0719..d85335b 100644 --- a/src/main/java/net/minecraft/server/BlockPortal.java +++ b/src/main/java/net/minecraft/server/BlockPortal.java -@@ -18,7 +18,7 @@ public class BlockPortal extends BlockHalfTransparent { +@@ -35,7 +35,7 @@ public class BlockPortal extends BlockHalfTransparent { public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { super.b(world, blockposition, iblockdata, random); @@ -18,10 +18,10 @@ index 030f4e9..4dc40eb 100644 BlockPosition blockposition1; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 20800ed..a684d68 100644 +index 3854195..4cca76a 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -261,4 +261,11 @@ public class SpigotWorldConfig +@@ -217,4 +217,11 @@ public class SpigotWorldConfig nerfSpawnerMobs = getBoolean( "nerf-spawner-mobs", false ); log( "Nerfing mobs spawned from spawners: " + nerfSpawnerMobs ); } @@ -34,5 +34,5 @@ index 20800ed..a684d68 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0073-Highly-Optimized-Tick-Loop.patch b/CraftBukkit-Patches/0065-Highly-Optimized-Tick-Loop.patch similarity index 84% rename from CraftBukkit-Patches/0073-Highly-Optimized-Tick-Loop.patch rename to CraftBukkit-Patches/0065-Highly-Optimized-Tick-Loop.patch index 779498b486..7024b9c5ab 100644 --- a/CraftBukkit-Patches/0073-Highly-Optimized-Tick-Loop.patch +++ b/CraftBukkit-Patches/0065-Highly-Optimized-Tick-Loop.patch @@ -1,14 +1,14 @@ -From 338b4ea12bc2426248489fe26a9b2c7bac6feb30 Mon Sep 17 00:00:00 2001 +From c692d076435e90e261ebbe905d5bc87da7c1679f Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 25 Jan 2014 14:08:35 +1100 Subject: [PATCH] Highly Optimized Tick Loop diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b7ba79a..c55dcae 100644 +index a16a2d2..67f2de5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -116,6 +116,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -114,6 +114,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs public java.util.Queue processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; // CraftBukkit end @@ -19,9 +19,9 @@ index b7ba79a..c55dcae 100644 + public final double[] recentTps = new double[ 3 ]; + // Spigot end - public MinecraftServer(OptionSet options, Proxy proxy, File file1) { + public MinecraftServer(OptionSet options, Proxy proxy, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { this.e = proxy; -@@ -500,6 +506,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -497,6 +503,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.isRunning = false; } @@ -35,22 +35,22 @@ index b7ba79a..c55dcae 100644 public void run() { try { if (this.init()) { -@@ -510,38 +523,34 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs - this.r.setServerInfo(new ServerPing.ServerData("1.8.8", 47)); - this.a(this.r); +@@ -507,38 +520,34 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + this.q.setServerInfo(new ServerPing.ServerData("1.9", 107)); + this.a(this.q); + // Spigot start + Arrays.fill( recentTps, 20 ); + long lastTick = System.nanoTime(), catchupTime = 0, curTime, wait, tickSection = lastTick; while (this.isRunning) { -- long j = az(); -- long k = j - this.ab; +- long j = av(); +- long k = j - this.aa; - -- if (k > 2000L && this.ab - this.R >= 15000L) { +- if (k > 2000L && this.aa - this.Q >= 15000L) { - if (server.getWarnOnOverload()) // CraftBukkit - MinecraftServer.LOGGER.warn("Can\'t keep up! Did the system time change, or is the server overloaded? Running {}ms behind, skipping {} tick(s)", new Object[] { Long.valueOf(k), Long.valueOf(k / 50L)}); - k = 2000L; -- this.R = this.ab; +- this.Q = this.aa; - } - - if (k < 0L) { @@ -67,15 +67,15 @@ index b7ba79a..c55dcae 100644 } - i += k; -- this.ab = j; +- this.aa = j; - if (this.worlds.get(0).everyoneDeeplySleeping()) { // CraftBukkit -- this.A(); +- this.C(); - i = 0L; - } else { - while (i > 50L) { - MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit - i -= 50L; -- this.A(); +- this.C(); - } + if ( MinecraftServer.currentTick++ % SAMPLE_INTERVAL == 0 ) + { @@ -88,8 +88,8 @@ index b7ba79a..c55dcae 100644 + lastTick = curTime; - Thread.sleep(Math.max(1L, 50L - i)); -+ this.A(); - this.Q = true; ++ this.C(); + this.P = true; } + // Spigot end } else { @@ -161,5 +161,5 @@ index 0000000..be2e31d + } +} -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0074-Configurable-Ping-Sample-Size.patch b/CraftBukkit-Patches/0066-Configurable-Ping-Sample-Size.patch similarity index 56% rename from CraftBukkit-Patches/0074-Configurable-Ping-Sample-Size.patch rename to CraftBukkit-Patches/0066-Configurable-Ping-Sample-Size.patch index 961f28eeb6..d4e8dee71b 100644 --- a/CraftBukkit-Patches/0074-Configurable-Ping-Sample-Size.patch +++ b/CraftBukkit-Patches/0066-Configurable-Ping-Sample-Size.patch @@ -1,27 +1,27 @@ -From 80bf07aee22def1f8d8e1ad947c6a7ee496b10b7 Mon Sep 17 00:00:00 2001 +From 249686d2f9467edaef54884e2fdc48617e7a9252 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 26 Jan 2014 21:48:34 +1100 Subject: [PATCH] Configurable Ping Sample Size diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java -index 5b1abb4..e4bff04 100644 +index 519a380..08b14ec 100644 --- a/src/main/java/net/minecraft/server/PacketStatusListener.java +++ b/src/main/java/net/minecraft/server/PacketStatusListener.java @@ -108,6 +108,13 @@ public class PacketStatusListener implements PacketStatusInListener { - } + } - ServerPing.ServerPingPlayerSample playerSample = new ServerPing.ServerPingPlayerSample(event.getMaxPlayers(), profiles.size()); -+ // Spigot Start -+ if ( !profiles.isEmpty() ) -+ { -+ java.util.Collections.shuffle( profiles ); // This sucks, its inefficient but we have no simple way of doing it differently -+ profiles = profiles.subList( 0, Math.min( profiles.size(), org.spigotmc.SpigotConfig.playerSample ) ); // Cap the sample to n (or less) displayed players, ie: Vanilla behaviour -+ } -+ // Spigot End - playerSample.a(profiles.toArray(new GameProfile[profiles.size()])); + ServerPing.ServerPingPlayerSample playerSample = new ServerPing.ServerPingPlayerSample(event.getMaxPlayers(), profiles.size()); ++ // Spigot Start ++ if ( !profiles.isEmpty() ) ++ { ++ java.util.Collections.shuffle( profiles ); // This sucks, its inefficient but we have no simple way of doing it differently ++ profiles = profiles.subList( 0, Math.min( profiles.size(), org.spigotmc.SpigotConfig.playerSample ) ); // Cap the sample to n (or less) displayed players, ie: Vanilla behaviour ++ } ++ // Spigot End + playerSample.a(profiles.toArray(new GameProfile[profiles.size()])); - ServerPing ping = new ServerPing(); + ServerPing ping = new ServerPing(); diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java index e1cc2e0..936c860 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java @@ -39,5 +39,5 @@ index e1cc2e0..936c860 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0075-Add-Optional-Tick-Shuffling.patch b/CraftBukkit-Patches/0067-Add-Optional-Tick-Shuffling.patch similarity index 94% rename from CraftBukkit-Patches/0075-Add-Optional-Tick-Shuffling.patch rename to CraftBukkit-Patches/0067-Add-Optional-Tick-Shuffling.patch index ab27a8f3c3..47d565806a 100644 --- a/CraftBukkit-Patches/0075-Add-Optional-Tick-Shuffling.patch +++ b/CraftBukkit-Patches/0067-Add-Optional-Tick-Shuffling.patch @@ -1,4 +1,4 @@ -From aca3a68310507f5c3a8367ee0e29aa3cc8b37231 Mon Sep 17 00:00:00 2001 +From acd9b760ba646677e6794d65d8a3a9bbad1c073d Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 27 Jan 2014 08:39:26 +1100 Subject: [PATCH] Add Optional Tick Shuffling @@ -6,7 +6,7 @@ Subject: [PATCH] Add Optional Tick Shuffling This prevents players from 'gaming' the server, and strategically relogging to increase their position in the tick order. diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index 86b1f37..cfd4ca1 100644 +index 968a1b7..827bfaf 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java @@ -123,6 +123,13 @@ public class ServerConnection { @@ -39,5 +39,5 @@ index 936c860..83e575f 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0077-Implement-Locale-Getter-for-Players.patch b/CraftBukkit-Patches/0068-Implement-Locale-Getter-for-Players.patch similarity index 75% rename from CraftBukkit-Patches/0077-Implement-Locale-Getter-for-Players.patch rename to CraftBukkit-Patches/0068-Implement-Locale-Getter-for-Players.patch index dcb0036eb0..7d4b670cda 100644 --- a/CraftBukkit-Patches/0077-Implement-Locale-Getter-for-Players.patch +++ b/CraftBukkit-Patches/0068-Implement-Locale-Getter-for-Players.patch @@ -1,27 +1,27 @@ -From 9ed0e3e2709e5cc390395e9160025629a5248cfe Mon Sep 17 00:00:00 2001 +From 42384124ef71bf2c0c1a5747cad64dcb5b523307 Mon Sep 17 00:00:00 2001 From: Smove Date: Sat, 1 Feb 2014 18:12:16 +1100 Subject: [PATCH] Implement Locale Getter for Players diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ffdf25c..3438d3a 100644 +index 6cda7b9..2f1d95b 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -27,7 +27,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +@@ -25,7 +25,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; public class EntityPlayer extends EntityHuman implements ICrafting { - private static final Logger bH = LogManager.getLogger(); + private static final Logger bQ = LogManager.getLogger(); - private String locale = "en_US"; -+ public String locale = "en_US"; // Spigot ++ public String locale = "en_US"; // Spigot private -> public public PlayerConnection playerConnection; public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9998ed8..29c73f0 100644 +index 7c9f8e2..79c9267 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1428,6 +1428,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1494,6 +1494,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getHandle().playerConnection.sendPacket( packet ); } } @@ -35,5 +35,5 @@ index 9998ed8..29c73f0 100644 public Player.Spigot spigot() -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0078-Cap-Entity-Collisions.patch b/CraftBukkit-Patches/0069-Cap-Entity-Collisions.patch similarity index 50% rename from CraftBukkit-Patches/0078-Cap-Entity-Collisions.patch rename to CraftBukkit-Patches/0069-Cap-Entity-Collisions.patch index 98f7101547..fc03bf4eb1 100644 --- a/CraftBukkit-Patches/0078-Cap-Entity-Collisions.patch +++ b/CraftBukkit-Patches/0069-Cap-Entity-Collisions.patch @@ -1,4 +1,4 @@ -From 3e7278e88a5c4dcaf66e2ee6d4ed3358e761bab9 Mon Sep 17 00:00:00 2001 +From b8003723a21e465327a9ba3d99bcf3b57daa0a51 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 31 Jan 2014 11:18:34 -0500 Subject: [PATCH] Cap Entity Collisions @@ -7,50 +7,48 @@ Limit a single entity to colliding a max of configurable times per tick. This will alleviate issues where living entities are hoarded in 1x1 pens. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 027b1f1..e69b028 100644 +index eb552e2..5702cb0 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1053,6 +1053,7 @@ public abstract class Entity implements ICommandListener { +@@ -147,6 +147,7 @@ public abstract class Entity implements ICommandListener { + public long activatedTick = Integer.MIN_VALUE; + public boolean fromMobSpawner; + public void inactiveTick() { } ++ protected int numCollisions = 0; + // Spigot end - public void d(EntityHuman entityhuman) {} - -+ int numCollisions = 0; // Spigot - public void collide(Entity entity) { - if (entity.passenger != this && entity.vehicle != this) { - if (!entity.noclip && !this.noclip) { + public Entity(World world) { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 6d1a743..3c852fd 100644 +index b78b273..f0921e8 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1676,7 +1676,9 @@ public abstract class EntityLiving extends Entity { - })); +@@ -1967,7 +1967,8 @@ public abstract class EntityLiving extends Entity { + List list = this.world.a((Entity) this, this.getBoundingBox(), IEntitySelector.a(this)); - if (this.ad() && !list.isEmpty()) { // Spigot: Add this.ad() condition -+ numCollisions -= world.spigotConfig.maxCollisionsPerEntity; // Spigot - for (int i = 0; i < list.size(); ++i) { -+ if (numCollisions > world.spigotConfig.maxCollisionsPerEntity) { break; } // Spigot + if (this.isInteractable() && !list.isEmpty()) { // Spigot: Add isInteractable() condition +- for (int i = 0; i < list.size(); ++i) { ++ numCollisions -= world.spigotConfig.maxCollisionsPerEntity; // Spigot ++ for (int i = 0; i < list.size() && numCollisions < world.spigotConfig.maxCollisionsPerEntity; ++i) { Entity entity = (Entity) list.get(i); - // TODO better check now? -@@ -1686,8 +1688,11 @@ public abstract class EntityLiving extends Entity { + // CraftBukkit start - Only handle mob (non-player) collisions every other tick +@@ -1976,7 +1977,8 @@ public abstract class EntityLiving extends Entity { } // CraftBukkit end +- + entity.numCollisions++; // Spigot + numCollisions++; // Spigot - this.s(entity); + this.C(entity); } -+ numCollisions = 0; // Spigot } - - } diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index ede9250..c652cc5 100644 +index 4cca76a..19525eb 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -275,4 +275,11 @@ public class SpigotWorldConfig - maxBulkChunk = getInt( "max-bulk-chunks", 10 ); - log( "Sending up to " + maxBulkChunk + " chunks per packet" ); +@@ -224,4 +224,11 @@ public class SpigotWorldConfig + enableZombiePigmenPortalSpawns = getBoolean( "enable-zombie-pigmen-portal-spawns", true ); + log( "Allow Zombie Pigmen to spawn from portal blocks: " + enableZombiePigmenPortalSpawns ); } + + public int maxCollisionsPerEntity; @@ -61,5 +59,5 @@ index ede9250..c652cc5 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0079-Fix-dispensing-bone-meal-not-having-the-correct-data.patch b/CraftBukkit-Patches/0070-Fix-dispensing-bone-meal-not-having-the-correct-data.patch similarity index 87% rename from CraftBukkit-Patches/0079-Fix-dispensing-bone-meal-not-having-the-correct-data.patch rename to CraftBukkit-Patches/0070-Fix-dispensing-bone-meal-not-having-the-correct-data.patch index 89c4f655b1..26caab0e0f 100644 --- a/CraftBukkit-Patches/0079-Fix-dispensing-bone-meal-not-having-the-correct-data.patch +++ b/CraftBukkit-Patches/0070-Fix-dispensing-bone-meal-not-having-the-correct-data.patch @@ -1,14 +1,14 @@ -From 20accb600aff6f6c6c5e4cc1fdb54622750db89d Mon Sep 17 00:00:00 2001 +From 7ed8ec16ceaeeaee355f715e3476742ff4b1d1a7 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Thu, 6 Feb 2014 21:59:20 +0000 Subject: [PATCH] Fix dispensing bone meal not having the correct data value diff --git a/src/main/java/net/minecraft/server/DispenserRegistry.java b/src/main/java/net/minecraft/server/DispenserRegistry.java -index 4c68593..82cde14 100644 +index f2dc326..d7bea3d 100644 --- a/src/main/java/net/minecraft/server/DispenserRegistry.java +++ b/src/main/java/net/minecraft/server/DispenserRegistry.java -@@ -464,7 +464,7 @@ public class DispenserRegistry { +@@ -442,7 +442,7 @@ public class DispenserRegistry { // CraftBukkit start org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()); @@ -18,5 +18,5 @@ index 4c68593..82cde14 100644 BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); if (!BlockDispenser.eventFired) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0080-Spam-Filter-Exclusions.patch b/CraftBukkit-Patches/0071-Spam-Filter-Exclusions.patch similarity index 91% rename from CraftBukkit-Patches/0080-Spam-Filter-Exclusions.patch rename to CraftBukkit-Patches/0071-Spam-Filter-Exclusions.patch index c6116946c2..48db03e3e2 100644 --- a/CraftBukkit-Patches/0080-Spam-Filter-Exclusions.patch +++ b/CraftBukkit-Patches/0071-Spam-Filter-Exclusions.patch @@ -1,14 +1,14 @@ -From 903fcf17331fc740f0c35d97df935c484e7e1dd0 Mon Sep 17 00:00:00 2001 +From c51471c316849ffe05d17d82a3e8248ff534ed17 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 8 Feb 2014 08:13:40 +0000 Subject: [PATCH] Spam Filter Exclusions diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 36f0684..ac79faa 100644 +index 83a4551..04559c9 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -998,9 +998,20 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList +@@ -1142,9 +1142,20 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { this.minecraftServer.getPlayerList().sendMessage(chatmessage1, false); } @@ -57,5 +57,5 @@ index 83e575f..a0a59bb 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0081-Add-Option-to-Silence-CommandBlock-Console.patch b/CraftBukkit-Patches/0072-Add-Option-to-Silence-CommandBlock-Console.patch similarity index 89% rename from CraftBukkit-Patches/0081-Add-Option-to-Silence-CommandBlock-Console.patch rename to CraftBukkit-Patches/0072-Add-Option-to-Silence-CommandBlock-Console.patch index 570d412507..012972feea 100644 --- a/CraftBukkit-Patches/0081-Add-Option-to-Silence-CommandBlock-Console.patch +++ b/CraftBukkit-Patches/0072-Add-Option-to-Silence-CommandBlock-Console.patch @@ -1,14 +1,14 @@ -From bece1f16978cceaa526991d889e53f625315efdb Mon Sep 17 00:00:00 2001 +From d875e5714d617ab616bf274212d3fd5dc91fadef Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 9 Feb 2014 14:39:01 +1100 Subject: [PATCH] Add Option to Silence CommandBlock Console diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java -index 81289b7..fc52287 100644 +index 3e4a31b..0304aa0 100644 --- a/src/main/java/net/minecraft/server/CommandDispatcher.java +++ b/src/main/java/net/minecraft/server/CommandDispatcher.java -@@ -100,7 +100,7 @@ public class CommandDispatcher extends CommandHandler implements ICommandDispatc +@@ -103,7 +103,7 @@ public class CommandDispatcher extends CommandHandler implements ICommandDispatc } } @@ -33,5 +33,5 @@ index a0a59bb..039777a 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0082-Add-support-for-fetching-hidden-players.patch b/CraftBukkit-Patches/0073-Add-support-for-fetching-hidden-players.patch similarity index 84% rename from CraftBukkit-Patches/0082-Add-support-for-fetching-hidden-players.patch rename to CraftBukkit-Patches/0073-Add-support-for-fetching-hidden-players.patch index 0a3952bbcc..1a1f655115 100644 --- a/CraftBukkit-Patches/0082-Add-support-for-fetching-hidden-players.patch +++ b/CraftBukkit-Patches/0073-Add-support-for-fetching-hidden-players.patch @@ -1,14 +1,14 @@ -From 673a0dcfb5c95fbe1513a8e0e71d034ab6f153aa Mon Sep 17 00:00:00 2001 +From 5a31cfa1e3050f3c351c9a45c49568f38a31afa6 Mon Sep 17 00:00:00 2001 From: Tux Date: Sun, 9 Feb 2014 14:03:03 -0500 Subject: [PATCH] Add support for fetching hidden players diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 29c73f0..b560f77 100644 +index 79c9267..6e4ecbe 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1434,6 +1434,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1500,6 +1500,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { { return getHandle().locale; } @@ -28,5 +28,5 @@ index 29c73f0..b560f77 100644 public Player.Spigot spigot() -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0083-Allow-Disabling-Creative-Item-Filter.patch b/CraftBukkit-Patches/0074-Allow-Disabling-Creative-Item-Filter.patch similarity index 86% rename from CraftBukkit-Patches/0083-Allow-Disabling-Creative-Item-Filter.patch rename to CraftBukkit-Patches/0074-Allow-Disabling-Creative-Item-Filter.patch index 3073ed010e..fb5b53ac2e 100644 --- a/CraftBukkit-Patches/0083-Allow-Disabling-Creative-Item-Filter.patch +++ b/CraftBukkit-Patches/0074-Allow-Disabling-Creative-Item-Filter.patch @@ -1,16 +1,16 @@ -From 29b45e8d2d2e962b08ccde834e59299d7d255430 Mon Sep 17 00:00:00 2001 +From 8f32bb47908017305238eeec8b2d90a3f0c5d256 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 12 Feb 2014 18:18:01 +1100 Subject: [PATCH] Allow Disabling Creative Item Filter diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ac79faa..1d9bfe4 100644 +index 04559c9..4b057d1 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1724,7 +1724,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList +@@ -1902,7 +1902,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() < 36 + PlayerInventory.getHotbarSize(); + boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45; // CraftBukkit - Add invalidItems check - boolean flag2 = itemstack == null || itemstack.getItem() != null && !invalidItems.contains(Item.getId(itemstack.getItem())); + boolean flag2 = itemstack == null || itemstack.getItem() != null && (!invalidItems.contains(Item.getId(itemstack.getItem())) || !org.spigotmc.SpigotConfig.filterCreativeItems); // Spigot @@ -33,5 +33,5 @@ index 039777a..686b8bd 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0084-Cap-Channel-Registrations.patch b/CraftBukkit-Patches/0075-Cap-Channel-Registrations.patch similarity index 81% rename from CraftBukkit-Patches/0084-Cap-Channel-Registrations.patch rename to CraftBukkit-Patches/0075-Cap-Channel-Registrations.patch index c71c2f110d..1459371ecc 100644 --- a/CraftBukkit-Patches/0084-Cap-Channel-Registrations.patch +++ b/CraftBukkit-Patches/0075-Cap-Channel-Registrations.patch @@ -1,14 +1,14 @@ -From 2d9c0f7fa94f843db9dd9947ef045f8ba666cd72 Mon Sep 17 00:00:00 2001 +From 951f5235a02bb1cce34a114da1f253e448edb402 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 12 Feb 2014 20:02:58 +1100 Subject: [PATCH] Cap Channel Registrations diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b560f77..5604506 100644 +index 6e4ecbe..c5fdd6d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1057,6 +1057,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1058,6 +1058,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void addChannel(String channel) { @@ -17,5 +17,5 @@ index b560f77..5604506 100644 server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel)); } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0076-Allow-Configuring-Chunks-per-Packet.patch b/CraftBukkit-Patches/0076-Allow-Configuring-Chunks-per-Packet.patch deleted file mode 100644 index 97636505c8..0000000000 --- a/CraftBukkit-Patches/0076-Allow-Configuring-Chunks-per-Packet.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 16700e313cbe55c2e244316bc3fbb0aad02268fa Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Tue, 28 Jan 2014 20:35:35 +1100 -Subject: [PATCH] Allow Configuring Chunks per Packet - - -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index b0681cf..ffdf25c 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -223,7 +223,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - - Chunk chunk; - -- while (iterator1.hasNext() && arraylist.size() < 10) { -+ while (iterator1.hasNext() && arraylist.size() < this.world.spigotConfig.maxBulkChunk) { // Spigot - ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator1.next(); - - if (chunkcoordintpair != null) { -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index a684d68..ede9250 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -268,4 +268,11 @@ public class SpigotWorldConfig - enableZombiePigmenPortalSpawns = getBoolean( "enable-zombie-pigmen-portal-spawns", true ); - log( "Allow Zombie Pigmen to spawn from portal blocks: " + enableZombiePigmenPortalSpawns ); - } -+ -+ public int maxBulkChunk; -+ private void bulkChunkCount() -+ { -+ maxBulkChunk = getInt( "max-bulk-chunks", 10 ); -+ log( "Sending up to " + maxBulkChunk + " chunks per packet" ); -+ } - } --- -2.1.4 - diff --git a/CraftBukkit-Patches/0085-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch b/CraftBukkit-Patches/0076-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch similarity index 92% rename from CraftBukkit-Patches/0085-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch rename to CraftBukkit-Patches/0076-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch index 5178905b79..6c61e9aea8 100644 --- a/CraftBukkit-Patches/0085-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch +++ b/CraftBukkit-Patches/0076-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch @@ -1,14 +1,14 @@ -From f39456a4ac98fa1d30590b9dd850a7181f73c0c0 Mon Sep 17 00:00:00 2001 +From cba95eeba900ee8853e8b8ca7e2290798e18eb12 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 12 Feb 2014 20:44:14 +0000 Subject: [PATCH] Allow vanilla commands to be the main version of a command diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4c4a090..103ace8 100644 +index 1a5f14d..940fdd2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -318,8 +318,11 @@ public final class CraftServer implements Server { +@@ -322,8 +322,11 @@ public final class CraftServer implements Server { } if (type == PluginLoadOrder.POSTWORLD) { @@ -21,13 +21,13 @@ index 4c4a090..103ace8 100644 commandMap.registerServerAliases(); loadCustomPermissions(); DefaultPermissions.registerCorePermissions(); -@@ -332,10 +335,19 @@ public final class CraftServer implements Server { +@@ -336,10 +339,19 @@ public final class CraftServer implements Server { pluginManager.disablePlugins(); } - private void setVanillaCommands() { + private void setVanillaCommands(boolean first) { // Spigot - Map commands = new CommandDispatcher().getCommands(); + Map commands = new CommandDispatcher(console).getCommands(); for (ICommand cmd : commands.values()) { - commandMap.register("minecraft", new VanillaCommandWrapper((CommandAbstract) cmd, LocaleI18n.get(cmd.getUsage(null)))); + // Spigot start @@ -76,5 +76,5 @@ index 686b8bd..3a8734f 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0087-Implement-Silenceable-Lightning-API.patch b/CraftBukkit-Patches/0077-Implement-Silenceable-Lightning-API.patch similarity index 78% rename from CraftBukkit-Patches/0087-Implement-Silenceable-Lightning-API.patch rename to CraftBukkit-Patches/0077-Implement-Silenceable-Lightning-API.patch index 3a2c76c9e7..8268f9238f 100644 --- a/CraftBukkit-Patches/0087-Implement-Silenceable-Lightning-API.patch +++ b/CraftBukkit-Patches/0077-Implement-Silenceable-Lightning-API.patch @@ -1,48 +1,49 @@ -From 7981043f8918c3310b2f50ffeeffdd6d5e834f04 Mon Sep 17 00:00:00 2001 +From a2322f4d7c0497bb172db22586539e2cfa7f22ab Mon Sep 17 00:00:00 2001 From: drXor Date: Sun, 23 Feb 2014 16:16:59 -0400 Subject: [PATCH] Implement Silenceable Lightning API diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java -index d355e68..286fdef 100644 +index 35a0bdc..e507302 100644 --- a/src/main/java/net/minecraft/server/EntityLightning.java +++ b/src/main/java/net/minecraft/server/EntityLightning.java -@@ -13,6 +13,8 @@ public class EntityLightning extends EntityWeather { - // CraftBukkit start - public boolean isEffect = false; - +@@ -11,6 +11,7 @@ public class EntityLightning extends EntityWeather { + private int c; + private final boolean d; + public boolean isEffect; // CraftBukkit + public boolean isSilent = false; // Spigot -+ - public EntityLightning(World world, double d0, double d1, double d2) { - this(world, d0, d1, d2, false); + + public EntityLightning(World world, double d0, double d1, double d2, boolean flag) { + super(world); +@@ -46,13 +47,21 @@ public class EntityLightning extends EntityWeather { + } -@@ -52,12 +54,19 @@ public class EntityLightning extends EntityWeather { - } - } - } -+ } + // Spigot start + public EntityLightning(World world, double d0, double d1, double d2, boolean isEffect, boolean isSilent) + { + this( world, d0, d1, d2, isEffect ); + this.isSilent = isSilent; - } ++ } + // Spigot end ++ + public SoundCategory bz() { + return SoundCategory.WEATHER; + } - public void t_() { - super.t_(); + public void m() { + super.m(); - if (this.lifeTicks == 2) { + if (!isSilent && this.lifeTicks == 2) { // Spigot // CraftBukkit start - Use relative location for far away sounds - //this.world.makeSound(this.locX, this.locY, this.locZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.random.nextFloat() * 0.2F); + // this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.dc, SoundCategory.d, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F); float pitch = 0.8F + this.random.nextFloat() * 0.2F; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 0629805..d7b122f 100644 +index 2063185..2b3569d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1447,6 +1447,22 @@ public class CraftWorld implements World { +@@ -1518,6 +1518,22 @@ public class CraftWorld implements World { { CraftWorld.this.playEffect( location, effect, 0 ); } @@ -82,5 +83,5 @@ index 243e8e5..0bacc83 100644 @Override -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0088-Use-one-PermissibleBase-for-all-Command-Blocks.patch b/CraftBukkit-Patches/0078-Use-one-PermissibleBase-for-all-Command-Blocks.patch similarity index 94% rename from CraftBukkit-Patches/0088-Use-one-PermissibleBase-for-all-Command-Blocks.patch rename to CraftBukkit-Patches/0078-Use-one-PermissibleBase-for-all-Command-Blocks.patch index 827fa5b790..1c538efc21 100644 --- a/CraftBukkit-Patches/0088-Use-one-PermissibleBase-for-all-Command-Blocks.patch +++ b/CraftBukkit-Patches/0078-Use-one-PermissibleBase-for-all-Command-Blocks.patch @@ -1,4 +1,4 @@ -From f6446a8b33609ca85fe75d12dda6dcb104f15353 Mon Sep 17 00:00:00 2001 +From 3203e2ff437a39fa1697c2624f3609450ec9aa90 Mon Sep 17 00:00:00 2001 From: FrozenBrain Date: Sun, 2 Mar 2014 21:13:46 +0100 Subject: [PATCH] Use one PermissibleBase for all Command Blocks @@ -29,5 +29,5 @@ index 1314c74..b339cf3 100644 public boolean isPermissionSet(String name) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0089-Prevent-hoppers-from-loading-chunks.patch b/CraftBukkit-Patches/0079-Prevent-hoppers-from-loading-chunks.patch similarity index 78% rename from CraftBukkit-Patches/0089-Prevent-hoppers-from-loading-chunks.patch rename to CraftBukkit-Patches/0079-Prevent-hoppers-from-loading-chunks.patch index 8f4557a9ab..24d4cec387 100644 --- a/CraftBukkit-Patches/0089-Prevent-hoppers-from-loading-chunks.patch +++ b/CraftBukkit-Patches/0079-Prevent-hoppers-from-loading-chunks.patch @@ -1,14 +1,14 @@ -From dc19069d56b0c7c345ea865d24c256710b5e4b25 Mon Sep 17 00:00:00 2001 +From 35d54b80614097d23ea65b2d8ffc21bd69999838 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 5 Mar 2014 20:27:27 +0000 Subject: [PATCH] Prevent hoppers from loading chunks diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index 6785b71..1553656 100644 +index c01acb9..4cd2caa 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java -@@ -549,6 +549,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU +@@ -529,6 +529,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi int j = MathHelper.floor(d1); int k = MathHelper.floor(d2); BlockPosition blockposition = new BlockPosition(i, j, k); @@ -17,5 +17,5 @@ index 6785b71..1553656 100644 if (block.isTileEntity()) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0090-Guard-Entity-List.patch b/CraftBukkit-Patches/0080-Guard-Entity-List.patch similarity index 70% rename from CraftBukkit-Patches/0090-Guard-Entity-List.patch rename to CraftBukkit-Patches/0080-Guard-Entity-List.patch index 4ccd8c54c8..e14358dbdb 100644 --- a/CraftBukkit-Patches/0090-Guard-Entity-List.patch +++ b/CraftBukkit-Patches/0080-Guard-Entity-List.patch @@ -1,17 +1,17 @@ -From 3d2444de9d3dff2136780f07577b970a123a19cb Mon Sep 17 00:00:00 2001 +From 635e7f0a742e57728246287c937d3b65c754e9bc Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 10 Mar 2014 09:03:28 +1100 Subject: [PATCH] Guard Entity List diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a09de8e..2788061 100644 +index 2eaa1cb..da7a546 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -37,7 +37,32 @@ public abstract class World implements IBlockAccess { +@@ -33,7 +33,32 @@ public abstract class World implements IBlockAccess { private int a = 63; - protected boolean e; + protected boolean d; - public final List entityList = Lists.newArrayList(); + // Spigot start - guard entity list from removals + public final List entityList = new java.util.ArrayList() @@ -39,18 +39,18 @@ index a09de8e..2788061 100644 + } + }; + // Spigot end - protected final List g = Lists.newArrayList(); - public final List h = Lists.newArrayList(); + protected final List f = Lists.newArrayList(); public final List tileEntityList = Lists.newArrayList(); -@@ -105,6 +130,7 @@ public abstract class World implements IBlockAccess { - private int tickPosition; + public final List tileEntityListTick = Lists.newArrayList(); +@@ -101,6 +126,7 @@ public abstract class World implements IBlockAccess { + public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot - // Spigot start -+ private boolean guardEntityList; - protected final gnu.trove.map.hash.TLongShortHashMap chunkTickList; - protected float growthOdds = 100; - protected float modifiedOdds = 100; -@@ -1344,6 +1370,7 @@ public abstract class World implements IBlockAccess { + public final SpigotTimings.WorldTimingsHandler timings; // Spigot ++ private boolean guardEntityList; // Spigot + + public CraftWorld getWorld() { + return this.world; +@@ -1309,6 +1335,7 @@ public abstract class World implements IBlockAccess { org.spigotmc.ActivationRange.activateEntities(this); // Spigot timings.entityTick.startTiming(); // Spigot @@ -58,14 +58,14 @@ index a09de8e..2788061 100644 // CraftBukkit start - Use field for loop variable for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) { entity = (Entity) this.entityList.get(this.tickPosition); -@@ -1380,12 +1407,15 @@ public abstract class World implements IBlockAccess { - this.getChunkAt(j, k).b(entity); +@@ -1347,12 +1374,15 @@ public abstract class World implements IBlockAccess { + this.getChunkAt(j, l).b(entity); } + guardEntityList = false; // Spigot this.entityList.remove(this.tickPosition--); // CraftBukkit - Use field for loop variable + guardEntityList = true; // Spigot - this.b(entity); + this.c(entity); } this.methodProfiler.b(); @@ -75,5 +75,5 @@ index a09de8e..2788061 100644 timings.entityTick.stopTiming(); // Spigot this.methodProfiler.c("blockEntities"); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0091-Fix-ConcurrentModificationException-while-being-idle.patch b/CraftBukkit-Patches/0081-Fix-ConcurrentModificationException-while-being-idle.patch similarity index 59% rename from CraftBukkit-Patches/0091-Fix-ConcurrentModificationException-while-being-idle.patch rename to CraftBukkit-Patches/0081-Fix-ConcurrentModificationException-while-being-idle.patch index 3d8e6fff26..73a6eddf74 100644 --- a/CraftBukkit-Patches/0091-Fix-ConcurrentModificationException-while-being-idle.patch +++ b/CraftBukkit-Patches/0081-Fix-ConcurrentModificationException-while-being-idle.patch @@ -1,4 +1,4 @@ -From 2184149435455c1312bcdc2e8787facc7611edff Mon Sep 17 00:00:00 2001 +From 1f9470cf507a024512f543ec2d7c5380be8a46d7 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Tue, 14 Jan 2014 20:11:25 +0000 Subject: [PATCH] Fix ConcurrentModificationException while being idle kicked @@ -6,25 +6,31 @@ Subject: [PATCH] Fix ConcurrentModificationException while being idle kicked diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2788061..8f4a08a 100644 +index da7a546..1c83942 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1093,6 +1093,7 @@ public abstract class World implements IBlockAccess { +@@ -1,4 +1,4 @@ +-package net.minecraft.server; ++ package net.minecraft.server; + + import com.google.common.base.Function; + import com.google.common.base.Objects; +@@ -1013,6 +1013,7 @@ public abstract class World implements IBlockAccess { this.everyoneSleeping(); } + if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking - int i = entity.ae; - int j = entity.ag; + int i = entity.ab; + int j = entity.ad; -@@ -1109,6 +1110,7 @@ public abstract class World implements IBlockAccess { +@@ -1029,6 +1030,7 @@ public abstract class World implements IBlockAccess { this.entityList.remove(index); } // CraftBukkit end + } // Spigot - this.b(entity); + this.c(entity); } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0092-Cancellable-WitherSkull-potion-effect.patch b/CraftBukkit-Patches/0082-Cancellable-WitherSkull-potion-effect.patch similarity index 88% rename from CraftBukkit-Patches/0092-Cancellable-WitherSkull-potion-effect.patch rename to CraftBukkit-Patches/0082-Cancellable-WitherSkull-potion-effect.patch index e65deaba5f..b8d6f0568d 100644 --- a/CraftBukkit-Patches/0092-Cancellable-WitherSkull-potion-effect.patch +++ b/CraftBukkit-Patches/0082-Cancellable-WitherSkull-potion-effect.patch @@ -1,14 +1,14 @@ -From b83fad21f16c150a9559b077d160e143f491c0e1 Mon Sep 17 00:00:00 2001 +From 13a1f18344e24a5438f44fdff9f70c44e8e10683 Mon Sep 17 00:00:00 2001 From: drXor Date: Tue, 25 Feb 2014 15:15:26 -0400 Subject: [PATCH] Cancellable WitherSkull potion effect diff --git a/src/main/java/net/minecraft/server/EntityWitherSkull.java b/src/main/java/net/minecraft/server/EntityWitherSkull.java -index e169184..f0e627b 100644 +index 1080b00..edac23d 100644 --- a/src/main/java/net/minecraft/server/EntityWitherSkull.java +++ b/src/main/java/net/minecraft/server/EntityWitherSkull.java -@@ -36,8 +36,11 @@ public class EntityWitherSkull extends EntityFireball { +@@ -38,8 +38,11 @@ public class EntityWitherSkull extends EntityFireball { protected void a(MovingObjectPosition movingobjectposition) { if (!this.world.isClientSide) { if (movingobjectposition.entity != null) { @@ -21,7 +21,7 @@ index e169184..f0e627b 100644 if (!movingobjectposition.entity.isAlive()) { this.shooter.heal(5.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.WITHER); // CraftBukkit } else { -@@ -45,10 +48,11 @@ public class EntityWitherSkull extends EntityFireball { +@@ -47,10 +50,11 @@ public class EntityWitherSkull extends EntityFireball { } } } else { @@ -36,5 +36,5 @@ index e169184..f0e627b 100644 if (this.world.getDifficulty() == EnumDifficulty.NORMAL) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0093-Descriptive-kick-reasons-instead-of-Nope.patch b/CraftBukkit-Patches/0083-Descriptive-kick-reasons-instead-of-Nope.patch similarity index 80% rename from CraftBukkit-Patches/0093-Descriptive-kick-reasons-instead-of-Nope.patch rename to CraftBukkit-Patches/0083-Descriptive-kick-reasons-instead-of-Nope.patch index dd955f00ff..af7243b592 100644 --- a/CraftBukkit-Patches/0093-Descriptive-kick-reasons-instead-of-Nope.patch +++ b/CraftBukkit-Patches/0083-Descriptive-kick-reasons-instead-of-Nope.patch @@ -1,14 +1,14 @@ -From c75caf0ce356def2a5a6c59ec372b6942f936d56 Mon Sep 17 00:00:00 2001 +From 4490d6214b67fb69d54128020322dd2db7ba593c Mon Sep 17 00:00:00 2001 From: drXor Date: Sat, 15 Mar 2014 01:30:05 -0400 Subject: [PATCH] Descriptive kick reasons instead of Nope! diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e69b028..e345dd7 100644 +index 5702cb0..a4a6352 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -210,7 +210,7 @@ public abstract class Entity implements ICommandListener { +@@ -258,7 +258,7 @@ public abstract class Entity implements ICommandListener { if (f == Float.POSITIVE_INFINITY || f == Float.NEGATIVE_INFINITY) { if (this instanceof EntityPlayer) { this.world.getServer().getLogger().warning(this.getName() + " was caught trying to crash the server with an invalid yaw"); @@ -17,7 +17,7 @@ index e69b028..e345dd7 100644 } f = 0; } -@@ -223,7 +223,7 @@ public abstract class Entity implements ICommandListener { +@@ -271,7 +271,7 @@ public abstract class Entity implements ICommandListener { if (f1 == Float.POSITIVE_INFINITY || f1 == Float.NEGATIVE_INFINITY) { if (this instanceof EntityPlayer) { this.world.getServer().getLogger().warning(this.getName() + " was caught trying to crash the server with an invalid pitch"); @@ -27,18 +27,18 @@ index e69b028..e345dd7 100644 f1 = 0; } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 952b8a2..43e671f 100644 +index 4b057d1..14c6f43 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -921,7 +921,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList +@@ -1065,7 +1065,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { this.player.resetIdleTimer(); } else { - PlayerConnection.c.warn(this.player.getName() + " tried to set an invalid carried item"); + PlayerConnection.LOGGER.warn(this.player.getName() + " tried to set an invalid carried item"); - this.disconnect("Nope!"); // CraftBukkit + this.disconnect("Invalid hotbar selection (Hacking?)"); // CraftBukkit //Spigot "Nope" -> Descriptive reason } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0094-Configurable-dragon-death-and-wither-spawn-sounds.patch b/CraftBukkit-Patches/0084-Configurable-dragon-death-and-wither-spawn-sounds.patch similarity index 56% rename from CraftBukkit-Patches/0094-Configurable-dragon-death-and-wither-spawn-sounds.patch rename to CraftBukkit-Patches/0084-Configurable-dragon-death-and-wither-spawn-sounds.patch index 9eed5a44eb..3d2d32c750 100644 --- a/CraftBukkit-Patches/0094-Configurable-dragon-death-and-wither-spawn-sounds.patch +++ b/CraftBukkit-Patches/0084-Configurable-dragon-death-and-wither-spawn-sounds.patch @@ -1,26 +1,44 @@ -From c5c5b740376619ce06e68bc4d7a86b29e55b0aeb Mon Sep 17 00:00:00 2001 +From 58291d792f96e63773dbd9a15a4980f7db5a5354 Mon Sep 17 00:00:00 2001 From: drXor Date: Sat, 29 Mar 2014 13:44:25 -0400 Subject: [PATCH] Configurable dragon death and wither spawn sounds diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 657acd7..a64c488 100644 +index 0643672..cc548fc 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -578,6 +578,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo - double deltaX = this.locX - player.locX; - double deltaZ = this.locZ - player.locZ; - double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +@@ -497,7 +497,24 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo + } + + if (this.bF == 1) { +- this.world.a(1028, new BlockPosition(this), 0); ++ // CraftBukkit start - Use relative location for far away sounds ++ // this.world.a(1028, new BlockPosition(this), 0); ++ int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; ++ for (EntityPlayer player : (List) MinecraftServer.getServer().getPlayerList().players) { ++ double deltaX = this.locX - player.locX; ++ double deltaZ = this.locZ - player.locZ; ++ double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; + if ( world.spigotConfig.dragonDeathSoundRadius > 0 && distanceSquared > world.spigotConfig.dragonDeathSoundRadius * world.spigotConfig.dragonDeathSoundRadius ) continue; // Spigot - if (distanceSquared > viewDistance * viewDistance) { - double deltaLength = Math.sqrt(distanceSquared); - double relativeX = player.locX + (deltaX / deltaLength) * viewDistance; ++ if (distanceSquared > viewDistance * viewDistance) { ++ double deltaLength = Math.sqrt(distanceSquared); ++ double relativeX = player.locX + (deltaX / deltaLength) * viewDistance; ++ double relativeZ = player.locZ + (deltaZ / deltaLength) * viewDistance; ++ player.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1028, new BlockPosition((int) relativeX, (int) this.locY, (int) relativeZ), 0, true)); ++ } else { ++ player.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1028, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0, true)); ++ } ++ } ++ // CraftBukkit end + } + } + diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index 9884a82..fb19bad 100644 +index 76b6718..6b4dbb8 100644 --- a/src/main/java/net/minecraft/server/EntityWither.java +++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -191,6 +191,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -202,6 +202,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { double deltaX = this.locX - player.locX; double deltaZ = this.locZ - player.locZ; double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; @@ -29,10 +47,10 @@ index 9884a82..fb19bad 100644 double deltaLength = Math.sqrt(distanceSquared); double relativeX = player.locX + (deltaX / deltaLength) * viewDistance; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index c652cc5..75e66d5 100644 +index 19525eb..79a3124 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -282,4 +282,16 @@ public class SpigotWorldConfig +@@ -231,4 +231,16 @@ public class SpigotWorldConfig maxCollisionsPerEntity = getInt( "max-entity-collisions", 8 ); log( "Max Entity Collisions: " + maxCollisionsPerEntity ); } @@ -50,5 +68,5 @@ index c652cc5..75e66d5 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0095-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch b/CraftBukkit-Patches/0085-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch similarity index 81% rename from CraftBukkit-Patches/0095-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch rename to CraftBukkit-Patches/0085-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch index 5352df5e67..de688a3d4d 100644 --- a/CraftBukkit-Patches/0095-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch +++ b/CraftBukkit-Patches/0085-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch @@ -1,4 +1,4 @@ -From 993f29b10ba5812bf849113ddbbe89798ae57700 Mon Sep 17 00:00:00 2001 +From 6967dc0482213279e39508c5bea23f7ae5d65125 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Fri, 11 Apr 2014 11:16:34 +0100 Subject: [PATCH] Display 'Spigot' in client crashes, server lists and Mojang @@ -6,10 +6,10 @@ Subject: [PATCH] Display 'Spigot' in client crashes, server lists and Mojang diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c55dcae..304c577 100644 +index e96bbd1..ebbb56e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1014,7 +1014,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -1008,7 +1008,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs } public String getServerModName() { @@ -19,5 +19,5 @@ index c55dcae..304c577 100644 public CrashReport b(CrashReport crashreport) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0096-Treat-Bungee-as-Online-Mode.patch b/CraftBukkit-Patches/0086-Treat-Bungee-as-Online-Mode.patch similarity index 92% rename from CraftBukkit-Patches/0096-Treat-Bungee-as-Online-Mode.patch rename to CraftBukkit-Patches/0086-Treat-Bungee-as-Online-Mode.patch index 6fd59b0b98..c27bede27f 100644 --- a/CraftBukkit-Patches/0096-Treat-Bungee-as-Online-Mode.patch +++ b/CraftBukkit-Patches/0086-Treat-Bungee-as-Online-Mode.patch @@ -1,14 +1,14 @@ -From a9079c8c147b059feb5872cc7995987aa1344f36 Mon Sep 17 00:00:00 2001 +From 466cbe3cfd558b1dd344f236be5be3a5f3323387 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 12 Apr 2014 21:23:58 +1000 Subject: [PATCH] Treat Bungee as Online Mode diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 8801164..6331317 100644 +index 852f8b4..e8ba061 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -193,7 +193,14 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -196,7 +196,14 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer if (!this.getOnlineMode()) { DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!"); DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware."); @@ -25,7 +25,7 @@ index 8801164..6331317 100644 } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index 51bc8bd..d67539c 100644 +index b08d5d5..c527b3f 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -63,7 +63,7 @@ public class NameReferencingFileConverter { @@ -38,5 +38,5 @@ index 51bc8bd..d67539c 100644 } else { String[] astring1 = astring; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0086-Unfinalize-the-isDisconnected-method-by-bukkit.patch b/CraftBukkit-Patches/0086-Unfinalize-the-isDisconnected-method-by-bukkit.patch deleted file mode 100644 index a28a6bfdd1..0000000000 --- a/CraftBukkit-Patches/0086-Unfinalize-the-isDisconnected-method-by-bukkit.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 93af51933eb01ccbcd423a34ee958eb1dca54cfb Mon Sep 17 00:00:00 2001 -From: hcherndon -Date: Sat, 15 Feb 2014 01:51:20 -0600 -Subject: [PATCH] Unfinalize the isDisconnected() method by bukkit. - -This would literally mean the world to me. You have no idea how much this method being final is fucking me over right now. (Working with NPC's and what not.) - -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index b1b8a2f..0f2908e 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2095,7 +2095,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - } - - // CraftBukkit start - Add "isDisconnected" method -- public final boolean isDisconnected() { -+ public boolean isDisconnected() { // Spigot - return !this.player.joining && !this.networkManager.channel.config().isAutoRead(); - } - --- -2.5.0 - diff --git a/CraftBukkit-Patches/0097-Add-Conversion-Message.patch b/CraftBukkit-Patches/0087-Add-Conversion-Message.patch similarity index 75% rename from CraftBukkit-Patches/0097-Add-Conversion-Message.patch rename to CraftBukkit-Patches/0087-Add-Conversion-Message.patch index b12b9de023..9fae763de4 100644 --- a/CraftBukkit-Patches/0097-Add-Conversion-Message.patch +++ b/CraftBukkit-Patches/0087-Add-Conversion-Message.patch @@ -1,21 +1,21 @@ -From 868ed7873d461685203a175e5c07e1c268a52387 Mon Sep 17 00:00:00 2001 +From d414fed5ea4e5d047d7e881245703185e4faae45 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 12 Apr 2014 23:30:44 +1000 Subject: [PATCH] Add Conversion Message diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 9febc99..2bcc81f 100644 +index e8ba061..f5d7bd0 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -524,6 +524,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -561,6 +561,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } - protected boolean aR() { + protected boolean aO() { + server.getLogger().info( "**** Beginning UUID conversion, this may take A LONG time ****"); // Spigot, let the user know whats up! boolean flag = false; int i; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0098-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch b/CraftBukkit-Patches/0088-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch similarity index 79% rename from CraftBukkit-Patches/0098-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch rename to CraftBukkit-Patches/0088-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch index c85eb0f7a4..8632bb42b4 100644 --- a/CraftBukkit-Patches/0098-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch +++ b/CraftBukkit-Patches/0088-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch @@ -1,4 +1,4 @@ -From 7e2c3ef9d20fb88cbb0ade17c08ace098aea14bf Mon Sep 17 00:00:00 2001 +From 683a2a0d46445ee9c867d509cc2d600dfeaa984f Mon Sep 17 00:00:00 2001 From: "gjmcferrin@gmail.com" Date: Mon, 10 Feb 2014 10:05:11 -0500 Subject: [PATCH] Properly cancel fishing event. Fixes BUKKIT-5396 @@ -10,17 +10,17 @@ cleared. This ensures that the player's hooked entity value is set to null so that the next attempt will result in the proper state being called. diff --git a/src/main/java/net/minecraft/server/ItemFishingRod.java b/src/main/java/net/minecraft/server/ItemFishingRod.java -index 3cf292f..050a504 100644 +index 19f5f03..1a40b95 100644 --- a/src/main/java/net/minecraft/server/ItemFishingRod.java +++ b/src/main/java/net/minecraft/server/ItemFishingRod.java -@@ -23,6 +23,7 @@ public class ItemFishingRod extends Item { +@@ -25,6 +25,7 @@ public class ItemFishingRod extends Item { world.getServer().getPluginManager().callEvent(playerFishEvent); if (playerFishEvent.isCancelled()) { + entityhuman.hookedFish = null; - return itemstack; + return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack); } // CraftBukkit end -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0099-Print-Stack-on-InternalException.patch b/CraftBukkit-Patches/0089-Print-Stack-on-InternalException.patch similarity index 67% rename from CraftBukkit-Patches/0099-Print-Stack-on-InternalException.patch rename to CraftBukkit-Patches/0089-Print-Stack-on-InternalException.patch index f090a7a4c2..8f9398e906 100644 --- a/CraftBukkit-Patches/0099-Print-Stack-on-InternalException.patch +++ b/CraftBukkit-Patches/0089-Print-Stack-on-InternalException.patch @@ -1,21 +1,21 @@ -From c321d000af00c5d2ca2bd86e863a811a7f5a0fa3 Mon Sep 17 00:00:00 2001 +From 3319e690a4530c8e0cefe04fe6073f9ff821bb3e Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 13 Apr 2014 09:00:59 +1000 Subject: [PATCH] Print Stack on InternalException diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 7959242..f26d377 100644 +index c3ff6c2..c6f9955 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -111,6 +111,7 @@ public class NetworkManager extends SimpleChannelInboundHandler { - } +@@ -112,6 +112,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + NetworkManager.g.debug(throwable); this.close(chatmessage); + if (MinecraftServer.getServer().isDebugging()) throwable.printStackTrace(); // Spigot } - protected void a(ChannelHandlerContext channelhandlercontext, Packet packet) throws Exception { + protected void a(ChannelHandlerContext channelhandlercontext, Packet packet) throws Exception { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0100-Use-Offline-Player-Data-Once-if-Required.patch b/CraftBukkit-Patches/0090-Use-Offline-Player-Data-Once-if-Required.patch similarity index 88% rename from CraftBukkit-Patches/0100-Use-Offline-Player-Data-Once-if-Required.patch rename to CraftBukkit-Patches/0090-Use-Offline-Player-Data-Once-if-Required.patch index e1c6012a70..239f9f1438 100644 --- a/CraftBukkit-Patches/0100-Use-Offline-Player-Data-Once-if-Required.patch +++ b/CraftBukkit-Patches/0090-Use-Offline-Player-Data-Once-if-Required.patch @@ -1,4 +1,4 @@ -From 0e10c12254d2967b89b72797ee49c7b0902ee793 Mon Sep 17 00:00:00 2001 +From b4baf71ea9e422d9a988672e09f1a616628f9aab Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 13 Apr 2014 14:41:23 +1000 Subject: [PATCH] Use Offline Player Data Once if Required. @@ -6,10 +6,10 @@ Subject: [PATCH] Use Offline Player Data Once if Required. If we are online mode and the only copy of player data we can find is the player's offline mode data, we will attempt a once off conversion by reading this data and then renaming the file so it won't be used again. diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index 616b049..e4b3dd5 100644 +index fb08743..81e8bdb 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -200,10 +200,28 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { +@@ -164,10 +164,28 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { try { File file = new File(this.playerDir, entityhuman.getUniqueID().toString() + ".dat"); @@ -36,8 +36,8 @@ index 616b049..e4b3dd5 100644 + } + // Spigot End } catch (Exception exception) { - WorldNBTStorage.a.warn("Failed to load player data for " + entityhuman.getName()); + WorldNBTStorage.b.warn("Failed to load player data for " + entityhuman.getName()); } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0101-Use-Provided-Case-for-Non-Existent-Offline-Players.patch b/CraftBukkit-Patches/0091-Use-Provided-Case-for-Non-Existent-Offline-Players.patch similarity index 60% rename from CraftBukkit-Patches/0101-Use-Provided-Case-for-Non-Existent-Offline-Players.patch rename to CraftBukkit-Patches/0091-Use-Provided-Case-for-Non-Existent-Offline-Players.patch index 6d0e653cb4..4036adf605 100644 --- a/CraftBukkit-Patches/0101-Use-Provided-Case-for-Non-Existent-Offline-Players.patch +++ b/CraftBukkit-Patches/0091-Use-Provided-Case-for-Non-Existent-Offline-Players.patch @@ -1,22 +1,22 @@ -From c869eda4bd5c84e51f74d538913fe04c48dadb4c Mon Sep 17 00:00:00 2001 +From 6bcd206178f798f378bb08293959ec828c244460 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 14 Apr 2014 09:46:20 +1000 Subject: [PATCH] Use Provided Case for Non Existent Offline Players diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index d263ccc..846d7ca 100644 +index 4d00614..bbe6e69 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java -@@ -142,7 +142,7 @@ public class UserCache { - this.e.remove(gameprofile); - this.e.addFirst(gameprofile); +@@ -152,7 +152,7 @@ public class UserCache { + this.f.remove(gameprofile); + this.f.addFirst(gameprofile); } else { -- gameprofile = a(this.f, s1); -+ gameprofile = a(this.f, s); // Spigot - use correct case for offline players +- gameprofile = a(this.g, s1); ++ gameprofile = a(this.g, s); // Spigot - use correct case for offline players if (gameprofile != null) { this.a(gameprofile); - usercache_usercacheentry = (UserCache.UserCacheEntry) this.c.get(s1); + usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(s1); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0102-Check-for-blank-OfflinePlayer-Names.patch b/CraftBukkit-Patches/0092-Check-for-blank-OfflinePlayer-Names.patch similarity index 83% rename from CraftBukkit-Patches/0102-Check-for-blank-OfflinePlayer-Names.patch rename to CraftBukkit-Patches/0092-Check-for-blank-OfflinePlayer-Names.patch index 2e057b3a50..a255e14467 100644 --- a/CraftBukkit-Patches/0102-Check-for-blank-OfflinePlayer-Names.patch +++ b/CraftBukkit-Patches/0092-Check-for-blank-OfflinePlayer-Names.patch @@ -1,14 +1,14 @@ -From dfb84fae6c926e7ad278d492ec619e531281954c Mon Sep 17 00:00:00 2001 +From e3d7454ea1c7f649a3f04a4526304f94e9fa8138 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 14 Apr 2014 17:21:24 +1000 Subject: [PATCH] Check for blank OfflinePlayer Names diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 103ace8..573490a 100644 +index 940fdd2..7404ced 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1286,6 +1286,7 @@ public final class CraftServer implements Server { +@@ -1292,6 +1292,7 @@ public final class CraftServer implements Server { @Deprecated public OfflinePlayer getOfflinePlayer(String name) { Validate.notNull(name, "Name cannot be null"); @@ -17,5 +17,5 @@ index 103ace8..573490a 100644 // If the name given cannot ever be a valid username give a dummy return, for scoreboard plugins if (!validUserPattern.matcher(name).matches()) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0103-Fix-Player-Banning.patch b/CraftBukkit-Patches/0093-Fix-Player-Banning.patch similarity index 96% rename from CraftBukkit-Patches/0103-Fix-Player-Banning.patch rename to CraftBukkit-Patches/0093-Fix-Player-Banning.patch index 0e7524601e..1d704631c9 100644 --- a/CraftBukkit-Patches/0103-Fix-Player-Banning.patch +++ b/CraftBukkit-Patches/0093-Fix-Player-Banning.patch @@ -1,4 +1,4 @@ -From 3428699e8933a8d7a069fa5ed044666daf3683cf Mon Sep 17 00:00:00 2001 +From 0d0f490c0a042f2613d84c9c8cd974fd1dc01cc5 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 15 Apr 2014 10:32:48 +1000 Subject: [PATCH] Fix Player Banning @@ -45,5 +45,5 @@ index 27ce9d9..e68d2b3 100644 } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0104-Fix-ban-expire-dates.patch b/CraftBukkit-Patches/0094-Fix-ban-expire-dates.patch similarity index 91% rename from CraftBukkit-Patches/0104-Fix-ban-expire-dates.patch rename to CraftBukkit-Patches/0094-Fix-ban-expire-dates.patch index 8a55264a61..eb76efb9b2 100644 --- a/CraftBukkit-Patches/0104-Fix-ban-expire-dates.patch +++ b/CraftBukkit-Patches/0094-Fix-ban-expire-dates.patch @@ -1,4 +1,4 @@ -From 82d2a9902b6c5c3ca1d1149b6901a81d4ea6730f Mon Sep 17 00:00:00 2001 +From eb30c7e8e0898dedb0142c8284b224220dc08192 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 16 Apr 2014 10:09:56 +1000 Subject: [PATCH] Fix ban expire dates. @@ -18,5 +18,5 @@ index e68d2b3..16fe481 100644 public GameProfileBanEntry(JsonObject jsonobject) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0105-Correct-Ban-Expiration.patch b/CraftBukkit-Patches/0095-Correct-Ban-Expiration.patch similarity index 84% rename from CraftBukkit-Patches/0105-Correct-Ban-Expiration.patch rename to CraftBukkit-Patches/0095-Correct-Ban-Expiration.patch index 3e770c97f6..940726dde8 100644 --- a/CraftBukkit-Patches/0105-Correct-Ban-Expiration.patch +++ b/CraftBukkit-Patches/0095-Correct-Ban-Expiration.patch @@ -1,14 +1,14 @@ -From 0641dde5f043d110afd4a703ebf54f9119780735 Mon Sep 17 00:00:00 2001 +From 08ddd8db2001011c597d45cc59dc7e816250a467 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 16 Apr 2014 11:14:38 +1000 Subject: [PATCH] Correct Ban Expiration diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 3e9a4ef..0a39b06 100644 +index eb9375d..9f0842c 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -415,7 +415,7 @@ public abstract class PlayerList { +@@ -463,7 +463,7 @@ public abstract class PlayerList { } // return s; @@ -18,5 +18,5 @@ index 3e9a4ef..0a39b06 100644 // return "You are not white-listed on this server!"; event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0106-Convert-Horses-owner-to-UUID.patch b/CraftBukkit-Patches/0096-Convert-Horses-owner-to-UUID.patch similarity index 77% rename from CraftBukkit-Patches/0106-Convert-Horses-owner-to-UUID.patch rename to CraftBukkit-Patches/0096-Convert-Horses-owner-to-UUID.patch index 425b4076ae..1bfde6a4b1 100644 --- a/CraftBukkit-Patches/0106-Convert-Horses-owner-to-UUID.patch +++ b/CraftBukkit-Patches/0096-Convert-Horses-owner-to-UUID.patch @@ -1,14 +1,14 @@ -From d37b3eb2a15a15d2b2fe5dc961afee91639f27f2 Mon Sep 17 00:00:00 2001 +From 429cd2e895873f3403e564cffda453b8ceb68a0e Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 16 Apr 2014 01:40:30 -0400 Subject: [PATCH] Convert Horses owner to UUID diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java -index 993a4a8..f131419 100644 +index ba06096..5b9b879 100644 --- a/src/main/java/net/minecraft/server/EntityHorse.java +++ b/src/main/java/net/minecraft/server/EntityHorse.java -@@ -1016,6 +1016,17 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { +@@ -983,6 +983,17 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener, IJu s = nbttagcompound.getString("OwnerUUID"); } else { String s1 = nbttagcompound.getString("Owner"); @@ -24,8 +24,8 @@ index 993a4a8..f131419 100644 + } + // Spigot end - s = NameReferencingFileConverter.a(s1); + s = NameReferencingFileConverter.a(this.h(), s1); } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0107-Add-Score.isScoreSet-Z-API.patch b/CraftBukkit-Patches/0097-Add-Score.isScoreSet-Z-API.patch similarity index 92% rename from CraftBukkit-Patches/0107-Add-Score.isScoreSet-Z-API.patch rename to CraftBukkit-Patches/0097-Add-Score.isScoreSet-Z-API.patch index a0d44df864..07da030bb0 100644 --- a/CraftBukkit-Patches/0107-Add-Score.isScoreSet-Z-API.patch +++ b/CraftBukkit-Patches/0097-Add-Score.isScoreSet-Z-API.patch @@ -1,4 +1,4 @@ -From 65e5c43140f143929765996b367096545c599b0e Mon Sep 17 00:00:00 2001 +From dbe1a9c8b20c63f36dfb01ae9d613e95bdf9f87e Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 17 Apr 2014 19:35:53 +1000 Subject: [PATCH] Add Score.isScoreSet()Z API. @@ -21,5 +21,5 @@ index 0b71b53..ee9d2ae 100644 // Spigot end } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0108-Log-null-TileEntity-Owner.patch b/CraftBukkit-Patches/0098-Log-null-TileEntity-Owner.patch similarity index 88% rename from CraftBukkit-Patches/0108-Log-null-TileEntity-Owner.patch rename to CraftBukkit-Patches/0098-Log-null-TileEntity-Owner.patch index 0ae691943f..38c905ab51 100644 --- a/CraftBukkit-Patches/0108-Log-null-TileEntity-Owner.patch +++ b/CraftBukkit-Patches/0098-Log-null-TileEntity-Owner.patch @@ -1,14 +1,14 @@ -From 1874f36ea0732d6a192939fb70eb42404982c130 Mon Sep 17 00:00:00 2001 +From e9430972f96ff863952fb17f9cc27154f8b79377 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 20 Apr 2014 11:16:54 +1000 Subject: [PATCH] Log null TileEntity Owner diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index b8d0961..c268a40 100644 +index 8bbdc11..e6524e9 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java -@@ -229,7 +229,14 @@ public abstract class TileEntity { +@@ -242,7 +242,14 @@ public abstract class TileEntity { // CraftBukkit start - add method public InventoryHolder getOwner() { if (world == null) return null; @@ -25,5 +25,5 @@ index b8d0961..c268a40 100644 return null; } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0109-Don-t-special-case-invalid-usernames-for-UUIDs.patch b/CraftBukkit-Patches/0099-Don-t-special-case-invalid-usernames-for-UUIDs.patch similarity index 85% rename from CraftBukkit-Patches/0109-Don-t-special-case-invalid-usernames-for-UUIDs.patch rename to CraftBukkit-Patches/0099-Don-t-special-case-invalid-usernames-for-UUIDs.patch index e5781da8ac..b6119ef20c 100644 --- a/CraftBukkit-Patches/0109-Don-t-special-case-invalid-usernames-for-UUIDs.patch +++ b/CraftBukkit-Patches/0099-Don-t-special-case-invalid-usernames-for-UUIDs.patch @@ -1,14 +1,14 @@ -From 1a57d6484aee8da77a5640699982da4bf55cf923 Mon Sep 17 00:00:00 2001 +From 9d5425d4a49e1f81b886a6d3b81430b94ed7f9a3 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 20 Apr 2014 18:58:00 +1000 Subject: [PATCH] Don't special case 'invalid' usernames for UUIDs. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 573490a..0548e76 100644 +index 7404ced..8900e01 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1288,11 +1288,6 @@ public final class CraftServer implements Server { +@@ -1294,11 +1294,6 @@ public final class CraftServer implements Server { Validate.notNull(name, "Name cannot be null"); com.google.common.base.Preconditions.checkArgument( !org.apache.commons.lang.StringUtils.isBlank( name ), "Name cannot be blank" ); // Spigot @@ -21,5 +21,5 @@ index 573490a..0548e76 100644 if (result == null) { // This is potentially blocking :( -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0110-Convert-player-skulls-async.patch b/CraftBukkit-Patches/0100-Convert-player-skulls-async.patch similarity index 87% rename from CraftBukkit-Patches/0110-Convert-player-skulls-async.patch rename to CraftBukkit-Patches/0100-Convert-player-skulls-async.patch index 9211cbc7c1..0aea991cd0 100644 --- a/CraftBukkit-Patches/0110-Convert-player-skulls-async.patch +++ b/CraftBukkit-Patches/0100-Convert-player-skulls-async.patch @@ -1,21 +1,21 @@ -From 39d77ba60351ae8c806c79b5c5d88a2aad25e58d Mon Sep 17 00:00:00 2001 +From d70a9db30806a6aaf6f78311b2e1e29f8e11ecd1 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 20 Apr 2014 13:18:55 +0100 Subject: [PATCH] Convert player skulls async diff --git a/src/main/java/net/minecraft/server/ItemSkull.java b/src/main/java/net/minecraft/server/ItemSkull.java -index a46cfef..e710073 100644 +index 40338ae..2a8c5f0 100644 --- a/src/main/java/net/minecraft/server/ItemSkull.java +++ b/src/main/java/net/minecraft/server/ItemSkull.java -@@ -109,13 +109,21 @@ public class ItemSkull extends Item { +@@ -108,13 +108,21 @@ public class ItemSkull extends Item { return super.a(itemstack); } - public boolean a(NBTTagCompound nbttagcompound) { + public boolean a(final NBTTagCompound nbttagcompound) { // Spigot - make final super.a(nbttagcompound); - if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && nbttagcompound.getString("SkullOwner").length() > 0) { + if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && !nbttagcompound.getString("SkullOwner").isEmpty()) { GameProfile gameprofile = new GameProfile((UUID) null, nbttagcompound.getString("SkullOwner")); - gameprofile = TileEntitySkull.b(gameprofile); @@ -34,10 +34,10 @@ index a46cfef..e710073 100644 } else { return false; diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -index 0048b65..58014c5 100644 +index 244a424..7eecc6c 100644 --- a/src/main/java/net/minecraft/server/TileEntitySkull.java +++ b/src/main/java/net/minecraft/server/TileEntitySkull.java -@@ -5,11 +5,78 @@ import com.mojang.authlib.GameProfile; +@@ -6,6 +6,20 @@ import com.mojang.authlib.minecraft.MinecraftSessionService; import com.mojang.authlib.properties.Property; import java.util.UUID; @@ -55,11 +55,13 @@ index 0048b65..58014c5 100644 +import com.mojang.authlib.ProfileLookupCallback; +// Spigot end + - public class TileEntitySkull extends TileEntity { + public class TileEntitySkull extends TileEntity implements ITickable { private int a; - private int rotation; - private GameProfile g = null; +@@ -15,6 +29,58 @@ public class TileEntitySkull extends TileEntity implements ITickable { + private boolean i; + private static UserCache j; + private static MinecraftSessionService k; + // Spigot start + public static final Executor executor = Executors.newFixedThreadPool(3, + new ThreadFactoryBuilder() @@ -103,7 +105,7 @@ index 0048b65..58014c5 100644 + + if ( property == null ) + { -+ profile = MinecraftServer.getServer().aD().fillProfileProperties( profile, true ); ++ profile = MinecraftServer.getServer().ay().fillProfileProperties( profile, true ); + } + } + @@ -111,15 +113,14 @@ index 0048b65..58014c5 100644 + return profile; + } + } ); -+ + // Spigot end public TileEntitySkull() {} -@@ -68,35 +135,60 @@ public class TileEntitySkull extends TileEntity { +@@ -93,35 +159,60 @@ public class TileEntitySkull extends TileEntity implements ITickable { } - private void e() { + private void g() { - this.g = b(this.g); - this.update(); + // Spigot start @@ -133,7 +134,7 @@ index 0048b65..58014c5 100644 + g = input; + update(); + if (world != null) { -+ world.notify(position); ++ world.m(position); // PAIL: notify + } + return false; + } @@ -147,15 +148,15 @@ index 0048b65..58014c5 100644 if (gameprofile != null && !UtilColor.b(gameprofile.getName())) { if (gameprofile.isComplete() && gameprofile.getProperties().containsKey("textures")) { - return gameprofile; -+ callback.apply(gameprofile); - } else if (MinecraftServer.getServer() == null) { -- return gameprofile; -+ callback.apply(gameprofile); - } else { -- GameProfile gameprofile1 = MinecraftServer.getServer().getUserCache().getProfile(gameprofile.getName()); +- } else if (TileEntitySkull.j != null && TileEntitySkull.k != null) { +- GameProfile gameprofile1 = TileEntitySkull.j.getProfile(gameprofile.getName()); - - if (gameprofile1 == null) { - return gameprofile; ++ callback.apply(gameprofile); ++ } else if (MinecraftServer.getServer() == null) { ++ callback.apply(gameprofile); ++ } else { + GameProfile profile = skinCache.getIfPresent(gameprofile.getName()); + if (profile != null && Iterables.getFirst(profile.getProperties().get("textures"), (Object) null) != null) { + callback.apply(profile); @@ -163,7 +164,7 @@ index 0048b65..58014c5 100644 - Property property = (Property) Iterables.getFirst(gameprofile1.getProperties().get("textures"), (Object) null); - - if (property == null) { -- gameprofile1 = MinecraftServer.getServer().aD().fillProfileProperties(gameprofile1, true); +- gameprofile1 = TileEntitySkull.k.fillProfileProperties(gameprofile1, true); - } - - return gameprofile1; @@ -184,18 +185,20 @@ index 0048b65..58014c5 100644 + } + }); } +- } else { +- return gameprofile; } } else { - return gameprofile; + callback.apply(gameprofile); } } -+ // Spigot end ++ // Spigot end public int getSkullType() { return this.a; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index 8355d6c..ee78d00 100644 +index 8a11b87..2abca0c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -68,13 +68,27 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { diff --git a/CraftBukkit-Patches/0111-Prevent-NoClassDefError-crash-and-notify-on-crash.patch b/CraftBukkit-Patches/0101-Prevent-NoClassDefError-crash-and-notify-on-crash.patch similarity index 85% rename from CraftBukkit-Patches/0111-Prevent-NoClassDefError-crash-and-notify-on-crash.patch rename to CraftBukkit-Patches/0101-Prevent-NoClassDefError-crash-and-notify-on-crash.patch index be8144eb40..6622c6b4bf 100644 --- a/CraftBukkit-Patches/0111-Prevent-NoClassDefError-crash-and-notify-on-crash.patch +++ b/CraftBukkit-Patches/0101-Prevent-NoClassDefError-crash-and-notify-on-crash.patch @@ -1,23 +1,23 @@ -From dec6565d5f0dbfe64fbed7519d61f4cc0e5a2135 Mon Sep 17 00:00:00 2001 +From 52ac4c5e5b413c96eebf9d041a645fdb30cd0de3 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 21 Apr 2014 12:43:08 +0100 Subject: [PATCH] Prevent NoClassDefError crash and notify on crash diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8f4a08a..31e5e16 100644 +index 1c83942..8a79f5e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -135,6 +135,8 @@ public abstract class World implements IBlockAccess { - protected float growthOdds = 100; - protected float modifiedOdds = 100; - private final byte chunkTickRadius; +@@ -127,6 +127,8 @@ public abstract class World implements IBlockAccess { + + public final SpigotTimings.WorldTimingsHandler timings; // Spigot + private boolean guardEntityList; // Spigot + public static boolean haveWeSilencedAPhysicsCrash; + public static String blockLocation; - public static long chunkToKey(int x, int z) - { -@@ -570,6 +572,9 @@ public abstract class World implements IBlockAccess { + public CraftWorld getWorld() { + return this.world; +@@ -507,6 +509,9 @@ public abstract class World implements IBlockAccess { } // CraftBukkit end iblockdata.getBlock().doPhysics(this, blockposition, iblockdata, block); @@ -46,5 +46,5 @@ index de08ad6..94a3d42 100644 log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Spigot!):" ); dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().primaryThread.getId(), Integer.MAX_VALUE ), log ); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0112-Check-Skull-canPlace.patch b/CraftBukkit-Patches/0102-Check-Skull-canPlace.patch similarity index 60% rename from CraftBukkit-Patches/0112-Check-Skull-canPlace.patch rename to CraftBukkit-Patches/0102-Check-Skull-canPlace.patch index b4e421d68f..54cc7f8bfc 100644 --- a/CraftBukkit-Patches/0112-Check-Skull-canPlace.patch +++ b/CraftBukkit-Patches/0102-Check-Skull-canPlace.patch @@ -1,26 +1,26 @@ -From 374f5ab0db2baef88ccc9a2902217541af02eb1f Mon Sep 17 00:00:00 2001 +From 8828d915ce0c8b6e36728956002b2b0658de77a7 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 15 Apr 2014 10:48:35 +1000 Subject: [PATCH] Check Skull canPlace diff --git a/src/main/java/net/minecraft/server/ItemSkull.java b/src/main/java/net/minecraft/server/ItemSkull.java -index e710073..519574b 100644 +index 2a8c5f0..75cd3f1 100644 --- a/src/main/java/net/minecraft/server/ItemSkull.java +++ b/src/main/java/net/minecraft/server/ItemSkull.java -@@ -35,6 +35,12 @@ public class ItemSkull extends Item { - return false; - } else { - if (!world.isClientSide) { +@@ -33,6 +33,12 @@ public class ItemSkull extends Item { + if (world.isClientSide) { + return EnumInteractionResult.SUCCESS; + } else { + // Spigot Start + if ( !Blocks.SKULL.canPlace( world, blockposition ) ) + { -+ return false; ++ return EnumInteractionResult.FAIL; + } + // Spigot End - world.setTypeAndData(blockposition, Blocks.SKULL.getBlockData().set(BlockSkull.FACING, enumdirection), 3); + world.setTypeAndData(blockposition, Blocks.SKULL.getBlockData().set(BlockSkull.FACING, enumdirection), 11); int i = 0; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0113-Fix-race-condition-that-could-kill-connections-befor.patch b/CraftBukkit-Patches/0103-Fix-race-condition-that-could-kill-connections-befor.patch similarity index 80% rename from CraftBukkit-Patches/0113-Fix-race-condition-that-could-kill-connections-befor.patch rename to CraftBukkit-Patches/0103-Fix-race-condition-that-could-kill-connections-befor.patch index c67afbb33a..538ec6b06f 100644 --- a/CraftBukkit-Patches/0113-Fix-race-condition-that-could-kill-connections-befor.patch +++ b/CraftBukkit-Patches/0103-Fix-race-condition-that-could-kill-connections-befor.patch @@ -1,4 +1,4 @@ -From 75076bfbbe1016773c9c4d87a2ad4d8f7b50d2e4 Mon Sep 17 00:00:00 2001 +From 15f8edb4bcafa60c62d99833aad568ad91e424a0 Mon Sep 17 00:00:00 2001 From: Jonas Konrad Date: Fri, 25 Apr 2014 23:46:46 +0200 Subject: [PATCH] Fix race condition that could kill connections before they @@ -12,10 +12,10 @@ initialized. The ServerConnection does not remove NetworkManagers with this flag. diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index f26d377..247973d 100644 +index c6f9955..4c6dfb1 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -68,6 +68,7 @@ public class NetworkManager extends SimpleChannelInboundHandler { +@@ -68,6 +68,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { public SocketAddress l; public java.util.UUID spoofedUUID; public com.mojang.authlib.properties.Property[] spoofedProfile; @@ -23,7 +23,7 @@ index f26d377..247973d 100644 // Spigot End private PacketListener m; private IChatBaseComponent n; -@@ -82,6 +83,9 @@ public class NetworkManager extends SimpleChannelInboundHandler { +@@ -82,6 +83,9 @@ public class NetworkManager extends SimpleChannelInboundHandler> { super.channelActive(channelhandlercontext); this.channel = channelhandlercontext.channel(); this.l = this.channel.remoteAddress(); @@ -32,8 +32,8 @@ index f26d377..247973d 100644 + // Spigot End try { - this.a(EnumProtocol.HANDSHAKING); -@@ -235,6 +239,9 @@ public class NetworkManager extends SimpleChannelInboundHandler { + this.setProtocol(EnumProtocol.HANDSHAKING); +@@ -236,6 +240,9 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } public void close(IChatBaseComponent ichatbasecomponent) { @@ -44,20 +44,20 @@ index f26d377..247973d 100644 this.channel.close(); // We can't wait as this may be called from an event loop. this.n = ichatbasecomponent; diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index cfd4ca1..f13182c 100644 +index 827bfaf..7797575 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java -@@ -137,6 +137,10 @@ public class ServerConnection { - - if (!networkmanager.h()) { - if (!networkmanager.g()) { +@@ -167,6 +167,10 @@ public class ServerConnection { + networkmanager.stopReading(); + } + } else { + // Spigot Start + // Fix a race condition where a NetworkManager could be unregistered just before connection. + if (networkmanager.preparing) continue; + // Spigot End iterator.remove(); - networkmanager.l(); - } else { + networkmanager.handleDisconnection(); + } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0114-Configurable-UserCache-cap.patch b/CraftBukkit-Patches/0104-Configurable-UserCache-cap.patch similarity index 89% rename from CraftBukkit-Patches/0114-Configurable-UserCache-cap.patch rename to CraftBukkit-Patches/0104-Configurable-UserCache-cap.patch index 09ef75136e..70e9e35a60 100644 --- a/CraftBukkit-Patches/0114-Configurable-UserCache-cap.patch +++ b/CraftBukkit-Patches/0104-Configurable-UserCache-cap.patch @@ -1,14 +1,14 @@ -From 533edd1b196f90377cf3f6cd3285d105c0a93068 Mon Sep 17 00:00:00 2001 +From a61b421ea6808f23d4da2000f67dc8b6b5250403 Mon Sep 17 00:00:00 2001 From: drXor Date: Fri, 25 Apr 2014 18:17:30 -0400 Subject: [PATCH] Configurable UserCache cap diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 846d7ca..8001b8a 100644 +index bbe6e69..4dcf736 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java -@@ -208,7 +208,7 @@ public class UserCache { +@@ -220,7 +220,7 @@ public class UserCache { } public void c() { @@ -33,5 +33,5 @@ index 3a8734f..e88765b 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0115-Implement-PlayerSpawnLocationEvent.patch b/CraftBukkit-Patches/0105-Implement-PlayerSpawnLocationEvent.patch similarity index 94% rename from CraftBukkit-Patches/0115-Implement-PlayerSpawnLocationEvent.patch rename to CraftBukkit-Patches/0105-Implement-PlayerSpawnLocationEvent.patch index a141d44067..205b31dd04 100644 --- a/CraftBukkit-Patches/0115-Implement-PlayerSpawnLocationEvent.patch +++ b/CraftBukkit-Patches/0105-Implement-PlayerSpawnLocationEvent.patch @@ -1,11 +1,11 @@ -From 91aac16f7fba39ca6d930f6674ada3847b535755 Mon Sep 17 00:00:00 2001 +From 9a0877242c981ac2f3f99bd00432cf7a90a5c777 Mon Sep 17 00:00:00 2001 From: ninja Date: Tue, 8 Apr 2014 14:05:19 +0200 Subject: [PATCH] Implement PlayerSpawnLocationEvent. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 0a39b06..9a5549d 100644 +index 9f0842c..6eb509c 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -36,6 +36,7 @@ import org.bukkit.event.player.PlayerQuitEvent; @@ -37,5 +37,5 @@ index 0a39b06..9a5549d 100644 // PlayerList.f.info(entityplayer.getName() + "[" + s1 + "] logged in with entity id " + entityplayer.getId() + " at (" + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")"); WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0116-Cap-Objective-Score-Length.patch b/CraftBukkit-Patches/0106-Cap-Objective-Score-Length.patch similarity index 93% rename from CraftBukkit-Patches/0116-Cap-Objective-Score-Length.patch rename to CraftBukkit-Patches/0106-Cap-Objective-Score-Length.patch index 7fce1ec09a..e09b03a38c 100644 --- a/CraftBukkit-Patches/0116-Cap-Objective-Score-Length.patch +++ b/CraftBukkit-Patches/0106-Cap-Objective-Score-Length.patch @@ -1,4 +1,4 @@ -From 5f66321b10cf8fc0a8fe7927316dd29b64b9c05e Mon Sep 17 00:00:00 2001 +From 25ef2e1d26817356274ebd8523594cf9b93074c7 Mon Sep 17 00:00:00 2001 From: hauno Date: Tue, 6 May 2014 18:01:37 -0700 Subject: [PATCH] Cap Objective Score Length @@ -18,5 +18,5 @@ index 239ceca..5bd8cf9 100644 return new CraftScore(this, entry); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0117-Process-conversation-input-on-the-main-thread.-Fixes.patch b/CraftBukkit-Patches/0107-Process-conversation-input-on-the-main-thread.-Fixes.patch similarity index 81% rename from CraftBukkit-Patches/0117-Process-conversation-input-on-the-main-thread.-Fixes.patch rename to CraftBukkit-Patches/0107-Process-conversation-input-on-the-main-thread.-Fixes.patch index 01810fd6d4..7ef3b57239 100644 --- a/CraftBukkit-Patches/0117-Process-conversation-input-on-the-main-thread.-Fixes.patch +++ b/CraftBukkit-Patches/0107-Process-conversation-input-on-the-main-thread.-Fixes.patch @@ -1,4 +1,4 @@ -From 2e45a50a997a1761d9e654dd3e7411261552560d Mon Sep 17 00:00:00 2001 +From 682946385f860c723b7303cedb58048b8c1c7632 Mon Sep 17 00:00:00 2001 From: riking Date: Wed, 14 May 2014 13:46:48 -0700 Subject: [PATCH] Process conversation input on the main thread. Fixes @@ -6,12 +6,12 @@ Subject: [PATCH] Process conversation input on the main thread. Fixes diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 43e671f..6e112b3 100644 +index 14c6f43..74c25a4 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -983,7 +983,18 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList +@@ -1127,7 +1127,18 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } else if (s.isEmpty()) { - c.warn(this.player.getName() + " tried to send an empty message"); + LOGGER.warn(this.player.getName() + " tried to send an empty message"); } else if (getPlayer().isConversing()) { - getPlayer().acceptConversationInput(s); + // Spigot start @@ -30,5 +30,5 @@ index 43e671f..6e112b3 100644 ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0118-Configurable-save-on-stop-only-for-UserCache.patch b/CraftBukkit-Patches/0108-Configurable-save-on-stop-only-for-UserCache.patch similarity index 69% rename from CraftBukkit-Patches/0118-Configurable-save-on-stop-only-for-UserCache.patch rename to CraftBukkit-Patches/0108-Configurable-save-on-stop-only-for-UserCache.patch index 5ed77cb3b1..7c63591c1a 100644 --- a/CraftBukkit-Patches/0118-Configurable-save-on-stop-only-for-UserCache.patch +++ b/CraftBukkit-Patches/0108-Configurable-save-on-stop-only-for-UserCache.patch @@ -1,42 +1,40 @@ -From 96ff9e63f0291a26a96316c101de1063843f28a7 Mon Sep 17 00:00:00 2001 +From def6115f5c235487bdd296db0fe350bf4afce2e2 Mon Sep 17 00:00:00 2001 From: drXor Date: Fri, 23 May 2014 18:05:10 -0400 Subject: [PATCH] Configurable save-on-stop-only for UserCache diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 304c577..81d7ea3 100644 +index ebbb56e..650e2c1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -486,7 +486,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs - if (this.n.d()) { - this.n.e(); - } -- -+ // Spigot start -+ if( org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly ) -+ { -+ LOGGER.info("Saving usercache.json"); -+ this.Z.c(); -+ } -+ //Spigot end +@@ -485,6 +485,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + this.m.e(); } + ++ // Spigot start ++ if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { ++ LOGGER.info("Saving usercache.json"); ++ this.X.c(); ++ } ++ // Spigot end } + public String getServerIp() { diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 8001b8a..85277a6 100644 +index 4dcf736..825fed6 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java -@@ -121,7 +121,7 @@ public class UserCache { - this.c.put(gameprofile.getName().toLowerCase(Locale.ROOT), usercache_usercacheentry); - this.d.put(uuid, usercache_usercacheentry); - this.e.addFirst(gameprofile); +@@ -131,7 +131,7 @@ public class UserCache { + this.d.put(gameprofile.getName().toLowerCase(Locale.ROOT), usercache_usercacheentry); + this.e.put(uuid, usercache_usercacheentry); + this.f.addFirst(gameprofile); - this.c(); + if( !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly ) this.c(); // Spigot - skip saving if disabled } public GameProfile getProfile(String s) { -@@ -149,7 +149,7 @@ public class UserCache { +@@ -159,7 +159,7 @@ public class UserCache { } } @@ -61,5 +59,5 @@ index e88765b..f35e92e 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0119-Prevent-Unbounded-IntCache-Growth.patch b/CraftBukkit-Patches/0109-Prevent-Unbounded-IntCache-Growth.patch similarity index 97% rename from CraftBukkit-Patches/0119-Prevent-Unbounded-IntCache-Growth.patch rename to CraftBukkit-Patches/0109-Prevent-Unbounded-IntCache-Growth.patch index 6ec04654a9..955c76828c 100644 --- a/CraftBukkit-Patches/0119-Prevent-Unbounded-IntCache-Growth.patch +++ b/CraftBukkit-Patches/0109-Prevent-Unbounded-IntCache-Growth.patch @@ -1,4 +1,4 @@ -From 00516c63ec6296d6f6e5b7b5f28f8cc4923cfaf9 Mon Sep 17 00:00:00 2001 +From b513ce477e791cf530b823da2ef36e473dadf87e Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 20 Jun 2014 19:40:00 +1000 Subject: [PATCH] Prevent Unbounded IntCache Growth @@ -58,5 +58,5 @@ index f35e92e..921d7d5 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0120-Add-damager-to-the-unhandled-error.patch b/CraftBukkit-Patches/0110-Add-damager-to-the-unhandled-error.patch similarity index 86% rename from CraftBukkit-Patches/0120-Add-damager-to-the-unhandled-error.patch rename to CraftBukkit-Patches/0110-Add-damager-to-the-unhandled-error.patch index c9fec94af6..7e31200dc4 100644 --- a/CraftBukkit-Patches/0120-Add-damager-to-the-unhandled-error.patch +++ b/CraftBukkit-Patches/0110-Add-damager-to-the-unhandled-error.patch @@ -1,14 +1,14 @@ -From 5ddc1687efc584a5696a66ff4524e7d2c8b8c813 Mon Sep 17 00:00:00 2001 +From 5451463a4d33e15349c9d4a5a6ce10b000158f02 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Thu, 26 Jun 2014 23:42:52 +0100 Subject: [PATCH] Add damager to the unhandled error diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 2771b28..147b928 100644 +index 86820c2..a10ced5 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -186,7 +186,7 @@ public class CraftEventFactory { +@@ -170,7 +170,7 @@ public class CraftEventFactory { */ public static PlayerInteractEvent callPlayerInteractEvent(EntityHuman who, Action action, ItemStack itemstack) { if (action != Action.LEFT_CLICK_AIR && action != Action.RIGHT_CLICK_AIR) { @@ -17,7 +17,7 @@ index 2771b28..147b928 100644 } return callPlayerInteractEvent(who, action, new BlockPosition(0, 256, 0), EnumDirection.SOUTH, itemstack); } -@@ -483,7 +483,7 @@ public class CraftEventFactory { +@@ -468,7 +468,7 @@ public class CraftEventFactory { if (source == DamageSource.CACTUS) { cause = DamageCause.CONTACT; } else { @@ -26,16 +26,16 @@ index 2771b28..147b928 100644 } EntityDamageEvent event = callEvent(new EntityDamageByBlockEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions)); if (!event.isCancelled()) { -@@ -501,7 +501,7 @@ public class CraftEventFactory { - } else if (source == DamageSource.FALL) { - cause = DamageCause.FALL; +@@ -488,7 +488,7 @@ public class CraftEventFactory { + } else if (source == DamageSource.DRAGON_BREATH) { + cause = DamageCause.DRAGON_BREATH; } else { - throw new AssertionError(String.format("Unhandled damage of %s by %s from %s", entity, damager.getHandle(), source.translationIndex)); + throw new RuntimeException(String.format("Unhandled damage of %s by %s from %s", entity, damager.getHandle(), source.translationIndex)); // Spigot } EntityDamageEvent event = callEvent(new EntityDamageByEntityEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions)); if (!event.isCancelled()) { -@@ -539,7 +539,7 @@ public class CraftEventFactory { +@@ -526,7 +526,7 @@ public class CraftEventFactory { return callEntityDamageEvent(null, entity, cause, modifiers, modifierFunctions); } @@ -45,5 +45,5 @@ index 2771b28..147b928 100644 private static EntityDamageEvent callEntityDamageEvent(Entity damager, Entity damagee, DamageCause cause, Map modifiers, Map> modifierFunctions) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0121-Cross-World-Entity-Teleportation.patch b/CraftBukkit-Patches/0111-Cross-World-Entity-Teleportation.patch similarity index 86% rename from CraftBukkit-Patches/0121-Cross-World-Entity-Teleportation.patch rename to CraftBukkit-Patches/0111-Cross-World-Entity-Teleportation.patch index 40f6866f58..93b86579ab 100644 --- a/CraftBukkit-Patches/0121-Cross-World-Entity-Teleportation.patch +++ b/CraftBukkit-Patches/0111-Cross-World-Entity-Teleportation.patch @@ -1,4 +1,4 @@ -From aaa2c88a63db57c293bbd1440827602c72d2b4cd Mon Sep 17 00:00:00 2001 +From d2d1f852267723ee3dfc5e8a975d74f2d26f93ce Mon Sep 17 00:00:00 2001 From: Andrew Krieger Date: Tue, 24 Dec 2013 07:55:23 -0800 Subject: [PATCH] Cross World Entity Teleportation @@ -6,12 +6,12 @@ Subject: [PATCH] Cross World Entity Teleportation Use Entity.teleportTo for cross-world teleportation in CraftEntity. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 0234fe3..efbf1a8 100644 +index 1e51d4c..9a1c9f0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -234,7 +234,14 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -236,7 +236,14 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { // If this entity is riding another entity, we must dismount before teleporting. - entity.mount(null); + entity.stopRiding(); - entity.world = ((CraftWorld) location.getWorld()).getHandle(); + // Spigot start @@ -26,5 +26,5 @@ index 0234fe3..efbf1a8 100644 // entity.setLocation() throws no event, and so cannot be cancelled return true; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0112-Limit-block-placement-interaction-packets.patch b/CraftBukkit-Patches/0112-Limit-block-placement-interaction-packets.patch new file mode 100644 index 0000000000..81976e9610 --- /dev/null +++ b/CraftBukkit-Patches/0112-Limit-block-placement-interaction-packets.patch @@ -0,0 +1,79 @@ +From a525bee009d7ad526e5c8dfa616f7c82b9643f35 Mon Sep 17 00:00:00 2001 +From: Thinkofdeath +Date: Sun, 29 Jun 2014 21:10:34 +0100 +Subject: [PATCH] Limit block placement/interaction packets + + +diff --git a/src/main/java/net/minecraft/server/PacketPlayInArmAnimation.java b/src/main/java/net/minecraft/server/PacketPlayInArmAnimation.java +deleted file mode 100644 +index cb0356e..0000000 +--- a/src/main/java/net/minecraft/server/PacketPlayInArmAnimation.java ++++ /dev/null +@@ -1,30 +0,0 @@ +-package net.minecraft.server; +- +-import java.io.IOException; +- +-public class PacketPlayInArmAnimation implements Packet { +- +- private EnumHand a; +- +- public PacketPlayInArmAnimation() {} +- +- public PacketPlayInArmAnimation(EnumHand enumhand) { +- this.a = enumhand; +- } +- +- public void a(PacketDataSerializer packetdataserializer) throws IOException { +- this.a = (EnumHand) packetdataserializer.a(EnumHand.class); +- } +- +- public void b(PacketDataSerializer packetdataserializer) throws IOException { +- packetdataserializer.a((Enum) this.a); +- } +- +- public void a(PacketListenerPlayIn packetlistenerplayin) { +- packetlistenerplayin.a(this); +- } +- +- public EnumHand a() { +- return this.a; +- } +-} +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 74c25a4..371b3d1 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -850,6 +850,10 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + + } + ++ // Spigot start - limit place/interactions ++ private long lastPlace = -1; ++ private int packets = 0; ++ // Spigot end + public void a(PacketPlayInBlockPlace packetplayinblockplace) { + PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.x()); + if (this.player.dead) return; // CraftBukkit +@@ -858,7 +862,17 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + ItemStack itemstack = this.player.b(enumhand); + + this.player.resetIdleTimer(); +- if (itemstack != null) { ++ // Spigot start ++ boolean throttled = false; ++ if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) { ++ throttled = true; ++ } else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 ) ++ { ++ lastPlace = packetplayinblockplace.timestamp; ++ packets = 0; ++ } ++ // Spigot end ++ if (!throttled && itemstack != null) { // Spigot - skip the event if throttled + // CraftBukkit start + // Raytrace to look for 'rogue armswings' + float f1 = this.player.pitch; +-- +2.5.0 + diff --git a/CraftBukkit-Patches/0123-Better-item-validation.patch b/CraftBukkit-Patches/0113-Better-item-validation.patch similarity index 67% rename from CraftBukkit-Patches/0123-Better-item-validation.patch rename to CraftBukkit-Patches/0113-Better-item-validation.patch index 7ed3f95f6e..a76bf2418f 100644 --- a/CraftBukkit-Patches/0123-Better-item-validation.patch +++ b/CraftBukkit-Patches/0113-Better-item-validation.patch @@ -1,58 +1,14 @@ -From ef9a7d32e5729d89d759ce1c8e852b2665039049 Mon Sep 17 00:00:00 2001 +From 77058805fac70e9b35debdba1a12f5a05f1f9510 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 2 Jul 2014 23:35:51 +0100 Subject: [PATCH] Better item validation -diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java -index aa46c28..dec091e 100644 ---- a/src/main/java/net/minecraft/server/DataWatcher.java -+++ b/src/main/java/net/minecraft/server/DataWatcher.java -@@ -155,6 +155,17 @@ public class DataWatcher { - arraylist = Lists.newArrayList(); - } - -+ // Spigot start - copy ItemStacks to prevent ConcurrentModificationExceptions -+ if ( datawatcher_watchableobject.b() instanceof ItemStack ) -+ { -+ datawatcher_watchableobject = new WatchableObject( -+ datawatcher_watchableobject.c(), -+ datawatcher_watchableobject.a(), -+ ( (ItemStack) datawatcher_watchableobject.b() ).cloneItemStack() -+ ); -+ } -+ // Spigot end -+ - arraylist.add(datawatcher_watchableobject); - } - } -@@ -186,6 +197,21 @@ public class DataWatcher { - this.f.readLock().lock(); - - arraylist.addAll(this.dataValues.valueCollection()); // Spigot -+ // Spigot start - copy ItemStacks to prevent ConcurrentModificationExceptions -+ for ( int i = 0; i < arraylist.size(); i++ ) -+ { -+ WatchableObject watchableobject = (WatchableObject) arraylist.get( i ); -+ if ( watchableobject.b() instanceof ItemStack ) -+ { -+ watchableobject = new WatchableObject( -+ watchableobject.c(), -+ watchableobject.a(), -+ ( (ItemStack) watchableobject.b() ).cloneItemStack() -+ ); -+ arraylist.set( i, watchableobject ); -+ } -+ } -+ // Spigot end - - this.f.readLock().unlock(); - return arraylist; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index 32af4ee..f426c2e 100644 +index 9655e74..ede4fe2 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java -@@ -173,6 +173,10 @@ public class PacketDataSerializer extends ByteBuf { +@@ -213,6 +213,10 @@ public class PacketDataSerializer extends ByteBuf { NBTTagCompound nbttagcompound = null; if (itemstack.getItem().usesDurability() || itemstack.getItem().p()) { @@ -155,5 +111,5 @@ index 0000000..58a9534 + } +} -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0124-Further-Seed-Customisation.patch b/CraftBukkit-Patches/0114-Further-Seed-Customisation.patch similarity index 71% rename from CraftBukkit-Patches/0124-Further-Seed-Customisation.patch rename to CraftBukkit-Patches/0114-Further-Seed-Customisation.patch index c9a72641c9..7dba0fc57b 100644 --- a/CraftBukkit-Patches/0124-Further-Seed-Customisation.patch +++ b/CraftBukkit-Patches/0114-Further-Seed-Customisation.patch @@ -1,4 +1,4 @@ -From ad74c9a1713fd13fe9142b4c0ea0a96f175a52b8 Mon Sep 17 00:00:00 2001 +From dbd85e39718a05cd2202f76677c281631261be12 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 4 Jul 2014 13:28:45 +1000 Subject: [PATCH] Further Seed Customisation @@ -6,36 +6,36 @@ Subject: [PATCH] Further Seed Customisation Allow server admins that really want to to customise the seeds used in world generation even further. diff --git a/src/main/java/net/minecraft/server/WorldGenLargeFeature.java b/src/main/java/net/minecraft/server/WorldGenLargeFeature.java -index b2f87cc..171be82 100644 +index 462dc76..1ab69cc 100644 --- a/src/main/java/net/minecraft/server/WorldGenLargeFeature.java +++ b/src/main/java/net/minecraft/server/WorldGenLargeFeature.java @@ -54,7 +54,7 @@ public class WorldGenLargeFeature extends StructureGenerator { - int i1 = i / this.g; - int j1 = j / this.g; -- Random random = this.c.a(i1, j1, 14357617); -+ Random random = this.c.a(i1, j1, this.c.spigotConfig.largeFeatureSeed); // Spigot + int i1 = i / this.d; + int j1 = j / this.d; +- Random random = this.g.a(i1, j1, 14357617); ++ Random random = this.g.a(i1, j1, this.g.spigotConfig.largeFeatureSeed); // Spigot - i1 *= this.g; - j1 *= this.g; + i1 *= this.d; + j1 *= this.d; diff --git a/src/main/java/net/minecraft/server/WorldGenVillage.java b/src/main/java/net/minecraft/server/WorldGenVillage.java -index 411f2dc..6648a70 100644 +index 2f43742..02d8fec 100644 --- a/src/main/java/net/minecraft/server/WorldGenVillage.java +++ b/src/main/java/net/minecraft/server/WorldGenVillage.java @@ -53,7 +53,7 @@ public class WorldGenVillage extends StructureGenerator { - int i1 = i / this.g; - int j1 = j / this.g; -- Random random = this.c.a(i1, j1, 10387312); -+ Random random = this.c.a(i1, j1, this.c.spigotConfig.villageSeed); // Spigot + int i1 = i / this.d; + int j1 = j / this.d; +- Random random = this.g.a(i1, j1, 10387312); ++ Random random = this.g.a(i1, j1, this.g.spigotConfig.villageSeed); // Spigot - i1 *= this.g; - j1 *= this.g; + i1 *= this.d; + j1 *= this.d; diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 75e66d5..b19558b 100644 +index 79a3124..7cf8f2d 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -294,4 +294,13 @@ public class SpigotWorldConfig +@@ -243,4 +243,13 @@ public class SpigotWorldConfig { witherSpawnSoundRadius = getInt( "wither-spawn-sound-radius", 0 ); } @@ -50,5 +50,5 @@ index 75e66d5..b19558b 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0125-Disable-ResourceLeakDetector.patch b/CraftBukkit-Patches/0115-Disable-ResourceLeakDetector.patch similarity index 57% rename from CraftBukkit-Patches/0125-Disable-ResourceLeakDetector.patch rename to CraftBukkit-Patches/0115-Disable-ResourceLeakDetector.patch index e6c1d83c5b..97b4080891 100644 --- a/CraftBukkit-Patches/0125-Disable-ResourceLeakDetector.patch +++ b/CraftBukkit-Patches/0115-Disable-ResourceLeakDetector.patch @@ -1,4 +1,4 @@ -From e58acb7c281b40d8de5690e907a1a0191ec31efd Mon Sep 17 00:00:00 2001 +From 2513194a4ac12635e4c1cb84fc4c3f39d1c58f59 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 8 Jul 2014 09:01:50 +1000 Subject: [PATCH] Disable ResourceLeakDetector @@ -6,17 +6,17 @@ Subject: [PATCH] Disable ResourceLeakDetector Hopefully no plugins are somehow leaking buffers, but disabling the ResourceLeakDetector is a good thing for performance of the Netty IO subsytem (it's been disabled in BungeeCord for a while now). diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1e6e401..dd3c740 100644 +index 650e2c1..28b1679 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -124,6 +124,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -122,6 +122,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs // Spigot end - public MinecraftServer(OptionSet options, Proxy proxy, File file1) { + public MinecraftServer(OptionSet options, Proxy proxy, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { + io.netty.util.ResourceLeakDetector.setEnabled( false ); // Spigot - disable this.e = proxy; - MinecraftServer.l = this; - // this.universe = file; // CraftBukkit + this.U = yggdrasilauthenticationservice; + this.V = minecraftsessionservice; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0126-Add-More-Information-to-session.lock-Errors.patch b/CraftBukkit-Patches/0116-Add-More-Information-to-session.lock-Errors.patch similarity index 88% rename from CraftBukkit-Patches/0126-Add-More-Information-to-session.lock-Errors.patch rename to CraftBukkit-Patches/0116-Add-More-Information-to-session.lock-Errors.patch index 17af992624..75e17f3cad 100644 --- a/CraftBukkit-Patches/0126-Add-More-Information-to-session.lock-Errors.patch +++ b/CraftBukkit-Patches/0116-Add-More-Information-to-session.lock-Errors.patch @@ -1,14 +1,14 @@ -From 8b6407c85ad1c8bf001e9a4bb801c381e1ff2067 Mon Sep 17 00:00:00 2001 +From 337f77b57686dd849102ccc71ba0fddba043a746 Mon Sep 17 00:00:00 2001 From: Suddenly Date: Sat, 5 Jul 2014 16:56:44 +0100 Subject: [PATCH] Add More Information to session.lock Errors diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index e4b3dd5..7c51750 100644 +index 81e8bdb..df82c14 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -54,7 +54,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { +@@ -59,7 +59,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { } catch (IOException ioexception) { ioexception.printStackTrace(); @@ -17,7 +17,7 @@ index e4b3dd5..7c51750 100644 } } -@@ -69,14 +69,14 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { +@@ -74,14 +74,14 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { try { if (datainputstream.readLong() != this.sessionId) { @@ -35,5 +35,5 @@ index e4b3dd5..7c51750 100644 } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0127-Safer-JSON-Loading.patch b/CraftBukkit-Patches/0117-Safer-JSON-Loading.patch similarity index 91% rename from CraftBukkit-Patches/0127-Safer-JSON-Loading.patch rename to CraftBukkit-Patches/0117-Safer-JSON-Loading.patch index bb1a2b87cf..5dd9a5e288 100644 --- a/CraftBukkit-Patches/0127-Safer-JSON-Loading.patch +++ b/CraftBukkit-Patches/0117-Safer-JSON-Loading.patch @@ -1,4 +1,4 @@ -From 746d08b447fa46f08a994ba4f1491f49786c01ef Mon Sep 17 00:00:00 2001 +From cc03db48e9274551d0e55b7ed45b88bcd36210ad Mon Sep 17 00:00:00 2001 From: Suddenly Date: Tue, 8 Jul 2014 09:44:18 +1000 Subject: [PATCH] Safer JSON Loading @@ -27,21 +27,21 @@ index f5c3aae..8e4ecfd 100644 IOUtils.closeQuietly(bufferedreader); } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 85277a6..0f82e06 100644 +index 825fed6..46129d8 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java -@@ -199,6 +199,11 @@ public class UserCache { +@@ -211,6 +211,11 @@ public class UserCache { } } catch (FileNotFoundException filenotfoundexception) { ; + // Spigot Start + } catch (com.google.gson.JsonSyntaxException ex) { + JsonList.a.warn( "Usercache.json is corrupted or has bad formatting. Deleting it to prevent further issues." ); -+ this.g.delete(); ++ this.h.delete(); + // Spigot End } catch (JsonParseException jsonparseexception) { ; } finally { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0129-Add-CommandLine-EULA-Flag.patch b/CraftBukkit-Patches/0118-Add-CommandLine-EULA-Flag.patch similarity index 84% rename from CraftBukkit-Patches/0129-Add-CommandLine-EULA-Flag.patch rename to CraftBukkit-Patches/0118-Add-CommandLine-EULA-Flag.patch index fa0faa59a0..c94481009b 100644 --- a/CraftBukkit-Patches/0129-Add-CommandLine-EULA-Flag.patch +++ b/CraftBukkit-Patches/0118-Add-CommandLine-EULA-Flag.patch @@ -1,4 +1,4 @@ -From 05e99ed4d627500b2b69f8d9f9ed9008f1b7b391 Mon Sep 17 00:00:00 2001 +From 517d8b988136a5d9746d9ba11c2c3bb8ba98df72 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 9 Jul 2014 10:35:44 +1000 Subject: [PATCH] Add CommandLine EULA Flag @@ -8,14 +8,14 @@ This flag contains the same message as eula.txt (albeit with proper grammar for This feature only exists for hosting companies and people who manage servers in bulk who wish to agree to the terms by setting a flag in a script. diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 37b5728..8dd4ef1 100644 +index f5d7bd0..2659703 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -123,7 +123,16 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -126,7 +126,16 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer DedicatedServer.LOGGER.info("Loading properties"); this.propertyManager = new PropertyManager(this.options); // CraftBukkit - CLI argument support - this.p = new EULA(new File("eula.txt")); -- if (!this.p.a()) { + this.q = new EULA(new File("eula.txt")); +- if (!this.q.a()) { + // Spigot Start + boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" ); + if ( eulaAgreed ) @@ -25,10 +25,10 @@ index 37b5728..8dd4ef1 100644 + System.err.println( "If you do not agree to the above EULA please stop your server and remove this flag immediately." ); + } + // Spigot End -+ if (!this.p.a() && !eulaAgreed) { // Spigot ++ if (!this.q.a() && !eulaAgreed) { // Spigot DedicatedServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info."); - this.p.b(); + this.q.b(); return false; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0130-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch b/CraftBukkit-Patches/0119-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch similarity index 86% rename from CraftBukkit-Patches/0130-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch rename to CraftBukkit-Patches/0119-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch index b81bce2b33..8930f1a0c5 100644 --- a/CraftBukkit-Patches/0130-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch +++ b/CraftBukkit-Patches/0119-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch @@ -1,4 +1,4 @@ -From 639afecbc1c663a8389f2fd401d78689562657e4 Mon Sep 17 00:00:00 2001 +From 05af5b15f00a18947d51a29774568c54878ed4e5 Mon Sep 17 00:00:00 2001 From: drXor Date: Thu, 17 Jul 2014 21:13:15 -0400 Subject: [PATCH] Fix for enchanting table wiping meta when placing stacked @@ -6,10 +6,10 @@ Subject: [PATCH] Fix for enchanting table wiping meta when placing stacked diff --git a/src/main/java/net/minecraft/server/ContainerEnchantTable.java b/src/main/java/net/minecraft/server/ContainerEnchantTable.java -index 208d426..09eeb43 100644 +index bc2500c..2493326 100644 --- a/src/main/java/net/minecraft/server/ContainerEnchantTable.java +++ b/src/main/java/net/minecraft/server/ContainerEnchantTable.java -@@ -336,7 +336,11 @@ public class ContainerEnchantTable extends Container { +@@ -347,7 +347,11 @@ public class ContainerEnchantTable extends Container { ((Slot) this.c.get(0)).set(itemstack1.cloneItemStack()); itemstack1.count = 0; } else if (itemstack1.count >= 1) { @@ -23,5 +23,5 @@ index 208d426..09eeb43 100644 } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0131-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch b/CraftBukkit-Patches/0120-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch similarity index 74% rename from CraftBukkit-Patches/0131-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch rename to CraftBukkit-Patches/0120-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch index 95ab53a2d4..dd6bfc2021 100644 --- a/CraftBukkit-Patches/0131-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch +++ b/CraftBukkit-Patches/0120-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch @@ -1,22 +1,22 @@ -From 397d6c2e1211224b0fa42fa8882897b840b8108e Mon Sep 17 00:00:00 2001 +From c4fe74ae25ea8a0bf39d876df16b3703f3809301 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sat, 19 Jul 2014 12:49:48 +0100 Subject: [PATCH] Don't spawn bonus ocelots when plugins spawn ocelots diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index 2121438..edcb307 100644 +index 06ace47..f74d1b9 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java -@@ -6,6 +6,7 @@ public class EntityOcelot extends EntityTameableAnimal { - - private PathfinderGoalAvoidTarget bo; - private PathfinderGoalTempt bp; +@@ -7,6 +7,7 @@ public class EntityOcelot extends EntityTameableAnimal { + private static final DataWatcherObject bz = DataWatcher.a(EntityOcelot.class, DataWatcherRegistry.b); + private PathfinderGoalAvoidTarget bA; + private PathfinderGoalTempt bB; + public boolean spawnBonus = true; // Spigot public EntityOcelot(World world) { super(world); -@@ -230,7 +231,7 @@ public class EntityOcelot extends EntityTameableAnimal { +@@ -229,7 +230,7 @@ public class EntityOcelot extends EntityTameableAnimal { public GroupDataEntity prepare(DifficultyDamageScaler difficultydamagescaler, GroupDataEntity groupdataentity) { groupdataentity = super.prepare(difficultydamagescaler, groupdataentity); @@ -26,10 +26,10 @@ index 2121438..edcb307 100644 EntityOcelot entityocelot = new EntityOcelot(this.world); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index d7b122f..c1d552a 100644 +index 2b3569d..c0d7ac5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1106,6 +1106,12 @@ public class CraftWorld implements World { +@@ -1107,6 +1107,12 @@ public class CraftWorld implements World { } if (entity != null) { @@ -43,5 +43,5 @@ index d7b122f..c1d552a 100644 } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0132-Prevent-a-crash-involving-attributes.patch b/CraftBukkit-Patches/0121-Prevent-a-crash-involving-attributes.patch similarity index 88% rename from CraftBukkit-Patches/0132-Prevent-a-crash-involving-attributes.patch rename to CraftBukkit-Patches/0121-Prevent-a-crash-involving-attributes.patch index 9f08c56573..60737634e8 100644 --- a/CraftBukkit-Patches/0132-Prevent-a-crash-involving-attributes.patch +++ b/CraftBukkit-Patches/0121-Prevent-a-crash-involving-attributes.patch @@ -1,14 +1,14 @@ -From c41b1b42f91f97dff1016df73e012f12001bb4a3 Mon Sep 17 00:00:00 2001 +From d8413b16c197862cbf7787bddb9e0900984772de Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sat, 19 Jul 2014 19:54:41 +0100 Subject: [PATCH] Prevent a crash involving attributes diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5604506..95c5fb3 100644 +index c5fdd6d..b1521b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1307,7 +1307,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1308,7 +1308,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { break; } } @@ -26,5 +26,5 @@ index 5604506..95c5fb3 100644 @Override -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0122-Limit-block-placement-interaction-packets.patch b/CraftBukkit-Patches/0122-Limit-block-placement-interaction-packets.patch deleted file mode 100644 index 47d318b1f2..0000000000 --- a/CraftBukkit-Patches/0122-Limit-block-placement-interaction-packets.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 2b6ef7bbe24544e2c371624f0652ca5601832eb2 Mon Sep 17 00:00:00 2001 -From: Thinkofdeath -Date: Sun, 29 Jun 2014 21:10:34 +0100 -Subject: [PATCH] Limit block placement/interaction packets - - -diff --git a/src/main/java/net/minecraft/server/PacketPlayInArmAnimation.java b/src/main/java/net/minecraft/server/PacketPlayInArmAnimation.java -index c611db1..28cb5e3 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayInArmAnimation.java -+++ b/src/main/java/net/minecraft/server/PacketPlayInArmAnimation.java -@@ -4,9 +4,13 @@ import java.io.IOException; - - public class PacketPlayInArmAnimation implements Packet { - -+ public long timestamp; // Spigot -+ - public PacketPlayInArmAnimation() {} - -- public void a(PacketDataSerializer packetdataserializer) throws IOException {} -+ public void a(PacketDataSerializer packetdataserializer) throws IOException { -+ timestamp = System.currentTimeMillis(); // Spigot -+ } - - public void b(PacketDataSerializer packetdataserializer) throws IOException {} - -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 6e112b3..bca1058 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -651,9 +651,22 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - // CraftBukkit end - } - -+ // Spigot start - limit place/interactions -+ private long lastPlace = -1; -+ private int packets = 0; -+ - public void a(PacketPlayInBlockPlace packetplayinblockplace) { - PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.u()); - WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); -+ boolean throttled = false; -+ if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) { -+ throttled = true; -+ } else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 ) -+ { -+ lastPlace = packetplayinblockplace.timestamp; -+ packets = 0; -+ } -+ // Spigot end - - // CraftBukkit start - if (this.player.dead) return; -@@ -677,7 +690,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - - // CraftBukkit start - int itemstackAmount = itemstack.count; -- -+ // Spigot start - skip the event if throttled -+ if (!throttled) { - // Raytrace to look for 'rogue armswings' - float f1 = this.player.pitch; - float f2 = this.player.yaw; -@@ -713,6 +727,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - if (!cancelled) { - this.player.playerInteractManager.useItem(this.player, this.player.world, itemstack); - } -+ } -+ // Spigot end - - // CraftBukkit - notch decrements the counter by 1 in the above method with food, - // snowballs and so forth, but he does it in a place that doesn't cause the -@@ -738,7 +754,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - } - - if (this.checkMovement && this.player.e((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) { -- always = !this.player.playerInteractManager.interact(this.player, worldserver, itemstack, blockposition, enumdirection, packetplayinblockplace.d(), packetplayinblockplace.e(), packetplayinblockplace.f()); -+ always = throttled || !this.player.playerInteractManager.interact(this.player, worldserver, itemstack, blockposition, enumdirection, packetplayinblockplace.d(), packetplayinblockplace.e(), packetplayinblockplace.f()); - } - - flag = true; --- -2.1.4 - diff --git a/CraftBukkit-Patches/0122-Make-moved-wrongly-limit-configurable.patch b/CraftBukkit-Patches/0122-Make-moved-wrongly-limit-configurable.patch new file mode 100644 index 0000000000..21ec97f1ca --- /dev/null +++ b/CraftBukkit-Patches/0122-Make-moved-wrongly-limit-configurable.patch @@ -0,0 +1,24 @@ +From e4eaae02de9a9d2be4816c7d260d39011924fd90 Mon Sep 17 00:00:00 2001 +From: Jonas Konrad +Date: Fri, 4 Jul 2014 23:03:13 +0200 +Subject: [PATCH] Make "moved wrongly" limit configurable + + +diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java +index 921d7d5..7e774f2 100644 +--- a/src/main/java/org/spigotmc/SpigotConfig.java ++++ b/src/main/java/org/spigotmc/SpigotConfig.java +@@ -334,4 +334,10 @@ public class SpigotConfig + { + intCacheLimit = getInt( "settings.int-cache-limit", 1024 ); + } ++ ++ public static double movedWronglyThreshold; ++ private static void movedWronglyThreshold() ++ { ++ movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D ); ++ } + } +-- +2.5.0 + diff --git a/CraftBukkit-Patches/0134-Fix-Null-Tile-Entity-Worlds.patch b/CraftBukkit-Patches/0123-Fix-Null-Tile-Entity-Worlds.patch similarity index 77% rename from CraftBukkit-Patches/0134-Fix-Null-Tile-Entity-Worlds.patch rename to CraftBukkit-Patches/0123-Fix-Null-Tile-Entity-Worlds.patch index fe092e67a2..a4188ac76a 100644 --- a/CraftBukkit-Patches/0134-Fix-Null-Tile-Entity-Worlds.patch +++ b/CraftBukkit-Patches/0123-Fix-Null-Tile-Entity-Worlds.patch @@ -1,14 +1,14 @@ -From fb664aa6b7640d6e4a57e19531ff09db02abefc5 Mon Sep 17 00:00:00 2001 +From a5c2d12d9f349e8eed55096b5ac9fa0c02bc90f6 Mon Sep 17 00:00:00 2001 From: "Evan A. Haskell" Date: Thu, 26 Jun 2014 18:37:29 -0400 Subject: [PATCH] Fix Null Tile Entity Worlds diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 31e5e16..5a4e9e7 100644 +index 8a79f5e..bb49102 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1946,6 +1946,7 @@ public abstract class World implements IBlockAccess { +@@ -1935,6 +1935,7 @@ public abstract class World implements IBlockAccess { } } @@ -17,5 +17,5 @@ index 31e5e16..5a4e9e7 100644 } else { this.a(tileentity); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0124-Make-moved-too-quickly-limit-configurable.patch b/CraftBukkit-Patches/0124-Make-moved-too-quickly-limit-configurable.patch new file mode 100644 index 0000000000..bfd850f284 --- /dev/null +++ b/CraftBukkit-Patches/0124-Make-moved-too-quickly-limit-configurable.patch @@ -0,0 +1,24 @@ +From 93b28fa5f8a98d8fe9567b0a197bd7e23d9cb84e Mon Sep 17 00:00:00 2001 +From: Jonas Konrad +Date: Tue, 22 Jul 2014 15:59:01 +0200 +Subject: [PATCH] Make "moved too quickly" limit configurable + + +diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java +index 7e774f2..2a23a4e 100644 +--- a/src/main/java/org/spigotmc/SpigotConfig.java ++++ b/src/main/java/org/spigotmc/SpigotConfig.java +@@ -340,4 +340,10 @@ public class SpigotConfig + { + movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D ); + } ++ ++ public static double movedTooQuicklyThreshold; ++ private static void movedTooQuicklyThreshold() ++ { ++ movedTooQuicklyThreshold = getDouble( "settings.moved-too-quickly-threshold", 100.0D ); ++ } + } +-- +2.5.0 + diff --git a/CraftBukkit-Patches/0136-Apply-NBTReadLimiter-to-more-things.patch b/CraftBukkit-Patches/0125-Apply-NBTReadLimiter-to-more-things.patch similarity index 96% rename from CraftBukkit-Patches/0136-Apply-NBTReadLimiter-to-more-things.patch rename to CraftBukkit-Patches/0125-Apply-NBTReadLimiter-to-more-things.patch index 40a308383e..aa3040b3e7 100644 --- a/CraftBukkit-Patches/0136-Apply-NBTReadLimiter-to-more-things.patch +++ b/CraftBukkit-Patches/0125-Apply-NBTReadLimiter-to-more-things.patch @@ -1,4 +1,4 @@ -From 828f70cff22e47607ef0d152f4f6c46bbc71230c Mon Sep 17 00:00:00 2001 +From 4f76cd8a788d4c9e8e96a68376514d806c083e51 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 27 Jul 2014 20:46:04 +1000 Subject: [PATCH] Apply NBTReadLimiter to more things. @@ -67,5 +67,5 @@ index 0000000..8c32e8b + } +} -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0137-Allow-Attribute-Capping.patch b/CraftBukkit-Patches/0126-Allow-Attribute-Capping.patch similarity index 84% rename from CraftBukkit-Patches/0137-Allow-Attribute-Capping.patch rename to CraftBukkit-Patches/0126-Allow-Attribute-Capping.patch index ab55fbe795..37c648f758 100644 --- a/CraftBukkit-Patches/0137-Allow-Attribute-Capping.patch +++ b/CraftBukkit-Patches/0126-Allow-Attribute-Capping.patch @@ -1,4 +1,4 @@ -From 8c1f3c1d533505cf492769301b6a2b7a613291cd Mon Sep 17 00:00:00 2001 +From 7cd90b5537aa9372401f7496c964eea8a0354e7b Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 28 Jul 2014 16:55:51 +1000 Subject: [PATCH] Allow Attribute Capping. @@ -19,22 +19,25 @@ index 13602f0..838daed 100644 public AttributeRanged(IAttribute iattribute, String s, double d0, double d1, double d2) { diff --git a/src/main/java/net/minecraft/server/GenericAttributes.java b/src/main/java/net/minecraft/server/GenericAttributes.java -index 3ed721a..0cc3e2f 100644 +index 16aaf1a..f43aa57 100644 --- a/src/main/java/net/minecraft/server/GenericAttributes.java +++ b/src/main/java/net/minecraft/server/GenericAttributes.java -@@ -9,11 +9,13 @@ import org.apache.logging.log4j.Logger; +@@ -9,14 +9,16 @@ import org.apache.logging.log4j.Logger; public class GenericAttributes { - private static final Logger f = LogManager.getLogger(); + private static final Logger i = LogManager.getLogger(); - public static final IAttribute maxHealth = (new AttributeRanged((IAttribute) null, "generic.maxHealth", 20.0D, 0.0D, 1024.0D)).a("Max Health").a(true); + // Spigot start -+ public static final IAttribute maxHealth = (new AttributeRanged((IAttribute) null, "generic.maxHealth", 20.0D, 0.1D, org.spigotmc.SpigotConfig.maxHealth)).a("Max Health").a(true); ++ public static final IAttribute maxHealth = (new AttributeRanged((IAttribute) null, "generic.maxHealth", 20.0D, 0.0D, org.spigotmc.SpigotConfig.maxHealth)).a("Max Health").a(true); public static final IAttribute FOLLOW_RANGE = (new AttributeRanged((IAttribute) null, "generic.followRange", 32.0D, 0.0D, 2048.0D)).a("Follow Range"); public static final IAttribute c = (new AttributeRanged((IAttribute) null, "generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).a("Knockback Resistance"); - public static final IAttribute MOVEMENT_SPEED = (new AttributeRanged((IAttribute) null, "generic.movementSpeed", 0.699999988079071D, 0.0D, 1024.0D)).a("Movement Speed").a(true); - public static final IAttribute ATTACK_DAMAGE = new AttributeRanged((IAttribute) null, "generic.attackDamage", 2.0D, 0.0D, 2048.0D); + public static final IAttribute MOVEMENT_SPEED = (new AttributeRanged((IAttribute) null, "generic.movementSpeed", 0.699999988079071D, 0.0D, org.spigotmc.SpigotConfig.movementSpeed)).a("Movement Speed").a(true); + public static final IAttribute ATTACK_DAMAGE = new AttributeRanged((IAttribute) null, "generic.attackDamage", 2.0D, 0.0D, org.spigotmc.SpigotConfig.attackDamage); + public static final IAttribute f = (new AttributeRanged((IAttribute) null, "generic.attackSpeed", 4.0D, 0.0D, 1024.0D)).a(true); + public static final IAttribute g = (new AttributeRanged((IAttribute) null, "generic.armor", 0.0D, 0.0D, 30.0D)).a(true); + public static final IAttribute h = (new AttributeRanged((IAttribute) null, "generic.luck", 0.0D, -1024.0D, 1024.0D)).a(true); + // Spigot end public static NBTTagList a(AttributeMapBase attributemapbase) { @@ -71,5 +74,5 @@ index 2a23a4e..a187598 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0138-Only-fetch-an-online-UUID-in-online-mode.patch b/CraftBukkit-Patches/0127-Only-fetch-an-online-UUID-in-online-mode.patch similarity index 80% rename from CraftBukkit-Patches/0138-Only-fetch-an-online-UUID-in-online-mode.patch rename to CraftBukkit-Patches/0127-Only-fetch-an-online-UUID-in-online-mode.patch index 3cd7c5005d..bf695ee47b 100644 --- a/CraftBukkit-Patches/0138-Only-fetch-an-online-UUID-in-online-mode.patch +++ b/CraftBukkit-Patches/0127-Only-fetch-an-online-UUID-in-online-mode.patch @@ -1,4 +1,4 @@ -From dc71404d250bca17b69aa1c06e22ab1be2796275 Mon Sep 17 00:00:00 2001 +From 94f94681f66dc7ae68a59a5746574386927fb190 Mon Sep 17 00:00:00 2001 From: Maxim Van de Wynckel Date: Wed, 30 Jul 2014 01:19:51 +0200 Subject: [PATCH] Only fetch an online UUID in online mode @@ -12,26 +12,26 @@ You want to store data for player "Test" who never joined. An online UUID is cr The player Test joins with an offline UUID but that will not match the online UUID of the saved data. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0548e76..33c6c59 100644 +index 8900e01..cabb3e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1290,8 +1290,14 @@ public final class CraftServer implements Server { +@@ -1296,8 +1296,14 @@ public final class CraftServer implements Server { OfflinePlayer result = getPlayerExact(name); if (result == null) { - // This is potentially blocking :( -- GameProfile profile = MinecraftServer.getServer().getUserCache().getProfile(name); +- GameProfile profile = console.getUserCache().getProfile(name); + // Spigot Start + GameProfile profile = null; + // Only fetch an online UUID in online mode + if ( MinecraftServer.getServer().getOnlineMode() || org.spigotmc.SpigotConfig.bungee ) + { -+ profile = MinecraftServer.getServer().getUserCache().getProfile( name ); ++ profile = console.getUserCache().getProfile( name ); + } + // Spigot end if (profile == null) { // Make an OfflinePlayer using an offline mode UUID since the name has no profile result = getOfflinePlayer(new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name)); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0139-Filter-attribute-modifiers-which-cause-the-attribute.patch b/CraftBukkit-Patches/0128-Filter-attribute-modifiers-which-cause-the-attribute.patch similarity index 98% rename from CraftBukkit-Patches/0139-Filter-attribute-modifiers-which-cause-the-attribute.patch rename to CraftBukkit-Patches/0128-Filter-attribute-modifiers-which-cause-the-attribute.patch index 51f3c04e12..2f1a283d2f 100644 --- a/CraftBukkit-Patches/0139-Filter-attribute-modifiers-which-cause-the-attribute.patch +++ b/CraftBukkit-Patches/0128-Filter-attribute-modifiers-which-cause-the-attribute.patch @@ -1,4 +1,4 @@ -From bebc5998602c0facf0282204a3f2ff4060618c25 Mon Sep 17 00:00:00 2001 +From 7f7b49e6a843d08349cadf7ad0a2c007f67b3f36 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Thu, 31 Jul 2014 17:48:20 +0100 Subject: [PATCH] Filter attribute modifiers which cause the attribute to go @@ -143,5 +143,5 @@ index 07ea6f6..2dac846 100644 if (!(nbttaglist.get(i) instanceof NBTTagCompound)) { continue; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0128-Fix-Slow-Loading-Libraries.patch b/CraftBukkit-Patches/0128-Fix-Slow-Loading-Libraries.patch deleted file mode 100644 index bcce14958b..0000000000 --- a/CraftBukkit-Patches/0128-Fix-Slow-Loading-Libraries.patch +++ /dev/null @@ -1,20 +0,0 @@ -From bf137a5718fbafd2b1c46dcb7b79f90996a1cf2a Mon Sep 17 00:00:00 2001 -From: md_5 -Date: Tue, 8 Jul 2014 20:27:52 +1000 -Subject: [PATCH] Fix Slow "Loading Libraries" - - -diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml -index 36eff85..08d68aa 100644 ---- a/src/main/resources/log4j2.xml -+++ b/src/main/resources/log4j2.xml -@@ -1,5 +1,5 @@ - -- -+ - - - --- -2.1.4 - diff --git a/CraftBukkit-Patches/0140-Plug-WorldMap-Memory-Leak.patch b/CraftBukkit-Patches/0129-Plug-WorldMap-Memory-Leak.patch similarity index 77% rename from CraftBukkit-Patches/0140-Plug-WorldMap-Memory-Leak.patch rename to CraftBukkit-Patches/0129-Plug-WorldMap-Memory-Leak.patch index e8b37cb605..1748cfe371 100644 --- a/CraftBukkit-Patches/0140-Plug-WorldMap-Memory-Leak.patch +++ b/CraftBukkit-Patches/0129-Plug-WorldMap-Memory-Leak.patch @@ -1,11 +1,11 @@ -From 14ba0bac64f727b84aa4aab30e05677315b3bf9b Mon Sep 17 00:00:00 2001 +From 1f9f586e2ad20431069bb4596cb6560300b33626 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 8 Aug 2014 19:57:03 +1000 Subject: [PATCH] Plug WorldMap Memory Leak diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java -index 4b8d548..451f481 100644 +index c29e3f7..6f013eb 100644 --- a/src/main/java/net/minecraft/server/PersistentCollection.java +++ b/src/main/java/net/minecraft/server/PersistentCollection.java @@ -18,7 +18,7 @@ public class PersistentCollection { @@ -18,10 +18,10 @@ index 4b8d548..451f481 100644 public PersistentCollection(IDataManager idatamanager) { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 5a4e9e7..60fa9ca 100644 +index bb49102..55468dc 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1084,6 +1084,23 @@ public abstract class World implements IBlockAccess { +@@ -1003,6 +1003,23 @@ public abstract class World implements IBlockAccess { entity.die(); if (entity instanceof EntityHuman) { this.players.remove(entity); @@ -31,8 +31,8 @@ index 5a4e9e7..60fa9ca 100644 + if ( o instanceof WorldMap ) + { + WorldMap map = (WorldMap) o; -+ map.i.remove( entity ); -+ for ( Iterator iter = (Iterator) map.g.iterator(); iter.hasNext(); ) ++ map.j.remove( entity ); ++ for ( Iterator iter = (Iterator) map.h.iterator(); iter.hasNext(); ) + { + if ( iter.next().trackee == entity ) + { @@ -43,21 +43,21 @@ index 5a4e9e7..60fa9ca 100644 + } + // Spigot end this.everyoneSleeping(); - this.b(entity); + this.c(entity); } diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java -index 0e03164..9772760 100644 +index bf53fe5..d0d7c9d 100644 --- a/src/main/java/net/minecraft/server/WorldMap.java +++ b/src/main/java/net/minecraft/server/WorldMap.java -@@ -22,7 +22,7 @@ public class WorldMap extends PersistentBase { +@@ -23,7 +23,7 @@ public class WorldMap extends PersistentBase { public byte scale; public byte[] colors = new byte[16384]; - public List g = Lists.newArrayList(); -- private Map i = Maps.newHashMap(); -+ public Map i = Maps.newHashMap(); // Spigot + public List h = Lists.newArrayList(); +- private Map j = Maps.newHashMap(); ++ public Map j = Maps.newHashMap(); // Spigot public Map decorations = Maps.newLinkedHashMap(); // CraftBukkit start -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0141-Fix-Corrupted-Trapped-Chest.patch b/CraftBukkit-Patches/0130-Fix-Corrupted-Trapped-Chest.patch similarity index 85% rename from CraftBukkit-Patches/0141-Fix-Corrupted-Trapped-Chest.patch rename to CraftBukkit-Patches/0130-Fix-Corrupted-Trapped-Chest.patch index fd5fdf46b0..ec8687b7e2 100644 --- a/CraftBukkit-Patches/0141-Fix-Corrupted-Trapped-Chest.patch +++ b/CraftBukkit-Patches/0130-Fix-Corrupted-Trapped-Chest.patch @@ -1,4 +1,4 @@ -From 77c78866dba86d58c6ae8ea82fdce606b7164a38 Mon Sep 17 00:00:00 2001 +From 6017088e79cf6cf6cedf9b6f61ed67f7e89fb1a7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 15 Aug 2014 00:56:41 -0400 Subject: [PATCH] Fix Corrupted Trapped Chest @@ -9,10 +9,10 @@ If a Trapped Chest gets its Tile Entity corrupted, it will crash the server ever 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 8a1165c..33d017b 100644 +index 7823174..0d6f5af 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -126,7 +126,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { +@@ -122,7 +122,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { TileEntity result = super.getTileEntity(pos); Block type = getType(pos).getBlock(); @@ -22,5 +22,5 @@ index 8a1165c..33d017b 100644 result = fixTileEntity(pos, type, result); } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0142-Remove-uneeded-validation.patch b/CraftBukkit-Patches/0131-Remove-uneeded-validation.patch similarity index 96% rename from CraftBukkit-Patches/0142-Remove-uneeded-validation.patch rename to CraftBukkit-Patches/0131-Remove-uneeded-validation.patch index ce1d7807a2..0360f49cd8 100644 --- a/CraftBukkit-Patches/0142-Remove-uneeded-validation.patch +++ b/CraftBukkit-Patches/0131-Remove-uneeded-validation.patch @@ -1,4 +1,4 @@ -From 3e731738ced0c87cd5f03fd0c54ab1edfa5613ab Mon Sep 17 00:00:00 2001 +From 643832eb5bb34fe157f8e1795153bb6b735b1a4a Mon Sep 17 00:00:00 2001 From: drXor Date: Fri, 15 Aug 2014 18:11:09 -0400 Subject: [PATCH] Remove uneeded validation @@ -43,5 +43,5 @@ index 2dac846..e3d3424 100644 public boolean hasEnchants() { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0143-Add-Hunger-Config-Values.patch b/CraftBukkit-Patches/0132-Add-Hunger-Config-Values.patch similarity index 79% rename from CraftBukkit-Patches/0143-Add-Hunger-Config-Values.patch rename to CraftBukkit-Patches/0132-Add-Hunger-Config-Values.patch index 8de1353553..027854d3b1 100644 --- a/CraftBukkit-Patches/0143-Add-Hunger-Config-Values.patch +++ b/CraftBukkit-Patches/0132-Add-Hunger-Config-Values.patch @@ -1,25 +1,25 @@ -From c3af668438118d457866a2340ad0776adc0f8da9 Mon Sep 17 00:00:00 2001 +From b86c56dc176b1d29be41bcf982cbf6c300896b33 Mon Sep 17 00:00:00 2001 From: lazertester Date: Sun, 17 Aug 2014 19:56:17 +1000 Subject: [PATCH] Add Hunger Config Values diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 17c9f64..67a0337 100644 +index b7355b0..b405d3c 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1084,7 +1084,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1138,7 +1138,7 @@ public abstract class EntityHuman extends EntityLiving { } } - this.applyExhaustion(0.3F); + this.applyExhaustion(world.spigotConfig.combatExhaustion); // Spigot - Change to use configurable value - } else if (flag1) { - entity.extinguish(); - } -@@ -1331,9 +1331,9 @@ public abstract class EntityHuman extends EntityLiving { - super.bF(); - this.b(StatisticList.u); + } else { + this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, SoundEffects.dY, this.bz(), 1.0F, 1.0F); + if (flag4) { +@@ -1405,9 +1405,9 @@ public abstract class EntityHuman extends EntityLiving { + super.ch(); + this.b(StatisticList.w); if (this.isSprinting()) { - this.applyExhaustion(0.8F); + this.applyExhaustion(world.spigotConfig.sprintExhaustion); // Spigot - Change to use configurable value @@ -30,23 +30,23 @@ index 17c9f64..67a0337 100644 } diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java -index 2505a78..d0bcad6 100644 +index 7fa3a33..ccd7a46 100644 --- a/src/main/java/net/minecraft/server/FoodMetaData.java +++ b/src/main/java/net/minecraft/server/FoodMetaData.java -@@ -63,7 +63,7 @@ public class FoodMetaData { +@@ -74,7 +74,7 @@ public class FoodMetaData { if (this.foodTickTimer >= 80) { // CraftBukkit - added RegainReason entityhuman.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); -- this.a(3.0F); +- this.a(4.0F); + this.a(entityhuman.world.spigotConfig.regenExhaustion); // Spigot - Change to use configurable value this.foodTickTimer = 0; } } else if (this.foodLevel <= 0) { diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index b19558b..0f9b67c 100644 +index 7cf8f2d..4cbcd14 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -303,4 +303,16 @@ public class SpigotWorldConfig +@@ -252,4 +252,16 @@ public class SpigotWorldConfig largeFeatureSeed = getInt( "seed-feature", 14357617 ); log( "Custom Map Seeds: Village: " + villageSeed + " Feature: " + largeFeatureSeed ); } @@ -64,5 +64,5 @@ index b19558b..0f9b67c 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0144-Make-debug-logging-togglable.patch b/CraftBukkit-Patches/0133-Make-debug-logging-togglable.patch similarity index 97% rename from CraftBukkit-Patches/0144-Make-debug-logging-togglable.patch rename to CraftBukkit-Patches/0133-Make-debug-logging-togglable.patch index b7886bc4cf..e05b66c06f 100644 --- a/CraftBukkit-Patches/0144-Make-debug-logging-togglable.patch +++ b/CraftBukkit-Patches/0133-Make-debug-logging-togglable.patch @@ -1,4 +1,4 @@ -From c11e87b8641201bbfd08f766f27d6755241a17e5 Mon Sep 17 00:00:00 2001 +From 7dc51aec59043404fb3a1022fb438f2c3c09d190 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Sun, 17 Aug 2014 12:42:53 +0200 Subject: [PATCH] Make debug logging togglable. @@ -63,5 +63,5 @@ index 08d68aa..f37d1c2 100644 -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0133-Make-moved-wrongly-limit-configurable.patch b/CraftBukkit-Patches/0133-Make-moved-wrongly-limit-configurable.patch deleted file mode 100644 index 5e446fd587..0000000000 --- a/CraftBukkit-Patches/0133-Make-moved-wrongly-limit-configurable.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 52cbaa24c5487aa00a82e16acd4e264400cf9914 Mon Sep 17 00:00:00 2001 -From: Jonas Konrad -Date: Fri, 4 Jul 2014 23:03:13 +0200 -Subject: [PATCH] Make "moved wrongly" limit configurable - - -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index bca1058..44834ce 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -418,7 +418,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - d15 = d11 * d11 + d12 * d12 + d13 * d13; - boolean flag1 = false; - -- if (d15 > 0.0625D && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative()) { -+ // Spigot: make "moved wrongly" limit configurable -+ if (d15 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative()) { - flag1 = true; - PlayerConnection.c.warn(this.player.getName() + " moved wrongly!"); - } -diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 921d7d5..7e774f2 100644 ---- a/src/main/java/org/spigotmc/SpigotConfig.java -+++ b/src/main/java/org/spigotmc/SpigotConfig.java -@@ -334,4 +334,10 @@ public class SpigotConfig - { - intCacheLimit = getInt( "settings.int-cache-limit", 1024 ); - } -+ -+ public static double movedWronglyThreshold; -+ private static void movedWronglyThreshold() -+ { -+ movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D ); -+ } - } --- -2.1.4 - diff --git a/CraftBukkit-Patches/0145-Skip-invalid-enchants-in-CraftMetaItem.patch b/CraftBukkit-Patches/0134-Skip-invalid-enchants-in-CraftMetaItem.patch similarity index 94% rename from CraftBukkit-Patches/0145-Skip-invalid-enchants-in-CraftMetaItem.patch rename to CraftBukkit-Patches/0134-Skip-invalid-enchants-in-CraftMetaItem.patch index 1fa2696622..3b4a532e99 100644 --- a/CraftBukkit-Patches/0145-Skip-invalid-enchants-in-CraftMetaItem.patch +++ b/CraftBukkit-Patches/0134-Skip-invalid-enchants-in-CraftMetaItem.patch @@ -1,4 +1,4 @@ -From fd3dd337c8a095fdc855e9053dfeb1b99820445f Mon Sep 17 00:00:00 2001 +From f2e740f9d48e3f5ab8879c87d81cf30e881534f9 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Tue, 19 Aug 2014 11:04:21 +0100 Subject: [PATCH] Skip invalid enchants in CraftMetaItem @@ -25,5 +25,5 @@ index e3d3424..dcb9252 100644 return enchantments; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0146-Limit-TNT-Detonations-per-tick.patch b/CraftBukkit-Patches/0135-Limit-TNT-Detonations-per-tick.patch similarity index 81% rename from CraftBukkit-Patches/0146-Limit-TNT-Detonations-per-tick.patch rename to CraftBukkit-Patches/0135-Limit-TNT-Detonations-per-tick.patch index edc171474b..22e8445d57 100644 --- a/CraftBukkit-Patches/0146-Limit-TNT-Detonations-per-tick.patch +++ b/CraftBukkit-Patches/0135-Limit-TNT-Detonations-per-tick.patch @@ -1,4 +1,4 @@ -From 4643d3aca507105b0884925d7b0921bccd197e7f Mon Sep 17 00:00:00 2001 +From 5812a23872e2c522bc10842956f65d1e5101b619 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 @@ -7,34 +7,34 @@ 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 10f6e47..2d22327 100644 +index e467aff..35ed2a6 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -@@ -41,6 +41,7 @@ public class EntityTNTPrimed extends Entity { +@@ -45,6 +45,7 @@ public class EntityTNTPrimed extends Entity { } - public void t_() { + public void m() { + 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 33d017b..6755143 100644 +index 0d6f5af..c2ca2df 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -595,6 +595,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - } +@@ -625,6 +625,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + this.worldProvider.r(); super.tickEntities(); + spigotConfig.currentPrimedTnt = 0; // Spigot } - public void j() { + protected void l() { diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 0f9b67c..e2d673f 100644 +index 4cbcd14..a4d7ebb 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -315,4 +315,15 @@ public class SpigotWorldConfig +@@ -264,4 +264,15 @@ public class SpigotWorldConfig combatExhaustion = (float) getDouble( "hunger.combat-exhaustion", 0.3 ); regenExhaustion = (float) getDouble( "hunger.regen-exhaustion", 3 ); } @@ -51,5 +51,5 @@ index 0f9b67c..e2d673f 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0135-Make-moved-too-quickly-limit-configurable.patch b/CraftBukkit-Patches/0135-Make-moved-too-quickly-limit-configurable.patch deleted file mode 100644 index c7b17d6526..0000000000 --- a/CraftBukkit-Patches/0135-Make-moved-too-quickly-limit-configurable.patch +++ /dev/null @@ -1,38 +0,0 @@ -From a5a3945c78dc3ef73045877c01e8854a95314ef3 Mon Sep 17 00:00:00 2001 -From: Jonas Konrad -Date: Tue, 22 Jul 2014 15:59:01 +0200 -Subject: [PATCH] Make "moved too quickly" limit configurable - - -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 44834ce..6f630b8 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -391,7 +391,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList - double d14 = this.player.motX * this.player.motX + this.player.motY * this.player.motY + this.player.motZ * this.player.motZ; - double d15 = d11 * d11 + d12 * d12 + d13 * d13; - -- if (d15 - d14 > 100.0D && this.checkMovement && (!this.minecraftServer.T() || !this.minecraftServer.S().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports -+ // Spigot: make "moved too quickly" limit configurable -+ if (d15 - d14 > org.spigotmc.SpigotConfig.movedTooQuicklyThreshold && this.checkMovement && (!this.minecraftServer.T() || !this.minecraftServer.S().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports - PlayerConnection.c.warn(this.player.getName() + " moved too quickly! " + d11 + "," + d12 + "," + d13 + " (" + d11 + ", " + d12 + ", " + d13 + ")"); - this.a(this.o, this.p, this.q, this.player.yaw, this.player.pitch); - return; -diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 7e774f2..2a23a4e 100644 ---- a/src/main/java/org/spigotmc/SpigotConfig.java -+++ b/src/main/java/org/spigotmc/SpigotConfig.java -@@ -340,4 +340,10 @@ public class SpigotConfig - { - movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D ); - } -+ -+ public static double movedTooQuicklyThreshold; -+ private static void movedTooQuicklyThreshold() -+ { -+ movedTooQuicklyThreshold = getDouble( "settings.moved-too-quickly-threshold", 100.0D ); -+ } - } --- -2.1.4 - diff --git a/CraftBukkit-Patches/0147-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch b/CraftBukkit-Patches/0136-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch similarity index 98% rename from CraftBukkit-Patches/0147-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch rename to CraftBukkit-Patches/0136-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch index 17cc958482..cffe8139aa 100644 --- a/CraftBukkit-Patches/0147-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch +++ b/CraftBukkit-Patches/0136-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch @@ -1,4 +1,4 @@ -From 38a5eeda8635f6ae1ca939f83dc00d2d8dd5e9fc Mon Sep 17 00:00:00 2001 +From 7e931f72c4b52af11333041f2da4f348509f6991 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 22 Aug 2014 05:35:16 -0400 Subject: [PATCH] Added isUnbreakable and setUnbreakable to ItemMeta @@ -139,5 +139,5 @@ index dcb9252..eaaa6a1 100644 @Override -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0148-Configurable-Hanging-Tick.patch b/CraftBukkit-Patches/0137-Configurable-Hanging-Tick.patch similarity index 71% rename from CraftBukkit-Patches/0148-Configurable-Hanging-Tick.patch rename to CraftBukkit-Patches/0137-Configurable-Hanging-Tick.patch index b4a283b5ce..9133613631 100644 --- a/CraftBukkit-Patches/0148-Configurable-Hanging-Tick.patch +++ b/CraftBukkit-Patches/0137-Configurable-Hanging-Tick.patch @@ -1,27 +1,27 @@ -From a476dbf685e3d8dde6453ff399a6a9ebd04782ae Mon Sep 17 00:00:00 2001 +From f9752410ca21d1c992996760cf70abc4665f8384 Mon Sep 17 00:00:00 2001 From: drXor Date: Sat, 9 Aug 2014 13:56:51 -0400 Subject: [PATCH] Configurable Hanging Tick diff --git a/src/main/java/net/minecraft/server/EntityHanging.java b/src/main/java/net/minecraft/server/EntityHanging.java -index b93e317..f374c39 100644 +index 0ff4df1..947c777 100644 --- a/src/main/java/net/minecraft/server/EntityHanging.java +++ b/src/main/java/net/minecraft/server/EntityHanging.java -@@ -96,7 +96,7 @@ public abstract class EntityHanging extends Entity { +@@ -103,7 +103,7 @@ public abstract class EntityHanging extends Entity { this.lastX = this.locX; this.lastY = this.locY; this.lastZ = this.locZ; -- if (this.c++ == 100 && !this.world.isClientSide) { -+ if (this.c++ == this.world.spigotConfig.hangingTickFrequency && !this.world.isClientSide) { - this.c = 0; +- if (this.d++ == 100 && !this.world.isClientSide) { ++ if (this.d++ == this.world.spigotConfig.hangingTickFrequency && !this.world.isClientSide) { // Spigot + this.d = 0; if (!this.dead && !this.survives()) { // CraftBukkit start - fire break events diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index e2d673f..ab2f8bf 100644 +index a4d7ebb..8b40760 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -326,4 +326,10 @@ public class SpigotWorldConfig +@@ -275,4 +275,10 @@ public class SpigotWorldConfig maxTntTicksPerTick = getInt( "max-tnt-per-tick", 100 ); log( "Max TNT Explosions: " + maxTntTicksPerTick ); } @@ -33,5 +33,5 @@ index e2d673f..ab2f8bf 100644 + } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0149-Refactor-ItemDoor-Place.patch b/CraftBukkit-Patches/0138-Refactor-ItemDoor-Place.patch similarity index 70% rename from CraftBukkit-Patches/0149-Refactor-ItemDoor-Place.patch rename to CraftBukkit-Patches/0138-Refactor-ItemDoor-Place.patch index 09e3a652f6..bb46acd737 100644 --- a/CraftBukkit-Patches/0149-Refactor-ItemDoor-Place.patch +++ b/CraftBukkit-Patches/0138-Refactor-ItemDoor-Place.patch @@ -1,16 +1,16 @@ -From 90cb302d6c181c0f8751bf726b81a69030985e89 Mon Sep 17 00:00:00 2001 +From 32345e53860c30cac70298b836464fd0dea16503 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 30 Sep 2014 21:43:15 +1000 Subject: [PATCH] Refactor ItemDoor Place diff --git a/src/main/java/net/minecraft/server/ItemDoor.java b/src/main/java/net/minecraft/server/ItemDoor.java -index eef43df..6e92cab 100644 +index 669940a..adaa131 100644 --- a/src/main/java/net/minecraft/server/ItemDoor.java +++ b/src/main/java/net/minecraft/server/ItemDoor.java -@@ -48,9 +48,11 @@ public class ItemDoor extends Item { - BlockPosition blockposition3 = blockposition.up(); - IBlockData iblockdata = block.getBlockData().set(BlockDoor.FACING, enumdirection).set(BlockDoor.HINGE, flag2 ? BlockDoor.EnumDoorHinge.RIGHT : BlockDoor.EnumDoorHinge.LEFT); +@@ -58,9 +58,11 @@ public class ItemDoor extends Item { + boolean flag3 = world.isBlockIndirectlyPowered(blockposition) || world.isBlockIndirectlyPowered(blockposition3); + IBlockData iblockdata = block.getBlockData().set(BlockDoor.FACING, enumdirection).set(BlockDoor.HINGE, flag ? BlockDoor.EnumDoorHinge.RIGHT : BlockDoor.EnumDoorHinge.LEFT).set(BlockDoor.POWERED, Boolean.valueOf(flag3)).set(BlockDoor.OPEN, Boolean.valueOf(flag3)); - world.setTypeAndData(blockposition, iblockdata.set(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER), 2); - world.setTypeAndData(blockposition3, iblockdata.set(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 2); @@ -25,5 +25,5 @@ index eef43df..6e92cab 100644 } } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0150-BungeeCord-Chat-API.patch b/CraftBukkit-Patches/0139-BungeeCord-Chat-API.patch similarity index 68% rename from CraftBukkit-Patches/0150-BungeeCord-Chat-API.patch rename to CraftBukkit-Patches/0139-BungeeCord-Chat-API.patch index 2110b53ad1..9c2a7ca9e4 100644 --- a/CraftBukkit-Patches/0150-BungeeCord-Chat-API.patch +++ b/CraftBukkit-Patches/0139-BungeeCord-Chat-API.patch @@ -1,42 +1,26 @@ -From 771afc9a0280dc580fba5dee3fd2d942c5bd3676 Mon Sep 17 00:00:00 2001 +From 7a050d4577022432d8be15a1d308a61197f34aeb Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 13 Dec 2014 13:06:05 +1100 Subject: [PATCH] BungeeCord Chat API diff --git a/src/main/java/net/minecraft/server/PacketPlayOutChat.java b/src/main/java/net/minecraft/server/PacketPlayOutChat.java -new file mode 100644 -index 0000000..6cd5df2 ---- /dev/null +index c5147b6..c0e1199 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutChat.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutChat.java -@@ -0,0 +1,45 @@ -+package net.minecraft.server; -+ -+import java.io.IOException; -+ -+public class PacketPlayOutChat implements Packet { -+ -+ private IChatBaseComponent a; +@@ -5,6 +5,7 @@ import java.io.IOException; + public class PacketPlayOutChat implements Packet { + + private IChatBaseComponent a; + public net.md_5.bungee.api.chat.BaseComponent[] components; // Spigot -+ private byte b; -+ -+ public PacketPlayOutChat() {} -+ -+ public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent) { -+ this(ichatbasecomponent, (byte) 1); -+ } -+ -+ public PacketPlayOutChat(IChatBaseComponent ichatbasecomponent, byte b0) { -+ this.a = ichatbasecomponent; -+ this.b = b0; -+ } -+ -+ public void a(PacketDataSerializer packetdataserializer) throws IOException { -+ this.a = packetdataserializer.d(); -+ this.b = packetdataserializer.readByte(); -+ } -+ -+ public void b(PacketDataSerializer packetdataserializer) throws IOException { + private byte b; + + public PacketPlayOutChat() {} +@@ -24,7 +25,13 @@ public class PacketPlayOutChat implements Packet { + } + + public void b(PacketDataSerializer packetdataserializer) throws IOException { +- packetdataserializer.a(this.a); + // Spigot start + if (components != null) { + packetdataserializer.a(net.md_5.bungee.chat.ComponentSerializer.toString(components)); @@ -44,22 +28,14 @@ index 0000000..6cd5df2 + packetdataserializer.a(this.a); + } + // Spigot end -+ packetdataserializer.writeByte(this.b); -+ } -+ -+ public void a(PacketListenerPlayOut packetlistenerplayout) { -+ packetlistenerplayout.a(this); -+ } -+ -+ public boolean b() { -+ return this.b == 1 || this.b == 2; -+ } -+} + packetdataserializer.writeByte(this.b); + } + diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 33c6c59..f57c785 100644 +index cabb3e5..7831a12 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -122,6 +122,7 @@ import io.netty.buffer.ByteBufOutputStream; +@@ -126,6 +126,7 @@ import io.netty.buffer.ByteBufOutputStream; import io.netty.buffer.Unpooled; import io.netty.handler.codec.base64.Base64; import jline.console.ConsoleReader; @@ -67,7 +43,7 @@ index 33c6c59..f57c785 100644 public final class CraftServer implements Server { private static final Player[] EMPTY_PLAYER_ARRAY = new Player[0]; -@@ -1710,6 +1711,20 @@ public final class CraftServer implements Server { +@@ -1721,6 +1722,20 @@ public final class CraftServer implements Server { public void restart() { org.spigotmc.RestartCommand.restart(); } @@ -89,7 +65,7 @@ index 33c6c59..f57c785 100644 public Spigot spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 95c5fb3..35608b7 100644 +index b1521b6..9298344 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -19,6 +19,7 @@ import java.util.Set; @@ -100,7 +76,7 @@ index 95c5fb3..35608b7 100644 import net.minecraft.server.*; import net.minecraft.server.PacketPlayOutTitle.EnumTitleAction; -@@ -1455,6 +1456,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1521,6 +1522,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return java.util.Collections.unmodifiableSet( ret ); } @@ -122,5 +98,5 @@ index 95c5fb3..35608b7 100644 public Player.Spigot spigot() -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0151-Use-Standard-List-for-EntitySlices.patch b/CraftBukkit-Patches/0140-Use-Standard-List-for-EntitySlices.patch similarity index 80% rename from CraftBukkit-Patches/0151-Use-Standard-List-for-EntitySlices.patch rename to CraftBukkit-Patches/0140-Use-Standard-List-for-EntitySlices.patch index f9d5c94a9e..41933ea8b0 100644 --- a/CraftBukkit-Patches/0151-Use-Standard-List-for-EntitySlices.patch +++ b/CraftBukkit-Patches/0140-Use-Standard-List-for-EntitySlices.patch @@ -1,26 +1,26 @@ -From 15f5ebb6c66c7d1096a2fc1c9b518487e4fd090b Mon Sep 17 00:00:00 2001 +From 8e895caab5ed128184d88c328472f900b88a4a2b Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 20 Feb 2015 21:33:36 +1100 Subject: [PATCH] Use Standard List for EntitySlices. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 994903f..022ba31 100644 +index 277a6ad..f2bb134 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -31,7 +31,7 @@ public class Chunk { +@@ -32,7 +32,7 @@ public class Chunk { public final int locZ; - private boolean k; + private boolean l; public final Map tileEntities; - public final EntitySlice[] entitySlices; + public final List[] entitySlices; // Spigot private boolean done; private boolean lit; - private boolean p; -@@ -80,14 +80,14 @@ public class Chunk { + private boolean q; +@@ -81,14 +81,14 @@ public class Chunk { this.tileEntities = Maps.newHashMap(); - this.v = 4096; - this.w = Queues.newConcurrentLinkedQueue(); + this.w = 4096; + this.x = Queues.newConcurrentLinkedQueue(); - this.entitySlices = (EntitySlice[]) (new EntitySlice[16]); + this.entitySlices = (List[]) (new List[16]); // Spigot this.world = world; @@ -33,8 +33,8 @@ index 994903f..022ba31 100644 + this.entitySlices[k] = new org.bukkit.craftbukkit.util.UnsafeList(); // Spigot } - Arrays.fill(this.f, -999); -@@ -924,12 +924,12 @@ public class Chunk { + Arrays.fill(this.g, -999); +@@ -857,12 +857,12 @@ public class Chunk { j = MathHelper.clamp(j, 0, this.entitySlices.length - 1); for (int k = i; k <= j; ++k) { @@ -49,7 +49,7 @@ index 994903f..022ba31 100644 list.add((T) entity); // Fix decompile error } } -@@ -1309,7 +1309,7 @@ public class Chunk { +@@ -1260,7 +1260,7 @@ public class Chunk { return this.tileEntities; } @@ -59,10 +59,17 @@ index 994903f..022ba31 100644 } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index ccf6d93..d8d54bd 100644 +index 70d8ab1..d88f1b1 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -143,9 +143,9 @@ public class ActivationRange +@@ -1,5 +1,6 @@ + package org.spigotmc; + ++import java.util.List; + import java.util.Set; + import net.minecraft.server.AxisAlignedBB; + import net.minecraft.server.Chunk; +@@ -140,9 +141,9 @@ public class ActivationRange */ private static void activateChunkEntities(Chunk chunk) { @@ -75,5 +82,5 @@ index ccf6d93..d8d54bd 100644 if ( MinecraftServer.currentTick > entity.activatedTick ) { -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0152-Allow-Capping-Tile-Entity-Tick-Time.patch b/CraftBukkit-Patches/0141-Allow-Capping-Tile-Entity-Tick-Time.patch similarity index 76% rename from CraftBukkit-Patches/0152-Allow-Capping-Tile-Entity-Tick-Time.patch rename to CraftBukkit-Patches/0141-Allow-Capping-Tile-Entity-Tick-Time.patch index 39285ecc88..fea868af41 100644 --- a/CraftBukkit-Patches/0152-Allow-Capping-Tile-Entity-Tick-Time.patch +++ b/CraftBukkit-Patches/0141-Allow-Capping-Tile-Entity-Tick-Time.patch @@ -1,4 +1,4 @@ -From 45a637328912612c12a4558770581b495ed6fe04 Mon Sep 17 00:00:00 2001 +From a3d56cde333f32d169ecb02f997126a45a2b3cbf Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 20 Feb 2015 21:39:31 +1100 Subject: [PATCH] Allow Capping (Tile)Entity Tick Time. @@ -10,29 +10,29 @@ For tiles there is very little tradeoff for this option, as tile ticks are based This feature was commisioned by Chunkr. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 60fa9ca..eca86db 100644 +index 55468dc..833d5a4 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -137,6 +137,9 @@ public abstract class World implements IBlockAccess { - private final byte chunkTickRadius; +@@ -129,6 +129,9 @@ public abstract class World implements IBlockAccess { + private boolean guardEntityList; // Spigot public static boolean haveWeSilencedAPhysicsCrash; public static String blockLocation; + private org.spigotmc.TickLimiter entityLimiter; + private org.spigotmc.TickLimiter tileLimiter; + private int tileTickPosition; - public static long chunkToKey(int x, int z) - { -@@ -225,6 +228,8 @@ public abstract class World implements IBlockAccess { - this.getServer().addWorld(this.world); - // CraftBukkit end - timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings -+ this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); + public CraftWorld getWorld() { + return this.world; +@@ -163,6 +166,8 @@ public abstract class World implements IBlockAccess { + this.N = worldprovider.getWorldBorder(); + this.getServer().addWorld(this.world); // CraftBukkit + timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings ++ this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); + this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } public World b() { -@@ -1396,7 +1401,12 @@ public abstract class World implements IBlockAccess { +@@ -1361,7 +1366,12 @@ public abstract class World implements IBlockAccess { timings.entityTick.startTiming(); // Spigot guardEntityList = true; // Spigot // CraftBukkit start - Use field for loop variable @@ -45,46 +45,47 @@ index 60fa9ca..eca86db 100644 + tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0; entity = (Entity) this.entityList.get(this.tickPosition); // CraftBukkit end - if (entity.vehicle != null) { -@@ -1452,14 +1462,19 @@ public abstract class World implements IBlockAccess { - this.c.clear(); + Entity entity1 = entity.by(); +@@ -1418,14 +1428,20 @@ public abstract class World implements IBlockAccess { + this.tileEntityListUnload.clear(); } // CraftBukkit end -- Iterator iterator = this.tileEntityList.iterator(); +- Iterator iterator = this.tileEntityListTick.iterator(); - while (iterator.hasNext()) { - TileEntity tileentity = (TileEntity) iterator.next(); + // Spigot start ++ // Iterator iterator = this.tileEntityListTick.iterator(); + int tilesThisCycle = 0; + for (tileLimiter.initTick(); -+ tilesThisCycle < tileEntityList.size() && (tilesThisCycle % 10 != 0 || tileLimiter.shouldContinue()); ++ tilesThisCycle < tileEntityListTick.size() && (tilesThisCycle % 10 != 0 || tileLimiter.shouldContinue()); + tileTickPosition++, tilesThisCycle++) { -+ tileTickPosition = (tileTickPosition < tileEntityList.size()) ? tileTickPosition : 0; -+ TileEntity tileentity = (TileEntity) this.tileEntityList.get(tileTickPosition); ++ tileTickPosition = (tileTickPosition < tileEntityListTick.size()) ? tileTickPosition : 0; ++ TileEntity tileentity = (TileEntity) this.tileEntityListTick.get(tileTickPosition); // Spigot start if (tileentity == null) { getServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash"); - iterator.remove(); + tilesThisCycle--; -+ this.tileEntityList.remove(tileTickPosition--); ++ this.tileEntityListTick.remove(tileTickPosition--); continue; } // Spigot end -@@ -1487,7 +1502,8 @@ public abstract class World implements IBlockAccess { +@@ -1454,7 +1470,8 @@ public abstract class World implements IBlockAccess { } if (tileentity.x()) { - iterator.remove(); + tilesThisCycle--; -+ this.tileEntityList.remove(tileTickPosition--); - this.h.remove(tileentity); ++ this.tileEntityListTick.remove(tileTickPosition--); + this.tileEntityList.remove(tileentity); if (this.isLoaded(tileentity.getPosition())) { - this.getChunkAtWorldCoords(tileentity.getPosition()).e(tileentity.getPosition()); + this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition()); diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index ab2f8bf..8e86212 100644 +index 8b40760..43242a8 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -332,4 +332,13 @@ public class SpigotWorldConfig +@@ -281,4 +281,13 @@ public class SpigotWorldConfig { hangingTickFrequency = getInt( "hanging-tick-frequency", 100 ); } @@ -125,5 +126,5 @@ index 0000000..23a3938 + } +} -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0153-Use-FastMatches-for-ItemStack-Dirty-Check.patch b/CraftBukkit-Patches/0142-Use-FastMatches-for-ItemStack-Dirty-Check.patch similarity index 92% rename from CraftBukkit-Patches/0153-Use-FastMatches-for-ItemStack-Dirty-Check.patch rename to CraftBukkit-Patches/0142-Use-FastMatches-for-ItemStack-Dirty-Check.patch index 8b3ad3cd64..338253a2d3 100644 --- a/CraftBukkit-Patches/0153-Use-FastMatches-for-ItemStack-Dirty-Check.patch +++ b/CraftBukkit-Patches/0142-Use-FastMatches-for-ItemStack-Dirty-Check.patch @@ -1,4 +1,4 @@ -From 9f870cc994c0981b84b9efa460b07a60ec9250ec Mon Sep 17 00:00:00 2001 +From f4e0d698393bd3394f42e040a5af7ba28fc39acf Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 22 Feb 2015 12:27:40 +1100 Subject: [PATCH] Use FastMatches for ItemStack Dirty Check @@ -6,7 +6,7 @@ Subject: [PATCH] Use FastMatches for ItemStack Dirty Check The check to find dirty itemstacks and send update packets each tick can be very intensive as it checks the entire itemstack, including the entire NBT map. To save on this, 19/20 times we will simply compare the basic count/data/type. If for some strange reason the NBT of an item already existing in an inventory is changes, it will take up to 1 second to show, with an average time of half a second. This odd 0.5 second delay is far preferable to lag every tick, and shouldn't be noticed by anyone. diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java -index 9c53acd..3e29730 100644 +index 1d6ec51..000b4db 100644 --- a/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java @@ -28,6 +28,7 @@ public abstract class Container { @@ -35,10 +35,10 @@ index 9c53acd..3e29730 100644 } diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 6808a46..dbef942 100644 +index 3d02391..a649192 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -455,6 +455,18 @@ public final class ItemStack { +@@ -448,6 +448,18 @@ public final class ItemStack { return itemstack == null && itemstack1 == null ? true : (itemstack != null && itemstack1 != null ? (itemstack.tag == null && itemstack1.tag != null ? false : itemstack.tag == null || itemstack.tag.equals(itemstack1.tag)) : false); } @@ -55,8 +55,8 @@ index 6808a46..dbef942 100644 + // Spigot End + public static boolean matches(ItemStack itemstack, ItemStack itemstack1) { - return itemstack == null && itemstack1 == null ? true : (itemstack != null && itemstack1 != null ? itemstack.d(itemstack1) : false); + return itemstack == null && itemstack1 == null ? true : (itemstack != null && itemstack1 != null ? itemstack.e(itemstack1) : false); } -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0154-Use-CLQ-for-main-thread-tasks.patch b/CraftBukkit-Patches/0143-Use-CLQ-for-main-thread-tasks.patch similarity index 79% rename from CraftBukkit-Patches/0154-Use-CLQ-for-main-thread-tasks.patch rename to CraftBukkit-Patches/0143-Use-CLQ-for-main-thread-tasks.patch index 15fc2281aa..17f9ab9513 100644 --- a/CraftBukkit-Patches/0154-Use-CLQ-for-main-thread-tasks.patch +++ b/CraftBukkit-Patches/0143-Use-CLQ-for-main-thread-tasks.patch @@ -1,23 +1,23 @@ -From 4b4dbc75c3c618e917893695727b995edbc32dac Mon Sep 17 00:00:00 2001 +From 83522bc67098adbbc47cc5b1fed3a5e4b2e05936 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 19 Apr 2015 09:19:39 +1000 Subject: [PATCH] Use CLQ for main thread tasks. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9bf5415..1d29ae7 100644 +index 28b1679..c754675 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -100,7 +100,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs - private long X = 0L; - private final GameProfileRepository Y; - private final UserCache Z; +@@ -98,7 +98,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + private final GameProfileRepository W; + private final UserCache X; + private long Y = 0L; - protected final Queue> j = Queues.newArrayDeque(); + protected final Queue> j = new java.util.concurrent.ConcurrentLinkedQueue>(); // Spigot, PAIL: Rename private Thread serverThread; - private long ab = az(); + private long aa = av(); -@@ -708,11 +708,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -709,11 +709,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.methodProfiler.a("jobs"); Queue queue = this.j; @@ -36,7 +36,7 @@ index 9bf5415..1d29ae7 100644 this.methodProfiler.c("levels"); -@@ -1496,10 +1498,10 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs +@@ -1476,10 +1478,10 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callable); Queue queue = this.j; @@ -52,5 +52,5 @@ index 9bf5415..1d29ae7 100644 try { return Futures.immediateFuture(callable.call()); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0155-map-decoration-fix.patch b/CraftBukkit-Patches/0144-map-decoration-fix.patch similarity index 84% rename from CraftBukkit-Patches/0155-map-decoration-fix.patch rename to CraftBukkit-Patches/0144-map-decoration-fix.patch index d1dfe6191f..10ef375298 100644 --- a/CraftBukkit-Patches/0155-map-decoration-fix.patch +++ b/CraftBukkit-Patches/0144-map-decoration-fix.patch @@ -1,23 +1,22 @@ -From 06637cad4bcf948b5d0beb7260bbf575cb37c728 Mon Sep 17 00:00:00 2001 +From adbd656dcb6dc645c7eadd6a1edb01d89823770a Mon Sep 17 00:00:00 2001 From: Antony Riley Date: Sun, 26 Apr 2015 02:14:13 +0300 Subject: [PATCH] map decoration fix diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java -index 976de16..1008567 100644 +index 1a9b5cc..1d9f569 100644 --- a/src/main/java/net/minecraft/server/EntityItemFrame.java +++ b/src/main/java/net/minecraft/server/EntityItemFrame.java -@@ -1,5 +1,8 @@ +@@ -1,5 +1,7 @@ package net.minecraft.server; +import java.util.UUID; +import org.apache.commons.codec.Charsets; -+ - public class EntityItemFrame extends EntityHanging { + import com.google.common.base.Optional; - private float c = 1.0F; -@@ -85,7 +88,7 @@ public class EntityItemFrame extends EntityHanging { + public class EntityItemFrame extends EntityHanging { +@@ -95,7 +97,7 @@ public class EntityItemFrame extends EntityHanging { if (itemstack.getItem() == Items.FILLED_MAP) { WorldMap worldmap = ((ItemWorldMap) itemstack.getItem()).getSavedMap(itemstack, this.world); @@ -27,7 +26,7 @@ index 976de16..1008567 100644 itemstack.a((EntityItemFrame) null); diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java -index 9772760..162b3a3 100644 +index d0d7c9d..e090fea 100644 --- a/src/main/java/net/minecraft/server/WorldMap.java +++ b/src/main/java/net/minecraft/server/WorldMap.java @@ -1,5 +1,6 @@ @@ -37,43 +36,43 @@ index 9772760..162b3a3 100644 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import java.util.Iterator; -@@ -23,7 +24,7 @@ public class WorldMap extends PersistentBase { +@@ -24,7 +25,7 @@ public class WorldMap extends PersistentBase { public byte[] colors = new byte[16384]; - public List g = Lists.newArrayList(); - public Map i = Maps.newHashMap(); // Spigot + public List h = Lists.newArrayList(); + public Map j = Maps.newHashMap(); // Spigot - public Map decorations = Maps.newLinkedHashMap(); + public Map decorations = Maps.newLinkedHashMap(); // Spigot // CraftBukkit start public final CraftMapView mapView; -@@ -144,7 +145,7 @@ public class WorldMap extends PersistentBase { +@@ -152,7 +153,7 @@ public class WorldMap extends PersistentBase { } - if (!entityhuman.inventory.c(itemstack)) { + if (!entityhuman.inventory.f(itemstack)) { - this.decorations.remove(entityhuman.getName()); + this.decorations.remove(entityhuman.getUniqueID()); // Spigot } - for (int i = 0; i < this.g.size(); ++i) { -@@ -152,7 +153,7 @@ public class WorldMap extends PersistentBase { + for (int i = 0; i < this.h.size(); ++i) { +@@ -160,7 +161,7 @@ public class WorldMap extends PersistentBase { - if (!worldmap_worldmaphumantracker1.trackee.dead && (worldmap_worldmaphumantracker1.trackee.inventory.c(itemstack) || itemstack.y())) { - if (!itemstack.y() && worldmap_worldmaphumantracker1.trackee.dimension == this.map) { + if (!worldmap_worldmaphumantracker1.trackee.dead && (worldmap_worldmaphumantracker1.trackee.inventory.f(itemstack) || itemstack.y())) { + if (!itemstack.y() && worldmap_worldmaphumantracker1.trackee.dimension == this.map && this.track) { - this.a(0, worldmap_worldmaphumantracker1.trackee.world, worldmap_worldmaphumantracker1.trackee.getName(), worldmap_worldmaphumantracker1.trackee.locX, worldmap_worldmaphumantracker1.trackee.locZ, (double) worldmap_worldmaphumantracker1.trackee.yaw); + this.a(0, worldmap_worldmaphumantracker1.trackee.world, worldmap_worldmaphumantracker1.trackee.getUniqueID(), worldmap_worldmaphumantracker1.trackee.locX, worldmap_worldmaphumantracker1.trackee.locZ, (double) worldmap_worldmaphumantracker1.trackee.yaw); // Spigot } } else { - this.i.remove(worldmap_worldmaphumantracker1.trackee); -@@ -164,7 +165,7 @@ public class WorldMap extends PersistentBase { + this.j.remove(worldmap_worldmaphumantracker1.trackee); +@@ -172,7 +173,7 @@ public class WorldMap extends PersistentBase { EntityItemFrame entityitemframe = itemstack.z(); BlockPosition blockposition = entityitemframe.getBlockPosition(); -- this.a(1, entityhuman.world, "frame-" + entityitemframe.getId(), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.direction.b() * 90)); -+ this.a(1, entityhuman.world, UUID.nameUUIDFromBytes(("frame-" + entityitemframe.getId()).getBytes(Charsets.US_ASCII)), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.direction.b() * 90)); // Spigot +- this.a(1, entityhuman.world, "frame-" + entityitemframe.getId(), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.direction.get2DRotationValue() * 90)); ++ this.a(1, entityhuman.world, UUID.nameUUIDFromBytes(("frame-" + entityitemframe.getId()).getBytes(Charsets.US_ASCII)), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.direction.get2DRotationValue() * 90)); // Spigot } if (itemstack.hasTag() && itemstack.getTag().hasKeyOfType("Decorations", 9)) { -@@ -173,15 +174,18 @@ public class WorldMap extends PersistentBase { +@@ -181,15 +182,18 @@ public class WorldMap extends PersistentBase { for (int j = 0; j < nbttaglist.size(); ++j) { NBTTagCompound nbttagcompound = nbttaglist.get(j); @@ -123,5 +122,5 @@ index d56a291..ad47bdd 100644 MapIcon decoration = (MapIcon) worldMap.decorations.get(key); cursors.addCursor(decoration.getX(), decoration.getY(), (byte) (decoration.getRotation() & 15), decoration.getType()); -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0156-Use-Map-for-getPlayer-String-lookup.patch b/CraftBukkit-Patches/0145-Use-Map-for-getPlayer-String-lookup.patch similarity index 87% rename from CraftBukkit-Patches/0156-Use-Map-for-getPlayer-String-lookup.patch rename to CraftBukkit-Patches/0145-Use-Map-for-getPlayer-String-lookup.patch index bb216c4085..b384073083 100644 --- a/CraftBukkit-Patches/0156-Use-Map-for-getPlayer-String-lookup.patch +++ b/CraftBukkit-Patches/0145-Use-Map-for-getPlayer-String-lookup.patch @@ -1,11 +1,11 @@ -From 6a4b038a8cf73929c980c8dfd83ea5fea8078a13 Mon Sep 17 00:00:00 2001 +From 26e3b231d4cc74e13ccbef7d8bae457683e6a25d Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 13 Jul 2015 19:05:15 +1000 Subject: [PATCH] Use Map for getPlayer(String) lookup. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 9a5549d..d3d19dd 100644 +index 6eb509c..50add77 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -65,6 +65,7 @@ public abstract class PlayerList { @@ -16,7 +16,7 @@ index 9a5549d..d3d19dd 100644 public PlayerList(MinecraftServer minecraftserver) { this.cserver = minecraftserver.server = new CraftServer(minecraftserver, this); -@@ -287,6 +288,7 @@ public abstract class PlayerList { +@@ -321,6 +322,7 @@ public abstract class PlayerList { public void onPlayerJoin(EntityPlayer entityplayer, String joinMessage) { // CraftBukkit added param this.players.add(entityplayer); @@ -24,7 +24,7 @@ index 9a5549d..d3d19dd 100644 this.j.put(entityplayer.getUniqueID(), entityplayer); // this.sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[] { entityplayer})); // CraftBukkit - replaced with loop below WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension); -@@ -358,6 +360,7 @@ public abstract class PlayerList { +@@ -406,6 +408,7 @@ public abstract class PlayerList { worldserver.kill(entityplayer); worldserver.getPlayerChunkMap().removePlayer(entityplayer); this.players.remove(entityplayer); @@ -32,15 +32,15 @@ index 9a5549d..d3d19dd 100644 UUID uuid = entityplayer.getUniqueID(); EntityPlayer entityplayer1 = (EntityPlayer) this.j.get(uuid); -@@ -508,6 +511,7 @@ public abstract class PlayerList { - // entityplayer.u().getTracker().untrackEntity(entityplayer); // CraftBukkit - entityplayer.u().getPlayerChunkMap().removePlayer(entityplayer); +@@ -556,6 +559,7 @@ public abstract class PlayerList { + // entityplayer.x().getTracker().untrackEntity(entityplayer); // CraftBukkit + entityplayer.x().getPlayerChunkMap().removePlayer(entityplayer); this.players.remove(entityplayer); + this.playersByName.remove(entityplayer.getName()); // Spigot this.server.getWorldServer(entityplayer.dimension).removeEntity(entityplayer); BlockPosition blockposition = entityplayer.getBed(); boolean flag1 = entityplayer.isRespawnForced(); -@@ -603,6 +607,7 @@ public abstract class PlayerList { +@@ -660,6 +664,7 @@ public abstract class PlayerList { worldserver.getPlayerChunkMap().addPlayer(entityplayer1); worldserver.addEntity(entityplayer1); this.players.add(entityplayer1); @@ -48,7 +48,7 @@ index 9a5549d..d3d19dd 100644 this.j.put(entityplayer1.getUniqueID(), entityplayer1); } // Added from changeDimension -@@ -1020,19 +1025,7 @@ public abstract class PlayerList { +@@ -1130,19 +1135,7 @@ public abstract class PlayerList { } public EntityPlayer getPlayer(String s) { @@ -68,7 +68,7 @@ index 9a5549d..d3d19dd 100644 + return this.playersByName.get(s); // Spigot } - public void sendPacketNearby(double d0, double d1, double d2, double d3, int i, Packet packet) { + public void sendPacketNearby(EntityHuman entityhuman, double d0, double d1, double d2, double d3, int i, Packet packet) { diff --git a/src/main/java/org/spigotmc/CaseInsensitiveHashingStrategy.java b/src/main/java/org/spigotmc/CaseInsensitiveHashingStrategy.java new file mode 100644 index 0000000..aafdd36 @@ -115,5 +115,5 @@ index 0000000..1934fd5 + } +} -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0157-Clear-Packet-Queue-on-Disconnect.patch b/CraftBukkit-Patches/0146-Clear-Packet-Queue-on-Disconnect.patch similarity index 64% rename from CraftBukkit-Patches/0157-Clear-Packet-Queue-on-Disconnect.patch rename to CraftBukkit-Patches/0146-Clear-Packet-Queue-on-Disconnect.patch index 9816efebee..599a506bcd 100644 --- a/CraftBukkit-Patches/0157-Clear-Packet-Queue-on-Disconnect.patch +++ b/CraftBukkit-Patches/0146-Clear-Packet-Queue-on-Disconnect.patch @@ -1,26 +1,26 @@ -From 2fb83fb54e5b9c84088869399618c55019d16381 Mon Sep 17 00:00:00 2001 +From 826e5a36d65dd521e93c10c6ad8b8d1999469bce Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 22 Jul 2015 19:04:37 +1000 Subject: [PATCH] Clear Packet Queue on Disconnect diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 247973d..9d23c6c 100644 +index 4c6dfb1..a9ea3f5 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -313,6 +313,7 @@ public class NetworkManager extends SimpleChannelInboundHandler { - } else if (this.getPacketListener() != null) { - this.getPacketListener().a(new ChatComponentText("Disconnected")); +@@ -316,6 +316,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + } else if (this.i() != null) { + this.i().a(new ChatComponentText("Disconnected")); } + this.i.clear(); // Free up packet queue. - } else { - NetworkManager.g.warn("handleDisconnection() called twice"); } + + } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 6f630b8..68358e9 100644 +index 371b3d1..13b9a7b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -895,7 +895,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList +@@ -1036,7 +1036,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } // CraftBukkit start @@ -30,5 +30,5 @@ index 6f630b8..68358e9 100644 } else if (packet instanceof PacketPlayOutSpawnPosition) { PacketPlayOutSpawnPosition packet6 = (PacketPlayOutSpawnPosition) packet; -- -2.1.4 +2.5.0 diff --git a/CraftBukkit-Patches/0158-Optimize-Chunk-Saving-Memory-Allocation-and-Compress.patch b/CraftBukkit-Patches/0147-Optimize-Chunk-Saving-Memory-Allocation-and-Compress.patch similarity index 81% rename from CraftBukkit-Patches/0158-Optimize-Chunk-Saving-Memory-Allocation-and-Compress.patch rename to CraftBukkit-Patches/0147-Optimize-Chunk-Saving-Memory-Allocation-and-Compress.patch index 02687f2754..e91ca30b36 100644 --- a/CraftBukkit-Patches/0158-Optimize-Chunk-Saving-Memory-Allocation-and-Compress.patch +++ b/CraftBukkit-Patches/0147-Optimize-Chunk-Saving-Memory-Allocation-and-Compress.patch @@ -1,4 +1,4 @@ -From bec646b094570475d33dac9381e03b8ce6ba4286 Mon Sep 17 00:00:00 2001 +From 60c0e933089f0eeaec37a2f0a6efa6d8e0a6be9b Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 29 Aug 2015 13:59:25 -0400 Subject: [PATCH] Optimize Chunk Saving Memory Allocation and Compression @@ -13,15 +13,15 @@ By Buffering Writes the same way it already is Buffering Reads, we will write to the stream much more effeciently. diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 3e31f4b..fe3fbb0 100644 +index b6f0c0b..1cd8be8 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java -@@ -176,8 +176,9 @@ public class RegionFile { +@@ -171,8 +171,9 @@ public class RegionFile { } } - public DataOutputStream b(int i, int j) { -- return this.d(i, j) ? null : new DataOutputStream(new DeflaterOutputStream(new RegionFile.ChunkBuffer(i, j))); +- return this.d(i, j) ? null : new DataOutputStream(new BufferedOutputStream(new DeflaterOutputStream(new RegionFile.ChunkBuffer(i, j)))); + public DataOutputStream b(int i, int j) { // PAIL: getChunkOutputStream + // PAIL: isInvalidRegion + return this.d(i, j) ? null : new DataOutputStream(new java.io.BufferedOutputStream(new DeflaterOutputStream(new RegionFile.ChunkBuffer(i, j)))); // Spigot - use a BufferedOutputStream to greatly improve file write performance @@ -29,5 +29,5 @@ index 3e31f4b..fe3fbb0 100644 protected synchronized void a(int i, int j, byte[] abyte, int k) { -- -1.9.1 +2.5.0 diff --git a/CraftBukkit-Patches/0159-More-effecient-RegionFile-zero-ing.patch b/CraftBukkit-Patches/0148-More-effecient-RegionFile-zero-ing.patch similarity index 71% rename from CraftBukkit-Patches/0159-More-effecient-RegionFile-zero-ing.patch rename to CraftBukkit-Patches/0148-More-effecient-RegionFile-zero-ing.patch index ac655d6d82..f996317c3e 100644 --- a/CraftBukkit-Patches/0159-More-effecient-RegionFile-zero-ing.patch +++ b/CraftBukkit-Patches/0148-More-effecient-RegionFile-zero-ing.patch @@ -1,4 +1,4 @@ -From 0fe6a5f1ec7f039ee04368f5d974286b08ddb53f Mon Sep 17 00:00:00 2001 +From 3750ad56c7a9ba3fcbc4ecc62d7d5e48da49af26 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 29 Aug 2015 17:48:20 -0400 Subject: [PATCH] More effecient RegionFile zero'ing @@ -7,10 +7,10 @@ Speeds up new Chunk Generation by using 2 4k block writes vs 2048 4 byte writes more effecient than going in and out of native calls repeatedly. diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index fe3fbb0..348706f 100644 +index 1cd8be8..4c39b54 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java -@@ -16,7 +16,7 @@ import java.util.zip.InflaterInputStream; +@@ -17,7 +17,7 @@ import java.util.zip.InflaterInputStream; public class RegionFile { @@ -19,23 +19,18 @@ index fe3fbb0..348706f 100644 private final File b; private RandomAccessFile c; private final int[] d = new int[1024]; -@@ -38,13 +38,9 @@ public class RegionFile { - int i; +@@ -37,8 +37,9 @@ public class RegionFile { + this.c = new RandomAccessFile(file, "rw"); if (this.c.length() < 4096L) { -- for (i = 0; i < 1024; ++i) { -- this.c.writeInt(0); -- } -- -- for (i = 0; i < 1024; ++i) { -- this.c.writeInt(0); -- } +- this.c.write(RegionFile.a); +- this.c.write(RegionFile.a); + // Spigot - more effecient chunk zero'ing + this.c.write(RegionFile.a); // Spigot + this.c.write(RegionFile.a); // Spigot - this.g += 8192; } + -- -1.9.1 +2.5.0 diff --git a/CraftBukkit-Patches/0160-Don-t-sleep-between-chunk-saves.patch b/CraftBukkit-Patches/0160-Don-t-sleep-between-chunk-saves.patch deleted file mode 100644 index f8ef8bcb9e..0000000000 --- a/CraftBukkit-Patches/0160-Don-t-sleep-between-chunk-saves.patch +++ /dev/null @@ -1,41 +0,0 @@ -From e2baf643e39f01e43476500f56f49ee1e284a1fb Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 9 Sep 2015 21:09:58 -0400 -Subject: [PATCH] Don't sleep between chunk saves - -For some unknown reason, Minecraft is sleeping 10ms between every single chunk being saved to disk. -Under high chunk load/unload activity (lots of movement / teleporting), this causes the chunk unload queue -to build up in size. - -This has multiple impacts: -1) Performance of the unload queue itself - The save thread is pretty ineffecient for how it accesses it - By letting the queue get larger, checking and popping work off the queue can get less performant. -2) Performance of chunk loading - As with #1, chunk loads also have to check this queue when loading - chunk data so that it doesn't load stale data if new data is pending write to disk. -3) Memory Usage - The entire chunk has been serialized to NBT, and now sits in this queue. This leads to - elevated memory usage, and then the objects used in the serialization sit around longer than needed, - resulting in promotion to Old Generation instead of dying young. - -If there is work to do, then the thread should be doing its work, and only sleep when it is done. - -diff --git a/src/main/java/net/minecraft/server/FileIOThread.java b/src/main/java/net/minecraft/server/FileIOThread.java -index 198b00f..c9b3bf4 100644 ---- a/src/main/java/net/minecraft/server/FileIOThread.java -+++ b/src/main/java/net/minecraft/server/FileIOThread.java -@@ -39,11 +39,12 @@ public class FileIOThread implements Runnable { - ++this.d; - } - -+ /* // Spigot start - don't sleep in between chunks so we unload faster. - try { - Thread.sleep(this.e ? 0L : 10L); - } catch (InterruptedException interruptedexception) { - interruptedexception.printStackTrace(); -- } -+ } */ // Spigot end - } - - if (this.b.isEmpty()) { --- -2.1.4 -