From c3faaa3d242d1d6630e40c2ab9bf2ef5ae6792c1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 21 Jun 2013 16:47:56 +1000 Subject: [PATCH] Rename Spigot changes patch to growth rates and simplify its contents --- ...ges.patch => 0006-Crop-Growth-Rates.patch} | 124 +----------------- 1 file changed, 7 insertions(+), 117 deletions(-) rename CraftBukkit-Patches/{0006-Spigot-Changes.patch => 0006-Crop-Growth-Rates.patch} (60%) diff --git a/CraftBukkit-Patches/0006-Spigot-Changes.patch b/CraftBukkit-Patches/0006-Crop-Growth-Rates.patch similarity index 60% rename from CraftBukkit-Patches/0006-Spigot-Changes.patch rename to CraftBukkit-Patches/0006-Crop-Growth-Rates.patch index c8e3897c7d..9f8cf64744 100644 --- a/CraftBukkit-Patches/0006-Spigot-Changes.patch +++ b/CraftBukkit-Patches/0006-Crop-Growth-Rates.patch @@ -1,7 +1,7 @@ -From c2d9713c3da77a4e39cbbea17070b2d41699a913 Mon Sep 17 00:00:00 2001 +From 77958016c76679e58d9475984109f0ec9830ceee Mon Sep 17 00:00:00 2001 From: md_5 -Date: Thu, 20 Jun 2013 18:21:09 +1000 -Subject: [PATCH] Spigot Changes +Date: Fri, 21 Jun 2013 16:44:14 +1000 +Subject: [PATCH] Crop Growth Rates diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java @@ -106,7 +106,7 @@ index 8657860..cf52501 100644 world.setData(i, j, k, 0, 4); } else { diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java -index 3b00939..d48677a 100644 +index 3b00939..ea34899 100644 --- a/src/main/java/net/minecraft/server/BlockSapling.java +++ b/src/main/java/net/minecraft/server/BlockSapling.java @@ -26,7 +26,7 @@ public class BlockSapling extends BlockFlower { @@ -114,7 +114,7 @@ index 3b00939..d48677a 100644 if (!world.isStatic) { super.a(world, i, j, k, random); - if (world.getLightLevel(i, j + 1, k) >= 9 && random.nextInt(7) == 0) { -+ if (world.getLightLevel(i, j + 1, k) >= 9 && (random.nextInt(Math.max(2, (int) ((world.growthOdds / world.spigotConfig.tickAggregate / world.spigotConfig.saplingModifier * 7) + 0.5F))) == 0)) { // Spigot ++ if (world.getLightLevel(i, j + 1, k) >= 9 && (random.nextInt(Math.max(2, (int) ((world.growthOdds / world.spigotConfig.saplingModifier * 7) + 0.5F))) == 0)) { // Spigot this.grow(world, i, j, k, random, false, null, null); // CraftBukkit - added bonemeal, player and itemstack } } @@ -131,95 +131,6 @@ index 8339a35..c7e2344 100644 int l = world.getData(i, j, k); if (l < 7) { -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 018c314..52fa75a 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -845,8 +845,20 @@ public class PlayerConnection extends Connection { - - this.chat(s, packet3chat.a_()); - -+ // Spigot start -+ boolean isCounted = true; -+ if (server.spamGuardExclusions != null) { -+ for (String excluded : server.spamGuardExclusions) { -+ if (s.startsWith(excluded)) { -+ isCounted = false; -+ break; -+ } -+ } -+ } - // This section stays because it is only applicable to packets -- if (chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.name)) { // CraftBukkit use thread-safe spam -+ if (isCounted && chatSpamField.addAndGet(this, 20) > 200 && !this.minecraftServer.getPlayerList().isOp(this.player.name)) { // CraftBukkit use thread-safe spam -+ // Spigot end -+ // CraftBukkit start - if (packet3chat.a_()) { - Waitable waitable = new Waitable() { - @Override -@@ -967,7 +979,7 @@ public class PlayerConnection extends Connection { - } - - try { -- this.minecraftServer.getLogger().info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // CraftBukkit -+ if (org.spigotmc.SpigotConfig.logCommands) this.minecraftServer.getLogger().info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // Spigot - if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) { - return; - } -@@ -1554,8 +1566,9 @@ public class PlayerConnection extends Connection { - flag = false; - } else { - for (i = 0; i < packet130updatesign.lines[j].length(); ++i) { -- if (SharedConstants.allowedCharacters.indexOf(packet130updatesign.lines[j].charAt(i)) < 0) { -+ if (!SharedConstants.isAllowedChatCharacter(packet130updatesign.lines[j].charAt(i))) { - flag = false; -+ break; - } - } - } -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6cb50b7..2567bde 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -208,7 +208,7 @@ public final class CraftServer implements Server { - chunkGCLoadThresh = configuration.getInt("chunk-gc.load-threshold"); - - updater = new AutoUpdater(new BukkitDLUpdaterService(configuration.getString("auto-updater.host")), getLogger(), configuration.getString("auto-updater.preferred-channel")); -- updater.setEnabled(configuration.getBoolean("auto-updater.enabled")); -+ updater.setEnabled(false); - updater.setSuggestChannels(configuration.getBoolean("auto-updater.suggest-channels")); - updater.getOnBroken().addAll(configuration.getStringList("auto-updater.on-broken")); - updater.getOnUpdate().addAll(configuration.getStringList("auto-updater.on-update")); -@@ -535,6 +535,7 @@ public final class CraftServer implements Server { - - ((DedicatedServer) console).propertyManager = config; - -+ ((SimplePluginManager) pluginManager).useTimings(configuration.getBoolean("settings.plugin-profiling")); // Spigot - boolean animals = config.getBoolean("spawn-animals", console.getSpawnAnimals()); - boolean monsters = config.getBoolean("spawn-monsters", console.worlds.get(0).difficulty > 0); - int difficulty = config.getInt("difficulty", console.worlds.get(0).difficulty); -@@ -1326,7 +1327,7 @@ public final class CraftServer implements Server { - public List tabCompleteCommand(Player player, String message) { - List completions = null; - try { -- completions = getCommandMap().tabComplete(player, message.substring(1)); -+ completions = (org.spigotmc.SpigotConfig.tabComplete) ? getCommandMap().tabComplete(player, message.substring(1)) : null; // Spigot - } catch (CommandException ex) { - player.sendMessage(ChatColor.RED + "An internal error occurred while attempting to tab-complete this command"); - getLogger().log(Level.SEVERE, "Exception when " + player.getName() + " attempted to tab complete " + message, ex); -diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -index c896ba2..e99cb22 100644 ---- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -@@ -40,7 +40,7 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider