Cleanup our patches

This commit is contained in:
Zach Brown 2014-08-05 18:45:22 -05:00
parent e7c9889883
commit 4df7953678
14 changed files with 106 additions and 193 deletions

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com> From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Sat, 12 Jul 2014 19:37:16 -0500 Date: Tue, 5 Aug 2014 17:39:04 -0500
Subject: [PATCH] Ability to disable asynccatcher Subject: [PATCH] Ability to disable asynccatcher
@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotConfig @@ -0,0 +0,0 @@ public class PaperSpigotConfig
config.addDefault( path, def ); {
return config.getString( path, config.getString( path ) ); babyZombieMovementSpeed = getDouble( "settings.baby-zombie-movement-speed", 0.5D); // Player moves at 0.1F, for reference
} }
+ +
+ public static boolean asyncCatcherFeature; + public static boolean asyncCatcherFeature;
@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ { + {
+ asyncCatcherFeature = getBoolean( "settings.async-plugin-bad-magic-catcher", true ); + asyncCatcherFeature = getBoolean( "settings.async-plugin-bad-magic-catcher", true );
+ if (!asyncCatcherFeature) { + if (!asyncCatcherFeature) {
+ Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this might be bad depending on your plugins" ); + Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this may be bad depending on your plugins" );
+ } + }
+ } + }
} }
@ -26,17 +26,12 @@ diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/sp
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/spigotmc/AsyncCatcher.java --- a/src/main/java/org/spigotmc/AsyncCatcher.java
+++ b/src/main/java/org/spigotmc/AsyncCatcher.java +++ b/src/main/java/org/spigotmc/AsyncCatcher.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@ import net.minecraft.server.MinecraftServer;
package org.spigotmc;
import net.minecraft.server.MinecraftServer;
+import org.github.paperspigot.PaperSpigotConfig; // PaperSpigot
public class AsyncCatcher public class AsyncCatcher
{ {
- public static boolean enabled = true; - public static boolean enabled = true;
+ public static boolean enabled = PaperSpigotConfig.asyncCatcherFeature; // PaperSpigot - AsyncCatcher override feature + public static boolean enabled = org.github.paperspigot.PaperSpigotConfig.asyncCatcherFeature; // PaperSpigot - Allow disabling of AsyncCatcher from PaperSpigotConfig
public static void catchOp(String reason) public static void catchOp(String reason)
{ {

View file

@ -30,8 +30,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig @@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
playerExhaustionAttack = getFloat( "player-exhaustion.attack", 0.3F ); fishingMinTicks = getInt( "fishing-time-range.MinimumTicks", 100 );
playerExhaustionRegeneration = getFloat( "player-exhaustion.regeneration", 3.0F ); fishingMaxTicks = getInt( "fishing-time-range.MaximumTicks", 900 );
} }
+ +
+ public Integer softDespawnDistance; + public Integer softDespawnDistance;

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com> From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Sat, 12 Jul 2014 19:36:18 -0500 Date: Tue, 5 Aug 2014 16:10:44 -0500
Subject: [PATCH] Allow undead horse types to be leashed Subject: [PATCH] Allow undead horse types to be leashed
@ -8,22 +8,13 @@ diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityHorse.java --- a/src/main/java/net/minecraft/server/EntityHorse.java
+++ b/src/main/java/net/minecraft/server/EntityHorse.java +++ b/src/main/java/net/minecraft/server/EntityHorse.java
@@ -0,0 +0,0 @@ import java.util.List;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
+
public class EntityHorse extends EntityAnimal implements IInventoryListener {
private static final IEntitySelector bu = new EntitySelectorHorse();
@@ -0,0 +0,0 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { @@ -0,0 +0,0 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
} }
public boolean bM() { public boolean bM() {
- return !this.cE() && super.bM(); - return !this.cE() && super.bM();
+ // PaperSpigot start - configurable undead horse leashing + // PaperSpigot start - Configurable undead horse leashing
+ if (PaperSpigotWorldConfig.allowUndeadHorseLeashing) { + if (this.world.paperSpigotConfig.allowUndeadHorseLeashing) {
+ return super.bM(); + return super.bM();
+ } else { + } else {
+ return !this.cE() && super.bM(); + return !this.cE() && super.bM();
@ -41,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) ); return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
} }
+ +
+ public static boolean allowUndeadHorseLeashing; + public boolean allowUndeadHorseLeashing;
+ private void allowUndeadHorseLeashing() + private void allowUndeadHorseLeashing()
+ { + {
+ allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true ); + allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true );

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com> From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Wed, 21 May 2014 15:35:12 -0500 Date: Tue, 5 Aug 2014 17:18:23 -0500
Subject: [PATCH] Configurable baby zombie movement speed Subject: [PATCH] Configurable baby zombie movement speed
@ -8,34 +8,29 @@ diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/jav
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java --- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityCombustEvent; @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
import org.bukkit.event.entity.EntityTargetEvent;
//CraftBukkit end
+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"); 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 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", 0.5D, 1);
+ private static final AttributeModifier br = new AttributeModifier(bq, "Baby speed boost", PaperSpigotWorldConfig.babyZombieMovementSpeed, 1); // PaperSpigot - Make baby zombie movement speed configurable + // PaperSpigot - Configurable baby zombie movement speed
+ private static final AttributeModifier br = new AttributeModifier(bq, "Baby speed boost", org.github.paperspigot.PaperSpigotConfig.babyZombieMovementSpeed, 1);
private final PathfinderGoalBreakDoor bs = new PathfinderGoalBreakDoor(this); private final PathfinderGoalBreakDoor bs = new PathfinderGoalBreakDoor(this);
private int bt; private int bt;
private boolean bu = false; private boolean bu = false;
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig @@ -0,0 +0,0 @@ public class PaperSpigotConfig
cactusMaxHeight = getInt( "max-growth-height.cactus", 3 ); config.addDefault( path, def );
reedMaxHeight = getInt ( "max-growth-height.reeds", 3 ); return config.getString( path, config.getString( path ) );
} }
+ +
+ public static double babyZombieMovementSpeed; + public static double babyZombieMovementSpeed;
+ private void babyZombieMovementSpeed() + private static void babyZombieMovementSpeed()
+ { + {
+ babyZombieMovementSpeed = getDouble( "baby-zombie-movement-speed", 0.5D ); + babyZombieMovementSpeed = getDouble( "settings.baby-zombie-movement-speed", 0.5D); // Player moves at 0.1F, for reference
+ } + }
} }
-- --

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com> From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Tue, 24 Jun 2014 07:44:59 -0500 Date: Tue, 5 Aug 2014 16:26:30 -0500
Subject: [PATCH] Configurable cactus and reed natural growth heights Subject: [PATCH] Configurable cactus and reed natural growth heights
@ -8,21 +8,12 @@ diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java --- a/src/main/java/net/minecraft/server/BlockCactus.java
+++ b/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java
@@ -0,0 +0,0 @@ import java.util.Random;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
+
public class BlockCactus extends Block {
protected BlockCactus() {
@@ -0,0 +0,0 @@ public class BlockCactus extends Block { @@ -0,0 +0,0 @@ public class BlockCactus extends Block {
; ;
} }
- if (l < 3) { - if (l < 3) {
+ if (l < PaperSpigotWorldConfig.cactusMaxHeight) { // PaperSpigot - Configurable natural growth heights + if (l < world.paperSpigotConfig.cactusMaxHeight) { // PaperSpigot - Configurable max growth height for cactus blocks
int i1 = world.getData(i, j, k); int i1 = world.getData(i, j, k);
if (i1 >= (byte) range(3, (world.growthOdds / world.spigotConfig.cactusModifier * 15) + 0.5F, 15)) { // Spigot if (i1 >= (byte) range(3, (world.growthOdds / world.spigotConfig.cactusModifier * 15) + 0.5F, 15)) { // Spigot
@ -30,20 +21,12 @@ diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/n
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java --- a/src/main/java/net/minecraft/server/BlockReed.java
+++ b/src/main/java/net/minecraft/server/BlockReed.java +++ b/src/main/java/net/minecraft/server/BlockReed.java
@@ -0,0 +0,0 @@
package net.minecraft.server;
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
+
import java.util.Random;
public class BlockReed extends Block {
@@ -0,0 +0,0 @@ public class BlockReed extends Block { @@ -0,0 +0,0 @@ public class BlockReed extends Block {
; ;
} }
- if (l < 3) { - if (l < 3) {
+ if (l < PaperSpigotWorldConfig.reedMaxHeight) { // PaperSpigot - Configurable natural growth heights + if (l < world.paperSpigotConfig.reedMaxHeight) { // PaperSpigot - Configurable max growth height for reed blocks
int i1 = world.getData(i, j, k); int i1 = world.getData(i, j, k);
if (i1 >= (byte) range(3, (world.growthOdds / world.spigotConfig.caneModifier * 15) + 0.5F, 15)) { // Spigot if (i1 >= (byte) range(3, (world.growthOdds / world.spigotConfig.caneModifier * 15) + 0.5F, 15)) { // Spigot
@ -52,16 +35,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig @@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
{
playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F ); playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F );
log( "Player blocking damage multiplier set to " + playerBlockingDamageMultiplier);
} }
+ +
+ public static int cactusMaxHeight; + public int cactusMaxHeight;
+ public static int reedMaxHeight; + public int reedMaxHeight;
+ private void blockGrowthHeight() + private void blockGrowthHeight()
+ { + {
+ cactusMaxHeight = getInt( "max-growth-height.cactus", 3 ); + cactusMaxHeight = getInt( "max-growth-height.cactus", 3 );
+ reedMaxHeight = getInt( "max-growth-height.reeds", 3 ); + reedMaxHeight = getInt( "max-growth-height.reeds", 3 );
+ log( "Max height for cactus growth " + cactusMaxHeight + ". Max height for reed growth " + reedMaxHeight);
+ } + }
} }
-- --

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com> From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Tue, 24 Jun 2014 07:39:37 -0500 Date: Tue, 5 Aug 2014 16:21:03 -0500
Subject: [PATCH] Configurable damage multiplier for PvP blocking Subject: [PATCH] Configurable damage multiplier for PvP blocking
@ -8,21 +8,12 @@ diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java --- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@ import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
// CraftBukkit end
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
+
public abstract class EntityHuman extends EntityLiving implements ICommandListener {
public PlayerInventory inventory = new PlayerInventory(this);
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
// CraftBukkit end // CraftBukkit end
if (!this.isInvulnerable()) { if (!this.isInvulnerable()) {
if (!damagesource.ignoresArmor() && this.isBlocking() && f > 0.0F) { if (!damagesource.ignoresArmor() && this.isBlocking() && f > 0.0F) {
- f = (1.0F + f) * 0.5F; - f = (1.0F + f) * 0.5F;
+ f = (1.0F + f) * PaperSpigotWorldConfig.playerBlockingDamageMultiplier; // PaperSpigot - Configurable PvP blocking damage multiplier + f = (1.0F + f) * this.world.paperSpigotConfig.playerBlockingDamageMultiplier; // PaperSpigot - Configurable damage multiplier for blocking
} }
f = this.applyArmorModifier(damagesource, f); f = this.applyArmorModifier(damagesource, f);
@ -31,14 +22,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig @@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
squidMinSpawnHeight = getDouble( "squid-spawn-height.minimum", 45.0D );
squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D ); squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D );
log( "Squids will spawn between Y: " + squidMinSpawnHeight + " and Y: " + squidMaxSpawnHeight);
} }
+ +
+ public static float playerBlockingDamageMultiplier; + public float playerBlockingDamageMultiplier;
+ private void playerBlockingDamageMultiplier() + private void playerBlockingDamageMultiplier()
+ { + {
+ playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F ); + playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F );
+ log( "Player blocking damage multiplier set to " + playerBlockingDamageMultiplier);
+ } + }
} }
-- --

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com> From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Sun, 29 Jun 2014 13:22:09 -0500 Date: Tue, 5 Aug 2014 17:49:02 -0500
Subject: [PATCH] Configurable fishing time ranges Subject: [PATCH] Configurable fishing time ranges
@ -8,21 +8,13 @@ diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/mai
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java --- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -0,0 +0,0 @@ import org.bukkit.entity.Fish;
import org.bukkit.event.player.PlayerFishEvent;
// CraftBukkit end
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
+
public class EntityFishingHook extends Entity {
private static final List d = Arrays.asList(new PossibleFishingResult[] { (new PossibleFishingResult(new ItemStack(Items.LEATHER_BOOTS), 10)).a(0.9F), new PossibleFishingResult(new ItemStack(Items.LEATHER), 10), new PossibleFishingResult(new ItemStack(Items.BONE), 10), new PossibleFishingResult(new ItemStack(Items.POTION), 10), new PossibleFishingResult(new ItemStack(Items.STRING), 5), (new PossibleFishingResult(new ItemStack(Items.FISHING_ROD), 2)).a(0.9F), new PossibleFishingResult(new ItemStack(Items.BOWL), 10), new PossibleFishingResult(new ItemStack(Items.STICK), 5), new PossibleFishingResult(new ItemStack(Items.INK_SACK, 10, 0), 1), new PossibleFishingResult(new ItemStack(Blocks.TRIPWIRE_SOURCE), 10), new PossibleFishingResult(new ItemStack(Items.ROTTEN_FLESH), 10)});
@@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity { @@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity {
this.az = MathHelper.nextInt(this.random, 20, 80); this.az = MathHelper.nextInt(this.random, 20, 80);
} }
} else { } else {
- this.ay = MathHelper.nextInt(this.random, 100, 900); - this.ay = MathHelper.nextInt(this.random, 100, 900);
+ this.ay = MathHelper.nextInt(this.random, PaperSpigotWorldConfig.fishingMinTicks, PaperSpigotWorldConfig.fishingMaxTicks); // PaperSpigot - configurable fishing time range + // PaperSpigot - Configurable fishing tick range
+ this.ay = MathHelper.nextInt(this.random, this.world.paperSpigotConfig.fishingMinTicks, this.world.paperSpigotConfig.fishingMaxTicks);
this.ay -= EnchantmentManager.getLureEnchantmentLevel(this.owner) * 20 * 5; this.ay -= EnchantmentManager.getLureEnchantmentLevel(this.owner) * 20 * 5;
} }
} }
@ -31,16 +23,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig @@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
InvertedDaylightDetectors = getBoolean( "inverted-daylight-detectors", false ); invertedDaylightDetectors = getBoolean( "inverted-daylight-detectors", false );
log( "Inverted Redstone Lamps: " + InvertedDaylightDetectors ); log( "Inverted Redstone Lamps: " + invertedDaylightDetectors );
} }
+ +
+ public static int fishingMinTicks = 100; + public int fishingMinTicks;
+ public static int fishingMaxTicks = 900; + public int fishingMaxTicks;
+ private void fishingTickRange() + private void fishingTickRange()
+ { + {
+ fishingMinTicks = getInt( "fishing-time-range.MinimumTicks", fishingMinTicks ); + fishingMinTicks = getInt( "fishing-time-range.MinimumTicks", 100 );
+ fishingMaxTicks = getInt( "fishing-time-range.MaximumTicks", fishingMaxTicks ); + fishingMaxTicks = getInt( "fishing-time-range.MaximumTicks", 900 );
+ } + }
} }
-- --

