Paper/Spigot-Server-Patches/0013-Player-Exhaustion-Multipliers.patch
Aikar 18b4817a33 bump the default maxMobSpawns default to 250, and add support for unlimited
Use -1 to represent vanilla/unlimited.
Updated PaperWorldConfig to also update the individual worlds limit if it was set
to the new default value.

Should hopefully help #235
2016-05-16 22:07:12 -04:00

61 lines
3.2 KiB
Diff

From c5ca014520533f97fea98525454b2ef371d0e83a Mon Sep 17 00:00:00 2001
From: gsand <gsandowns@gmail.com>
Date: Tue, 1 Mar 2016 13:43:16 -0600
Subject: [PATCH] Player Exhaustion Multipliers
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index a44bbed..b1d712f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -105,4 +105,13 @@ public class PaperWorldConfig {
private void nerfedMobsShouldJump() {
nerfedMobsShouldJump = getBoolean("spawner-nerfed-mobs-should-jump", false);
}
+
+ public float blockBreakExhaustion;
+ public float playerSwimmingExhaustion;
+ public void exhaustionValues() {
+ blockBreakExhaustion = getFloat("player-exhaustion.block-break", 0.025F);
+ playerSwimmingExhaustion = getFloat("player-exhaustion.swimming", 0.015F);
+ log("Player exhaustion penalty for breaking blocks is " + blockBreakExhaustion);
+ log("Player exhaustion penalty for swimming is " + playerSwimmingExhaustion);
+ }
}
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index 3212255..3d6f803 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -450,7 +450,7 @@ public class Block {
public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, @Nullable ItemStack itemstack) {
entityhuman.b(StatisticList.a(this));
- entityhuman.applyExhaustion(0.025F);
+ entityhuman.applyExhaustion(world.paperConfig.blockBreakExhaustion); // Paper - Configurable block break exhaustion
if (this.o() && EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) > 0) {
ItemStack itemstack1 = this.u(iblockdata);
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 6a8f499..3e1a84e 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -1455,13 +1455,13 @@ public abstract class EntityHuman extends EntityLiving {
i = Math.round(MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
if (i > 0) {
this.a(StatisticList.q, i);
- this.applyExhaustion(0.015F * (float) i * 0.01F);
+ this.applyExhaustion(world.paperConfig.playerSwimmingExhaustion); // Paper - Configurable swimming exhaustion
}
} else if (this.isInWater()) {
i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F);
if (i > 0) {
this.a(StatisticList.m, i);
- this.applyExhaustion(0.015F * (float) i * 0.01F);
+ this.applyExhaustion(world.paperConfig.playerSwimmingExhaustion); // Paper - Configurable swimming exhaustion
}
} else if (this.n_()) {
if (d1 > 0.0D) {
--
2.8.2