From 2f16bd158b797d08ce285181d64b1ca103203ce1 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Wed, 2 Jul 2014 20:47:25 -0500 Subject: [PATCH] Move our config options out of spigot.yml and into paper.yml --- .../0002-PaperSpigot-config-files.patch | 283 ++++++++++++++++++ ...l-hopper-owners-crashing-the-server.patch} | 0 ...ow-undead-horse-types-to-be-leashed.patch} | 24 +- ...eport-passenger-vehicle-with-player.patch} | 0 ...Invisible-players-don-t-have-rights.patch} | 0 .../0007-Add-getFloat-method-to-configs.patch | 45 --- ...007-Configurable-squid-spawn-ranges.patch} | 22 +- ...e-damage-multiplier-for-PvP-blocking.patch | 16 +- ...ctus-and-reed-natural-growth-heights.patch | 26 +- ...figurable-baby-zombie-movement-speed.patch | 18 +- ...ger-multiplier-for-player-sprint-jum.patch | 22 +- ...13-Inverted-Daylight-Detector-Toggle.patch | 16 +- ...015-Ability-to-disable-asynccatcher.patch} | 49 +-- ...tch => 0016-Fix-redstone-lag-issues.patch} | 0 ...020-Configurable-fishing-time-ranges.patch | 24 +- 15 files changed, 392 insertions(+), 153 deletions(-) create mode 100644 CraftBukkit-Patches/0002-PaperSpigot-config-files.patch rename CraftBukkit-Patches/{0002-Prevent-null-hopper-owners-crashing-the-server.patch => 0003-Prevent-null-hopper-owners-crashing-the-server.patch} (100%) rename CraftBukkit-Patches/{0003-Allow-undead-horse-types-to-be-leashed.patch => 0004-Allow-undead-horse-types-to-be-leashed.patch} (67%) rename CraftBukkit-Patches/{0004-Teleport-passenger-vehicle-with-player.patch => 0005-Teleport-passenger-vehicle-with-player.patch} (100%) rename CraftBukkit-Patches/{0005-Invisible-players-don-t-have-rights.patch => 0006-Invisible-players-don-t-have-rights.patch} (100%) delete mode 100644 CraftBukkit-Patches/0007-Add-getFloat-method-to-configs.patch rename CraftBukkit-Patches/{0006-Configurable-squid-spawn-ranges.patch => 0007-Configurable-squid-spawn-ranges.patch} (63%) rename CraftBukkit-Patches/{0016-Ability-to-disable-asynccatcher.patch => 0015-Ability-to-disable-asynccatcher.patch} (59%) rename CraftBukkit-Patches/{0015-Fix-redstone-lag-issues.patch => 0016-Fix-redstone-lag-issues.patch} (100%) diff --git a/CraftBukkit-Patches/0002-PaperSpigot-config-files.patch b/CraftBukkit-Patches/0002-PaperSpigot-config-files.patch new file mode 100644 index 0000000000..8b5d8bb408 --- /dev/null +++ b/CraftBukkit-Patches/0002-PaperSpigot-config-files.patch @@ -0,0 +1,283 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown <1254957+zachbr@users.noreply.github.com> +Date: Wed, 2 Jul 2014 22:26:16 -0500 +Subject: [PATCH] PaperSpigot config files + + +diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/DedicatedServer.java +@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + org.spigotmc.SpigotConfig.init(); + org.spigotmc.SpigotConfig.registerCommands(); + // Spigot end ++ // PaperSpigot start ++ org.github.paperspigot.PaperSpigotConfig.init(); ++ org.github.paperspigot.PaperSpigotConfig.registerCommands(); ++ // PaperSpigot end + + i.info("Generating keypair"); + this.a(MinecraftEncryption.b()); +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + public boolean keepSpawnInMemory = true; + public ChunkGenerator generator; + public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot ++ public final org.github.paperspigot.PaperSpigotWorldConfig paperSpigotConfig; // PaperSpigot + + public final SpigotTimings.WorldTimingsHandler timings; // Spigot + +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + // Changed signature - added gen and env + public World(IDataManager idatamanager, String s, WorldSettings worldsettings, WorldProvider worldprovider, MethodProfiler methodprofiler, ChunkGenerator gen, org.bukkit.World.Environment env) { + this.spigotConfig = new org.spigotmc.SpigotWorldConfig( s ); // Spigot ++ this.paperSpigotConfig = new org.github.paperspigot.PaperSpigotWorldConfig( s ); // PaperSpigot + this.generator = gen; + 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -0,0 +0,0 @@ public final class CraftServer implements Server { + } + + org.spigotmc.SpigotConfig.init(); // Spigot ++ org.github.paperspigot.PaperSpigotConfig.init(); // PaperSpigot + for (WorldServer world : console.worlds) { + world.difficulty = difficulty; + world.setSpawnFlags(monsters, animals); +@@ -0,0 +0,0 @@ public final class CraftServer implements Server { + world.ticksPerMonsterSpawns = this.getTicksPerMonsterSpawns(); + } + world.spigotConfig.init(); // Spigot ++ world.paperSpigotConfig.init(); // PaperSpigot + } + + pluginManager.clearPlugins(); + commandMap.clearCommands(); + resetRecipes(); + org.spigotmc.SpigotConfig.registerCommands(); // Spigot ++ org.github.paperspigot.PaperSpigotConfig.registerCommands(); // PaperSpigot + + overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); + +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java +new file mode 100644 +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +--- /dev/null ++++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java +@@ -0,0 +0,0 @@ ++package org.github.paperspigot; ++ ++import com.google.common.base.Throwables; ++import java.io.File; ++import java.io.IOException; ++import java.lang.reflect.InvocationTargetException; ++import java.lang.reflect.Method; ++import java.lang.reflect.Modifier; ++import java.util.HashMap; ++import java.util.List; ++import java.util.Map; ++import java.util.logging.Level; ++import net.minecraft.server.MinecraftServer; ++import org.bukkit.Bukkit; ++import org.bukkit.command.Command; ++import org.bukkit.configuration.file.YamlConfiguration; ++ ++public class PaperSpigotConfig ++{ ++ ++ private static final File CONFIG_FILE = new File( "paper.yml" ); ++ private static final String HEADER = "This is the main configuration file for PaperSpigot.\n" ++ + "As you can see, there's tons to configure. Some options may impact gameplay, so use\n" ++ + "with caution, and make sure you know what each option does before configuring.\n" ++ + "\n" ++ + "If you need help with the configuration or have any questions related to PaperSpigot,\n" ++ + "join us at the IRC.\n" ++ + "\n" ++ + "IRC: #paperspigot @ irc.spi.gt ( http://irc.spi.gt/iris/?channels=PaperSpigot )\n"; ++ /*========================================================================*/ ++ static YamlConfiguration config; ++ static int version; ++ static Map commands; ++ /*========================================================================*/ ++ ++ public static void init() ++ { ++ config = YamlConfiguration.loadConfiguration( CONFIG_FILE ); ++ config.options().header( HEADER ); ++ config.options().copyDefaults( true ); ++ ++ commands = new HashMap(); ++ ++ version = getInt( "config-version", 6 ); ++ set( "config-version", 6 ); ++ readConfig( PaperSpigotConfig.class, null ); ++ } ++ ++ public static void registerCommands() ++ { ++ for ( Map.Entry entry : commands.entrySet() ) ++ { ++ MinecraftServer.getServer().server.getCommandMap().register( entry.getKey(), "PaperSpigot", entry.getValue() ); ++ } ++ } ++ ++ static void readConfig(Class clazz, Object instance) ++ { ++ for ( Method method : clazz.getDeclaredMethods() ) ++ { ++ if ( Modifier.isPrivate( method.getModifiers() ) ) ++ { ++ if ( method.getParameterTypes().length == 0 && method.getReturnType() == Void.TYPE ) ++ { ++ try ++ { ++ method.setAccessible( true ); ++ method.invoke( instance ); ++ } catch ( InvocationTargetException ex ) ++ { ++ Throwables.propagate( ex.getCause() ); ++ } catch ( Exception ex ) ++ { ++ Bukkit.getLogger().log( Level.SEVERE, "Error invoking " + method, ex ); ++ } ++ } ++ } ++ } ++ ++ try ++ { ++ config.save( CONFIG_FILE ); ++ } catch ( IOException ex ) ++ { ++ Bukkit.getLogger().log( Level.SEVERE, "Could not save " + CONFIG_FILE, ex ); ++ } ++ } ++ ++ private static void set(String path, Object val) ++ { ++ config.set( path, val ); ++ } ++ ++ private static boolean getBoolean(String path, boolean def) ++ { ++ config.addDefault( path, def ); ++ return config.getBoolean( path, config.getBoolean( path ) ); ++ } ++ ++ private static float getFloat(String path, int def) ++ { ++ config.addDefault( path, def ); ++ return config.getFloat( path, config.getFloat( path ) ); ++ } ++ ++ private static int getInt(String path, int def) ++ { ++ config.addDefault( path, def ); ++ return config.getInt( path, config.getInt( path ) ); ++ } ++ ++ private static List getList(String path, T def) ++ { ++ config.addDefault( path, def ); ++ return (List) config.getList( path, config.getList( path ) ); ++ } ++ ++ private static String getString(String path, String def) ++ { ++ config.addDefault( path, def ); ++ return config.getString( path, config.getString( path ) ); ++ } ++} +\ No newline at end of file +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +new file mode 100644 +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +--- /dev/null ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -0,0 +0,0 @@ ++package org.github.paperspigot; ++ ++import java.util.List; ++import org.bukkit.Bukkit; ++import org.bukkit.configuration.file.YamlConfiguration; ++ ++public class PaperSpigotWorldConfig ++{ ++ ++ private final String worldName; ++ private final YamlConfiguration config; ++ private boolean verbose; ++ ++ public PaperSpigotWorldConfig(String worldName) ++ { ++ this.worldName = worldName; ++ this.config = PaperSpigotConfig.config; ++ init(); ++ } ++ ++ public void init() ++ { ++ this.verbose = getBoolean( "verbose", true ); ++ ++ log( "-------- World Settings For [" + worldName + "] --------" ); ++ PaperSpigotConfig.readConfig( PaperSpigotWorldConfig.class, this ); ++ } ++ ++ private void log(String s) ++ { ++ if ( verbose ) ++ { ++ Bukkit.getLogger().info( s ); ++ } ++ } ++ ++ private void set(String path, Object val) ++ { ++ config.set( "world-settings.default." + path, val ); ++ } ++ ++ private boolean getBoolean(String path, boolean def) ++ { ++ config.addDefault( "world-settings.default." + path, def ); ++ return config.getBoolean( "world-settings." + worldName + "." + path, config.getBoolean( "world-settings.default." + path ) ); ++ } ++ ++ private double getDouble(String path, double def) ++ { ++ config.addDefault( "world-settings.default." + path, def ); ++ return config.getDouble( "world-settings." + worldName + "." + path, config.getDouble( "world-settings.default." + path ) ); ++ } ++ ++ private int getInt(String path, int def) ++ { ++ config.addDefault( "world-settings.default." + path, def ); ++ return config.getInt( "world-settings." + worldName + "." + path, config.getInt( "world-settings.default." + path ) ); ++ } ++ ++ private float getFloat(String path, float def) ++ { ++ config.addDefault( "world-settings.default." + path, def ); ++ return config.getFloat( "world-settings." + worldName + "." + path, config.getFloat( "world-settings.default." + path ) ); ++ } ++ ++ private List getList(String path, T def) ++ { ++ config.addDefault( "world-settings.default." + path, def ); ++ return (List) config.getList( "world-settings." + worldName + "." + path, config.getList( "world-settings.default." + path ) ); ++ } ++ ++ private String getString(String path, String def) ++ { ++ config.addDefault( "world-settings.default." + path, def ); ++ return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) ); ++ } ++} +\ No newline at end of file +-- \ No newline at end of file diff --git a/CraftBukkit-Patches/0002-Prevent-null-hopper-owners-crashing-the-server.patch b/CraftBukkit-Patches/0003-Prevent-null-hopper-owners-crashing-the-server.patch similarity index 100% rename from CraftBukkit-Patches/0002-Prevent-null-hopper-owners-crashing-the-server.patch rename to CraftBukkit-Patches/0003-Prevent-null-hopper-owners-crashing-the-server.patch diff --git a/CraftBukkit-Patches/0003-Allow-undead-horse-types-to-be-leashed.patch b/CraftBukkit-Patches/0004-Allow-undead-horse-types-to-be-leashed.patch similarity index 67% rename from CraftBukkit-Patches/0003-Allow-undead-horse-types-to-be-leashed.patch rename to CraftBukkit-Patches/0004-Allow-undead-horse-types-to-be-leashed.patch index f258db0aca..362b540f60 100644 --- a/CraftBukkit-Patches/0003-Allow-undead-horse-types-to-be-leashed.patch +++ b/CraftBukkit-Patches/0004-Allow-undead-horse-types-to-be-leashed.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> -Date: Tue, 24 Jun 2014 07:32:04 -0500 +Date: Wed, 2 Jul 2014 22:33:09 -0500 Subject: [PATCH] Allow undead horse types to be leashed @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit -+import org.spigotmc.SpigotWorldConfig; // PaperSpigot ++import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot + public class EntityHorse extends EntityAnimal implements IInventoryListener { @@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public boolean bM() { - return !this.cE() && super.bM(); + // PaperSpigot start - configurable undead horse leashing -+ if (SpigotWorldConfig.allowUndeadHorseLeashing) { ++ if (PaperSpigotWorldConfig.allowUndeadHorseLeashing) { + return super.bM(); + } else { + return !this.cE() && super.bM(); @@ -32,20 +32,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } protected void o(float f) { -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -0,0 +0,0 @@ public class SpigotWorldConfig - { - witherSpawnSoundRadius = getInt( "wither-spawn-sound-radius", 0 ); +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig + config.addDefault( "world-settings.default." + path, def ); + return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) ); } +-} +\ No newline at end of file + + public static boolean allowUndeadHorseLeashing; + private void allowUndeadHorseLeashing() + { -+ allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true); ++ allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true ); + log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing ); + } - } ++} -- \ No newline at end of file diff --git a/CraftBukkit-Patches/0004-Teleport-passenger-vehicle-with-player.patch b/CraftBukkit-Patches/0005-Teleport-passenger-vehicle-with-player.patch similarity index 100% rename from CraftBukkit-Patches/0004-Teleport-passenger-vehicle-with-player.patch rename to CraftBukkit-Patches/0005-Teleport-passenger-vehicle-with-player.patch diff --git a/CraftBukkit-Patches/0005-Invisible-players-don-t-have-rights.patch b/CraftBukkit-Patches/0006-Invisible-players-don-t-have-rights.patch similarity index 100% rename from CraftBukkit-Patches/0005-Invisible-players-don-t-have-rights.patch rename to CraftBukkit-Patches/0006-Invisible-players-don-t-have-rights.patch diff --git a/CraftBukkit-Patches/0007-Add-getFloat-method-to-configs.patch b/CraftBukkit-Patches/0007-Add-getFloat-method-to-configs.patch deleted file mode 100644 index 3882ae4598..0000000000 --- a/CraftBukkit-Patches/0007-Add-getFloat-method-to-configs.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown <1254957+zachbr@users.noreply.github.com> -Date: Mon, 19 May 2014 21:08:44 -0500 -Subject: [PATCH] Add getFloat method to configs - - -diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotConfig.java -+++ b/src/main/java/org/spigotmc/SpigotConfig.java -@@ -0,0 +0,0 @@ public class SpigotConfig - return config.getBoolean( path, config.getBoolean( path ) ); - } - -+ // PaperSpigot start - Add getFloat -+ private static float getFloat(String path, float def) -+ { -+ config.addDefault( path, def ); -+ return config.getFloat( path, config.getFloat( path ) ); -+ } -+ // PaperSpigot end -+ - private static int getInt(String path, int def) - { - config.addDefault( path, def ); -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -0,0 +0,0 @@ public class SpigotWorldConfig - return config.getDouble( "world-settings." + worldName + "." + path, config.getDouble( "world-settings.default." + path ) ); - } - -+ // PaperSpigot start - Add getFloat -+ private float getFloat(String path, float def) -+ { -+ config.addDefault( "world-settings.default." + path, def ); -+ return config.getFloat( "world-settings." + worldName + "." + path, config.getFloat( "world-settings.default." + path ) ); -+ } -+ // PaperSpigot end -+ - private int getInt(String path, int def) - { - config.addDefault( "world-settings.default." + path, def ); --- \ No newline at end of file diff --git a/CraftBukkit-Patches/0006-Configurable-squid-spawn-ranges.patch b/CraftBukkit-Patches/0007-Configurable-squid-spawn-ranges.patch similarity index 63% rename from CraftBukkit-Patches/0006-Configurable-squid-spawn-ranges.patch rename to CraftBukkit-Patches/0007-Configurable-squid-spawn-ranges.patch index b6033b8285..a4511dd4a7 100644 --- a/CraftBukkit-Patches/0006-Configurable-squid-spawn-ranges.patch +++ b/CraftBukkit-Patches/0007-Configurable-squid-spawn-ranges.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.craftbukkit.TrigMath; // CraftBukkit -+import org.spigotmc.SpigotWorldConfig; // PaperSpigot ++import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot + public class EntitySquid extends EntityWaterAnimal { @@ -22,17 +22,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public boolean canSpawn() { - return this.locY > 45.0D && this.locY < 63.0D && super.canSpawn(); -+ return this.locY > SpigotWorldConfig.squidMinSpawnHeight && this.locY < SpigotWorldConfig.squidMaxSpawnHeight && super.canSpawn(); // PaperSpigot - Configurable squid spawn height range ++ return this.locY > PaperSpigotWorldConfig.squidMinSpawnHeight && this.locY < PaperSpigotWorldConfig.squidMaxSpawnHeight && super.canSpawn(); // PaperSpigot - Configurable squid spawn height range } } -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -0,0 +0,0 @@ public class SpigotWorldConfig - log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck + " Hopper Amount: " + hopperAmount ); +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig + allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true ); + log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing ); } - ++ + public static double squidMinSpawnHeight; + public static double squidMaxSpawnHeight; + private void squidSpawnHeight() @@ -40,8 +41,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + squidMinSpawnHeight = getDouble( "squid-spawn-height.minimum", 45.0D ); + squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D ); + } -+ - public boolean randomLightUpdates; - private void lightUpdates() - { + } -- \ No newline at end of file diff --git a/CraftBukkit-Patches/0008-Configurable-damage-multiplier-for-PvP-blocking.patch b/CraftBukkit-Patches/0008-Configurable-damage-multiplier-for-PvP-blocking.patch index 926f473c98..c5b60d5e5d 100644 --- a/CraftBukkit-Patches/0008-Configurable-damage-multiplier-for-PvP-blocking.patch +++ b/CraftBukkit-Patches/0008-Configurable-damage-multiplier-for-PvP-blocking.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.event.player.PlayerItemConsumeEvent; // CraftBukkit end -+import org.spigotmc.SpigotWorldConfig; // PaperSpigot ++import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot + public abstract class EntityHuman extends EntityLiving implements ICommandListener { @@ -22,17 +22,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (!this.isInvulnerable()) { if (!damagesource.ignoresArmor() && this.isBlocking() && f > 0.0F) { - f = (1.0F + f) * 0.5F; -+ f = (1.0F + f) * SpigotWorldConfig.playerBlockingDamageMultiplier; // PaperSpigot - Configurable PvP blocking damage multiplier ++ f = (1.0F + f) * PaperSpigotWorldConfig.playerBlockingDamageMultiplier; // PaperSpigot - Configurable PvP blocking damage multiplier } f = this.b(damagesource, f); -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -0,0 +0,0 @@ public class SpigotWorldConfig - allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true); - log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing ); +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig + squidMinSpawnHeight = getDouble( "squid-spawn-height.minimum", 45.0D ); + squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D ); } + + public static float playerBlockingDamageMultiplier; diff --git a/CraftBukkit-Patches/0009-Configurable-cactus-and-reed-natural-growth-heights.patch b/CraftBukkit-Patches/0009-Configurable-cactus-and-reed-natural-growth-heights.patch index 5c4c0395d2..fdb940ffef 100644 --- a/CraftBukkit-Patches/0009-Configurable-cactus-and-reed-natural-growth-heights.patch +++ b/CraftBukkit-Patches/0009-Configurable-cactus-and-reed-natural-growth-heights.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit -+import org.spigotmc.SpigotWorldConfig; // PaperSpigot ++import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot + public class BlockCactus extends Block { @@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - if (l < 3) { -+ if (l < SpigotWorldConfig.cactusMaxHeight) { // PaperSpigot - Configurable natural growth heights ++ if (l < PaperSpigotWorldConfig.cactusMaxHeight) { // PaperSpigot - Configurable natural growth heights int i1 = world.getData(i, j, k); if (i1 >= (byte) range(3, (world.growthOdds / world.spigotConfig.cactusModifier * 15) + 0.5F, 15)) { // Spigot @@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ package net.minecraft.server; -+import org.spigotmc.SpigotWorldConfig; // PaperSpigot ++import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot + import java.util.Random; @@ -43,18 +43,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - if (l < 3) { -+ if (l < SpigotWorldConfig.reedMaxHeight) { // PaperSpigot - Configurable natural growth heights ++ if (l < PaperSpigotWorldConfig.reedMaxHeight) { // PaperSpigot - Configurable natural growth heights int i1 = world.getData(i, j, k); if (i1 >= (byte) range(3, (world.growthOdds / world.spigotConfig.caneModifier * 15) + 0.5F, 15)) { // Spigot -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -0,0 +0,0 @@ public class SpigotWorldConfig - squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D ); +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig + { + playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F ); } - ++ + public static int cactusMaxHeight; + public static int reedMaxHeight; + private void blockGrowthHeight() @@ -62,8 +63,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + cactusMaxHeight = getInt( "max-growth-height.cactus", 3 ); + reedMaxHeight = getInt ( "max-growth-height.reeds", 3 ); + } -+ - public boolean randomLightUpdates; - private void lightUpdates() - { + } -- \ No newline at end of file diff --git a/CraftBukkit-Patches/0010-Configurable-baby-zombie-movement-speed.patch b/CraftBukkit-Patches/0010-Configurable-baby-zombie-movement-speed.patch index 2cd5922704..9ecb4e8d60 100644 --- a/CraftBukkit-Patches/0010-Configurable-baby-zombie-movement-speed.patch +++ b/CraftBukkit-Patches/0010-Configurable-baby-zombie-movement-speed.patch @@ -12,28 +12,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.event.entity.EntityTargetEvent; //CraftBukkit end -+import org.spigotmc.SpigotWorldConfig; // PaperSpigot ++import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot + public class EntityZombie extends EntityMonster { protected static final IAttribute bp = (new AttributeRanged("zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance"); private static final UUID bq = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); - private static final AttributeModifier br = new AttributeModifier(bq, "Baby speed boost", 0.5D, 1); -+ private static final AttributeModifier br = new AttributeModifier(bq, "Baby speed boost", SpigotWorldConfig.babyZombieMovementSpeed, 1); // PaperSpigot - Make baby zombie movement speed configurable ++ private static final AttributeModifier br = new AttributeModifier(bq, "Baby speed boost", PaperSpigotWorldConfig.babyZombieMovementSpeed, 1); // PaperSpigot - Make baby zombie movement speed configurable private final PathfinderGoalBreakDoor bs = new PathfinderGoalBreakDoor(this); private int bt; private boolean bu = false; -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -0,0 +0,0 @@ public class SpigotWorldConfig - { - playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F ); +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig + cactusMaxHeight = getInt( "max-growth-height.cactus", 3 ); + reedMaxHeight = getInt ( "max-growth-height.reeds", 3 ); } + + public static double babyZombieMovementSpeed; -+ private void setBabyZombieMovementSpeed() ++ private void babyZombieMovementSpeed() + { + babyZombieMovementSpeed = getDouble( "baby-zombie-movement-speed", 0.5D ); + } diff --git a/CraftBukkit-Patches/0012-Configurable-hunger-multiplier-for-player-sprint-jum.patch b/CraftBukkit-Patches/0012-Configurable-hunger-multiplier-for-player-sprint-jum.patch index 3c932fcce1..addd5acd25 100644 --- a/CraftBukkit-Patches/0012-Configurable-hunger-multiplier-for-player-sprint-jum.patch +++ b/CraftBukkit-Patches/0012-Configurable-hunger-multiplier-for-player-sprint-jum.patch @@ -13,25 +13,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.a(StatisticList.r, 1); if (this.isSprinting()) { - this.a(0.8F); -+ this.a( SpigotWorldConfig.playerSprintJumpingHungerMultiplier ); // PaperSpigot - Configurable hunger multiplier for player sprint jumping ++ this.a(PaperSpigotWorldConfig.playerSprintJumpingHungerMultiplier); // PaperSpigot - Configurable hunger multiplier for player sprint jumping } else { this.a(0.2F); } -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -0,0 +0,0 @@ public class SpigotWorldConfig - playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F ); +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig + { + babyZombieMovementSpeed = getDouble( "baby-zombie-movement-speed", 0.5D ); } - ++ + public static float playerSprintJumpingHungerMultiplier; -+ private void setPlayerSprintJumpingHungerMultiplier() ++ private void playerSprintJumpingHungerMultiplier() + { + playerSprintJumpingHungerMultiplier = getFloat( "player-sprint-jumping-hunger-multiplier", 0.8F ); + } -+ - public static double babyZombieMovementSpeed; - private void setBabyZombieMovementSpeed() - { + } -- \ No newline at end of file diff --git a/CraftBukkit-Patches/0013-Inverted-Daylight-Detector-Toggle.patch b/CraftBukkit-Patches/0013-Inverted-Daylight-Detector-Toggle.patch index c6027d1f29..7597a83bda 100644 --- a/CraftBukkit-Patches/0013-Inverted-Daylight-Detector-Toggle.patch +++ b/CraftBukkit-Patches/0013-Inverted-Daylight-Detector-Toggle.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ package net.minecraft.server; -+import org.spigotmc.SpigotWorldConfig; // PaperSpigot ++import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot + import java.util.Random; @@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - i1 = 0; - } + // PaperSpigot start - Inverted Daylight Detectors -+ if (SpigotWorldConfig.InvertedDaylightDetectors) { ++ if (PaperSpigotWorldConfig.InvertedDaylightDetectors) { + i1 = Math.round((float) i1 * MathHelper.cos(f) * -1 + 15); + if (i1 < 10) { + i1 = 0; @@ -50,19 +50,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (l != i1) { i1 = org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(world, i, j, k, l, i1).getNewCurrent(); // CraftBukkit - Call BlockRedstoneEvent -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -0,0 +0,0 @@ public class SpigotWorldConfig +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig { - babyZombieMovementSpeed = getDouble( "baby-zombie-movement-speed", 0.5D ); + playerSprintJumpingHungerMultiplier = getFloat( "player-sprint-jumping-hunger-multiplier", 0.8F ); } + + public static boolean InvertedDaylightDetectors; + private void InvertedDaylightDetectors() + { -+ InvertedDaylightDetectors = getBoolean( "inverted-daylight-detectors", false); ++ InvertedDaylightDetectors = getBoolean( "inverted-daylight-detectors", false ); + log( "Inverted Redstone Lamps: " + InvertedDaylightDetectors ); + } } diff --git a/CraftBukkit-Patches/0016-Ability-to-disable-asynccatcher.patch b/CraftBukkit-Patches/0015-Ability-to-disable-asynccatcher.patch similarity index 59% rename from CraftBukkit-Patches/0016-Ability-to-disable-asynccatcher.patch rename to CraftBukkit-Patches/0015-Ability-to-disable-asynccatcher.patch index b06bceda6f..95fdd77404 100644 --- a/CraftBukkit-Patches/0016-Ability-to-disable-asynccatcher.patch +++ b/CraftBukkit-Patches/0015-Ability-to-disable-asynccatcher.patch @@ -1,30 +1,19 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> -Date: Sat, 14 Jun 2014 22:39:58 -0500 +Date: Wed, 2 Jul 2014 22:34:04 -0500 Subject: [PATCH] Ability to disable asynccatcher -diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/AsyncCatcher.java -+++ b/src/main/java/org/spigotmc/AsyncCatcher.java -@@ -0,0 +0,0 @@ import net.minecraft.server.MinecraftServer; - public class AsyncCatcher - { - -- public static boolean enabled = true; -+ public static boolean enabled = SpigotConfig.asyncCatcherFeature; // PaperSpigot - AsyncCatcher override feature - - public static void catchOp(String reason) - { -diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotConfig.java -+++ b/src/main/java/org/spigotmc/SpigotConfig.java -@@ -0,0 +0,0 @@ public class SpigotConfig - { - intCacheLimit = getInt( "settings.int-cache-limit", 1024 ); +--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java +@@ -0,0 +0,0 @@ public class PaperSpigotConfig + config.addDefault( path, def ); + return config.getString( path, config.getString( path ) ); } +-} +\ No newline at end of file + + public static boolean asyncCatcherFeature; + private static void asyncCatcherFeature() @@ -34,5 +23,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this might be bad depending on your plugins" ); + } + } - } ++} +diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/spigotmc/AsyncCatcher.java ++++ b/src/main/java/org/spigotmc/AsyncCatcher.java +@@ -0,0 +0,0 @@ + package org.spigotmc; + + import net.minecraft.server.MinecraftServer; ++import org.github.paperspigot.PaperSpigotConfig; // PaperSpigot + + public class AsyncCatcher + { + +- public static boolean enabled = true; ++ public static boolean enabled = PaperSpigotConfig.asyncCatcherFeature; // PaperSpigot - AsyncCatcher override feature + + public static void catchOp(String reason) + { -- \ No newline at end of file diff --git a/CraftBukkit-Patches/0015-Fix-redstone-lag-issues.patch b/CraftBukkit-Patches/0016-Fix-redstone-lag-issues.patch similarity index 100% rename from CraftBukkit-Patches/0015-Fix-redstone-lag-issues.patch rename to CraftBukkit-Patches/0016-Fix-redstone-lag-issues.patch diff --git a/CraftBukkit-Patches/0020-Configurable-fishing-time-ranges.patch b/CraftBukkit-Patches/0020-Configurable-fishing-time-ranges.patch index 065acc699e..c6047609b6 100644 --- a/CraftBukkit-Patches/0020-Configurable-fishing-time-ranges.patch +++ b/CraftBukkit-Patches/0020-Configurable-fishing-time-ranges.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.event.player.PlayerFishEvent; // CraftBukkit end -+import org.spigotmc.SpigotWorldConfig; // PaperSpigot ++import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot + public class EntityFishingHook extends Entity { @@ -22,27 +22,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } else { - this.ay = MathHelper.nextInt(this.random, 100, 900); -+ this.ay = MathHelper.nextInt(this.random, SpigotWorldConfig.fishingMinTicks, SpigotWorldConfig.fishingMaxTicks); // PaperSpigot - configurable fishing time range ++ this.ay = MathHelper.nextInt(this.random, PaperSpigotWorldConfig.fishingMinTicks, PaperSpigotWorldConfig.fishingMaxTicks); // PaperSpigot - configurable fishing time range this.ay -= EnchantmentManager.getLureEnchantmentLevel(this.owner) * 20 * 5; } } -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -0,0 +0,0 @@ public class SpigotWorldConfig - reedMaxHeight = getInt ( "max-growth-height.reeds", 3 ); +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig + InvertedDaylightDetectors = getBoolean( "inverted-daylight-detectors", false ); + log( "Inverted Redstone Lamps: " + InvertedDaylightDetectors ); } - ++ + public static int fishingMinTicks = 100; + public static int fishingMaxTicks = 900; -+ private void fishingRange() ++ private void fishingTickRange() + { + fishingMinTicks = getInt( "fishing-time-range.MinimumTicks", fishingMinTicks ); + fishingMaxTicks = getInt( "fishing-time-range.MaximumTicks", fishingMaxTicks ); + } -+ - public boolean randomLightUpdates; - private void lightUpdates() - { + } -- \ No newline at end of file