View file

@ -50,8 +50,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig @@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
// Technically a little disingenuous as it applies to all falling blocks but alas, backwards compat prevails! log( "TNT/Falling Block Height Limit set to Y: " + fallingBlockHeightNerf);
fallingBlockHeightNerf = getDouble( "tnt-entity-height-nerf", 0 ); }
} }
+ +
+ public int waterOverLavaFlowSpeed; + public int waterOverLavaFlowSpeed;

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com> From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Mon, 19 May 2014 19:30:58 -0500 Date: Tue, 5 Aug 2014 16:17:15 -0500
Subject: [PATCH] Configurable squid spawn ranges Subject: [PATCH] Configurable squid spawn ranges
@ -8,21 +8,13 @@ diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntitySquid.java --- a/src/main/java/net/minecraft/server/EntitySquid.java
+++ b/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java
@@ -0,0 +0,0 @@ package net.minecraft.server;
import org.bukkit.craftbukkit.TrigMath; // CraftBukkit
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
+
public class EntitySquid extends EntityWaterAnimal {
public float bp;
@@ -0,0 +0,0 @@ public class EntitySquid extends EntityWaterAnimal { @@ -0,0 +0,0 @@ public class EntitySquid extends EntityWaterAnimal {
} }
public boolean canSpawn() { public boolean canSpawn() {
- return this.locY > 45.0D && this.locY < 63.0D && super.canSpawn(); - return this.locY > 45.0D && this.locY < 63.0D && super.canSpawn();
+ return this.locY > PaperSpigotWorldConfig.squidMinSpawnHeight && this.locY < PaperSpigotWorldConfig.squidMaxSpawnHeight && super.canSpawn(); // PaperSpigot - Configurable squid spawn height range + // PaperSpigot - Configurable squid spawn height range
+ return this.locY > this.world.paperSpigotConfig.squidMinSpawnHeight && this.locY < this.world.paperSpigotConfig.squidMaxSpawnHeight && super.canSpawn();
} }
} }
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@ -34,12 +26,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing ); log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
} }
+ +
+ public static double squidMinSpawnHeight; + public double squidMinSpawnHeight;
+ public static double squidMaxSpawnHeight; + public double squidMaxSpawnHeight;
+ private void squidSpawnHeight() + private void squidSpawnHeight()
+ { + {
+ squidMinSpawnHeight = getDouble( "squid-spawn-height.minimum", 45.0D ); + squidMinSpawnHeight = getDouble( "squid-spawn-height.minimum", 45.0D );
+ squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D ); + squidMaxSpawnHeight = getDouble( "squid-spawn-height.maximum", 63.0D );
+ log( "Squids will spawn between Y: " + squidMinSpawnHeight + " and Y: " + squidMaxSpawnHeight);
+ } + }
} }
-- --

View file

@ -1,29 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net> From: Byteflux <byte@byteflux.net>
Date: Wed, 30 Jul 2014 03:31:43 -0500 Date: Tue, 5 Aug 2014 18:39:57 -0500
Subject: [PATCH] Drop falling block entities that are above the specified Subject: [PATCH] Drop falling block entities that are above the specified
height
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -0,0 +0,0 @@ import java.util.ArrayList;
import java.util.Iterator;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+import org.github.paperspigot.PaperSpigotWorldConfig;
public class EntityFallingBlock extends Entity {
@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { @@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity {
++this.ticksLived; ++this.ticksLived;
this.motY -= 0.03999999910593033D; this.motY -= 0.03999999910593033D;
this.move(this.motX, this.motY, this.motZ); this.move(this.motX, this.motY, this.motZ);
+ +
+ // PaperSpigot start - Drop falling blocks above the specified height + // PaperSpigot start - Drop falling blocks above the specified height
+ if (PaperSpigotWorldConfig.fallingBlockHeightNerf != 0 && this.locY > PaperSpigotWorldConfig.fallingBlockHeightNerf) { + if (this.world.paperSpigotConfig.fallingBlockHeightNerf != 0 && this.locY > this.world.paperSpigotConfig.fallingBlockHeightNerf) {
+ if (this.dropItem) { + if (this.dropItem) {
+ this.a(new ItemStack(this.id, 1, this.id.getDropData(this.data)), 0.0F); + this.a(new ItemStack(this.id, 1, this.id.getDropData(this.data)), 0.0F);
+ } + }
@ -44,11 +35,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
log( "Keep spawn chunk loaded: " + keepSpawnInMemory ); log( "Keep spawn chunk loaded: " + keepSpawnInMemory );
} }
+ +
+ public static double fallingBlockHeightNerf; + public double fallingBlockHeightNerf;
+ private void fallingBlockHeightNerf() + private void fallingBlockheightNerf()
+ { + {
+ // Technically a little disingenuous as it applies to all falling blocks but alas, backwards compat prevails! + // Technically a little disingenuous as it applies to all falling blocks but alas, backwards compat prevails!
+ fallingBlockHeightNerf = getDouble( "tnt-entity-height-nerf", 0 ); + fallingBlockHeightNerf = getDouble( "tnt-entity-height-nerf", 0 );
+ if (fallingBlockHeightNerf != 0) {
+ log( "TNT/Falling Block Height Limit set to Y: " + fallingBlockHeightNerf);
+ }
+ } + }
} }
-- --

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: gsand <gsandowns@gmail.com> From: gsand <gsandowns@gmail.com>
Date: Sun, 6 Jul 2014 02:46:20 -0500 Date: Tue, 5 Aug 2014 17:31:07 -0500
Subject: [PATCH] Inverted Daylight Detector Toggle Subject: [PATCH] Inverted Daylight Detector Toggle
@ -8,14 +8,6 @@ diff --git a/src/main/java/net/minecraft/server/BlockDaylightDetector.java b/src
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockDaylightDetector.java --- a/src/main/java/net/minecraft/server/BlockDaylightDetector.java
+++ b/src/main/java/net/minecraft/server/BlockDaylightDetector.java +++ b/src/main/java/net/minecraft/server/BlockDaylightDetector.java
@@ -0,0 +0,0 @@
package net.minecraft.server;
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
+
import java.util.Random;
public class BlockDaylightDetector extends BlockContainer {
@@ -0,0 +0,0 @@ public class BlockDaylightDetector extends BlockContainer { @@ -0,0 +0,0 @@ public class BlockDaylightDetector extends BlockContainer {
f += (6.2831855F - f) * 0.2F; f += (6.2831855F - f) * 0.2F;
} }
@ -24,15 +16,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- if (i1 < 0) { - if (i1 < 0) {
- i1 = 0; - i1 = 0;
- } - }
+ // PaperSpigot start - Inverted Daylight Detectors -
+ if (PaperSpigotWorldConfig.InvertedDaylightDetectors) { - if (i1 > 15) {
- i1 = 15;
+ // PaperSpigot start - Configurable "inversion" for daylight detectors
+ if (world.paperSpigotConfig.invertedDaylightDetectors) {
+ i1 = Math.round((float) i1 * MathHelper.cos(f) * -1 + 15); + i1 = Math.round((float) i1 * MathHelper.cos(f) * -1 + 15);
+ if (i1 < 10) { + if (i1 < 10) {
+ i1 = 0; + i1 = 0;
+ } + }
+
- if (i1 > 15) {
- i1 = 15;
+ if (i1 > 9) { + if (i1 > 9) {
+ i1 = 15; + i1 = 15;
+ } + }
@ -55,15 +48,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig @@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
{ reedMaxHeight = getInt( "max-growth-height.reeds", 3 );
babyZombieMovementSpeed = getDouble( "baby-zombie-movement-speed", 0.5D ); log( "Max height for cactus growth " + cactusMaxHeight + ". Max height for reed growth " + reedMaxHeight);
} }
+ +
+ public static boolean InvertedDaylightDetectors; + public boolean invertedDaylightDetectors;
+ private void InvertedDaylightDetectors() + private void invertedDaylightDetectors()
+ { + {
+ InvertedDaylightDetectors = getBoolean( "inverted-daylight-detectors", false ); + invertedDaylightDetectors = getBoolean( "inverted-daylight-detectors", false );
+ log( "Inverted Redstone Lamps: " + InvertedDaylightDetectors ); + log( "Inverted Redstone Lamps: " + invertedDaylightDetectors );
+ } + }
} }
-- --

View file

@ -182,7 +182,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return config.getBoolean( path, config.getBoolean( path ) ); + return config.getBoolean( path, config.getBoolean( path ) );
+ } + }
+ +
+ private static float getFloat(String path, int def) + private static double getDouble(String path, double def)
+ {
+ config.addDefault( path, def );
+ return config.getDouble( path, config.getDouble( path ) );
+ }
+
+ private static float getFloat(String path, float def)
+ { + {
+ config.addDefault( path, def ); + config.addDefault( path, def );
+ return config.getFloat( path, config.getFloat( path ) ); + return config.getFloat( path, config.getFloat( path ) );

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: gsand <gsandowns@gmail.com> From: gsand <gsandowns@gmail.com>
Date: Tue, 8 Jul 2014 21:41:43 -0500 Date: Tue, 5 Aug 2014 18:28:21 -0500
Subject: [PATCH] Player Exhaustion Multipliers Subject: [PATCH] Player Exhaustion Multipliers
@ -8,21 +8,12 @@ diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/m
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/Block.java --- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java
@@ -0,0 +0,0 @@ import java.util.Iterator;
import java.util.List;
import java.util.Random;
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
+
public class Block {
public static final RegistryMaterials REGISTRY = new RegistryBlocks("air");
@@ -0,0 +0,0 @@ public class Block { @@ -0,0 +0,0 @@ public class Block {
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
entityhuman.a(StatisticList.MINE_BLOCK_COUNT[getId(this)], 1); entityhuman.a(StatisticList.MINE_BLOCK_COUNT[getId(this)], 1);
- entityhuman.applyExhaustion(0.025F); - entityhuman.applyExhaustion(0.025F);
+ entityhuman.a( PaperSpigotWorldConfig.playerExhaustionBlockBreak ); // PaperSpigot - Configurable block breaking exhaustion + entityhuman.applyExhaustion(org.github.paperspigot.PaperSpigotConfig.playerExhaustionBlockBreak); // PaperSpigot - Configurable block breaking exhaustion
if (this.E() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) { if (this.E() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) {
ItemStack itemstack = this.j(l); ItemStack itemstack = this.j(l);
@ -35,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
- this.applyExhaustion(0.3F); - this.applyExhaustion(0.3F);
+ this.a( PaperSpigotWorldConfig.playerExhaustionAttack ); // PaperSpigot - Configurable attack exhaustion + this.applyExhaustion(org.github.paperspigot.PaperSpigotConfig.playerExhaustionAttack); // PaperSpigot - Configurable attack exhaustion
} else if (flag1) { } else if (flag1) {
entity.extinguish(); entity.extinguish();
} }
@ -44,10 +35,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.a(StatisticList.r, 1); this.a(StatisticList.r, 1);
if (this.isSprinting()) { if (this.isSprinting()) {
- this.applyExhaustion(0.8F); - this.applyExhaustion(0.8F);
+ this.a( PaperSpigotWorldConfig.playerExhaustionSprintJumping ); // PaperSpigot - Configurable sprint jumping exhaustion + this.applyExhaustion(org.github.paperspigot.PaperSpigotConfig.playerExhaustionSprintJumping); // PaperSpigot - Configurable sprint jumping exhaustion
} else { } else {
- this.applyExhaustion(0.2F); - this.applyExhaustion(0.2F);
+ this.a( PaperSpigotWorldConfig.playerExhaustionJumping ); // PaperSpigot - Configurable jumping exhaustion + this.applyExhaustion(org.github.paperspigot.PaperSpigotConfig.playerExhaustionJumping); // PaperSpigot - Configurable jumping exhaustion
} }
} }
@ -56,14 +47,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (i > 0) { if (i > 0) {
this.a(StatisticList.m, i); this.a(StatisticList.m, i);
- this.applyExhaustion(0.015F * (float) i * 0.01F); - this.applyExhaustion(0.015F * (float) i * 0.01F);
+ this.a( PaperSpigotWorldConfig.playerExhaustionSwimming * (float) i * 0.01F); // PaperSpigot - Configurable swimming exhaustion + this.applyExhaustion(org.github.paperspigot.PaperSpigotConfig.playerExhaustionSwimming * (float) i * 0.01F); // PaperSpigot - Configurable swimming exhaustion
} }
} else if (this.M()) { } else if (this.M()) {
i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F); i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F);
if (i > 0) { if (i > 0) {
this.a(StatisticList.i, i); this.a(StatisticList.i, i);
- this.applyExhaustion(0.015F * (float) i * 0.01F); - this.applyExhaustion(0.015F * (float) i * 0.01F);
+ this.a( PaperSpigotWorldConfig.playerExhaustionSwimming * (float) i * 0.01F); // PaperSpigot - Configurable swimming (diving) exhaustion + this.applyExhaustion(org.github.paperspigot.PaperSpigotConfig.playerExhaustionSwimming * (float) i * 0.01F); // PaperSpigot - Configurable swimming (diving) exhaustion
} }
} else if (this.h_()) { } else if (this.h_()) {
if (d1 > 0.0D) { if (d1 > 0.0D) {
@ -72,10 +63,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.a(StatisticList.h, i); this.a(StatisticList.h, i);
if (this.isSprinting()) { if (this.isSprinting()) {
- this.applyExhaustion(0.099999994F * (float) i * 0.01F); - this.applyExhaustion(0.099999994F * (float) i * 0.01F);
+ this.a( PaperSpigotWorldConfig.playerExhaustionSprinting * (float) i * 0.01F); // PaperSpigot - Configurable sprinting exhaustion + this.applyExhaustion(org.github.paperspigot.PaperSpigotConfig.playerExhaustionSprinting * (float) i * 0.01F); // PaperSpigot - Configurable sprinting exhaustion
} else { } else {
- this.applyExhaustion(0.01F * (float) i * 0.01F); - this.applyExhaustion(0.01F * (float) i * 0.01F);
+ this.a( PaperSpigotWorldConfig.playerExhaustionWalking * (float) i * 0.01F); // PaperSpigot - Configurable walking exhaustion + this.applyExhaustion(org.github.paperspigot.PaperSpigotConfig.playerExhaustionWalking * (float) i * 0.01F); // PaperSpigot - Configurable walking exhaustion
} }
} }
} else { } else {
@ -83,30 +74,22 @@ diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/jav
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/FoodMetaData.java --- a/src/main/java/net/minecraft/server/FoodMetaData.java
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java +++ b/src/main/java/net/minecraft/server/FoodMetaData.java
@@ -0,0 +0,0 @@
package net.minecraft.server;
+import org.github.paperspigot.PaperSpigotWorldConfig; // PaperSpigot
+
public class FoodMetaData {
// CraftBukkit start - All made public
@@ -0,0 +0,0 @@ public class FoodMetaData { @@ -0,0 +0,0 @@ public class FoodMetaData {
if (this.foodTickTimer >= 80) { if (this.foodTickTimer >= 80) {
// CraftBukkit - added RegainReason // CraftBukkit - added RegainReason
entityhuman.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); entityhuman.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED);
- this.a(3.0F); - this.a(3.0F);
+ this.a( PaperSpigotWorldConfig.playerExhaustionRegeneration ); // PaperSpigot - Configurable regeneration exhaustion + this.a(org.github.paperspigot.PaperSpigotConfig.playerExhaustionRegeneration); // PaperSpigot - Configurable regeneration exhaustion
this.foodTickTimer = 0; this.foodTickTimer = 0;
} }
} else if (this.foodLevel <= 0) { } else if (this.foodLevel <= 0) {
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig @@ -0,0 +0,0 @@ public class PaperSpigotConfig
fishingMinTicks = getInt( "fishing-time-range.MinimumTicks", fishingMinTicks ); Bukkit.getLogger().log( Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users" );
fishingMaxTicks = getInt( "fishing-time-range.MaximumTicks", fishingMaxTicks ); }
} }
+ +
+ public static float playerExhaustionWalking; + public static float playerExhaustionWalking;
@ -117,7 +100,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public static float playerExhaustionSprintJumping; + public static float playerExhaustionSprintJumping;
+ public static float playerExhaustionAttack; + public static float playerExhaustionAttack;
+ public static float playerExhaustionRegeneration; + public static float playerExhaustionRegeneration;
+ private void playerExhaustion() + private static void playerExhaustion()
+ { + {
+ playerExhaustionWalking = getFloat( "player-exhaustion.walking", 0.01F ); + playerExhaustionWalking = getFloat( "player-exhaustion.walking", 0.01F );
+ playerExhaustionSwimming = getFloat( "player-exhaustion.swimming", 0.015F ); + playerExhaustionSwimming = getFloat( "player-exhaustion.swimming", 0.015F );

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com> From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Thu, 24 Jul 2014 22:19:44 -0500 Date: Tue, 5 Aug 2014 17:56:02 -0500
Subject: [PATCH] Toggle for player interact limiter Subject: [PATCH] Toggle for player interact limiter
@ -8,21 +8,13 @@ diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryView;
import org.bukkit.util.NumberConversions;
// CraftBukkit end
+import org.github.paperspigot.PaperSpigotConfig; // PaperSpigot
+
public class PlayerConnection implements PacketPlayInListener {
private static final Logger c = LogManager.getLogger();
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketPlayInListener { @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketPlayInListener {
public void a(PacketPlayInBlockPlace packetplayinblockplace) { public void a(PacketPlayInBlockPlace packetplayinblockplace) {
boolean throttled = false; boolean throttled = false;
- if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) { - if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
+ if (PaperSpigotConfig.interactLimitEnabled && lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) { + // PaperSpigot - Allow disabling the player interaction limiter
+ if (org.github.paperspigot.PaperSpigotConfig.interactLimitEnabled && lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
throttled = true; throttled = true;
} else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 ) } else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 )
{ {
@ -31,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotConfig @@ -0,0 +0,0 @@ public class PaperSpigotConfig
Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this might be bad depending on your plugins" ); Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this may be bad depending on your plugins" );
} }
} }
+ +
@ -39,6 +31,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private static void interactLimitEnabled() + private static void interactLimitEnabled()
+ { + {
+ interactLimitEnabled = getBoolean( "settings.limit-player-interactions", true ); + interactLimitEnabled = getBoolean( "settings.limit-player-interactions", true );
+ if (!interactLimitEnabled) {
+ Bukkit.getLogger().log( Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users" );
+ }
+ } + }
} }
-- --