60 lines
3.1 KiB
Diff
60 lines
3.1 KiB
Diff
From 10a0bf1d881738722bb5d534dc1e379cbf26f1eb Mon Sep 17 00:00:00 2001
|
|
From: gsand <gsandowns@gmail.com>
|
|
Date: Sun, 17 Aug 2014 16:40:54 -0500
|
|
Subject: [PATCH] Player Exhaustion Multipliers
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
|
index 0893a6fdd..24e84d627 100644
|
|
--- a/src/main/java/net/minecraft/server/Block.java
|
|
+++ b/src/main/java/net/minecraft/server/Block.java
|
|
@@ -686,7 +686,7 @@ public class Block {
|
|
|
|
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.applyExhaustion(0.025F);
|
|
+ entityhuman.applyExhaustion(world.paperSpigotConfig.blockBreakExhaustion); // PaperSpigot - Configurable block break exhaustion
|
|
if (this.E() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) {
|
|
ItemStack itemstack = this.j(l);
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
|
index a0e48553a..35b5cfb10 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
|
@@ -1314,13 +1314,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
|
i = Math.round(MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
|
|
if (i > 0) {
|
|
this.a(StatisticList.m, i);
|
|
- this.applyExhaustion(0.015F * (float) i * 0.01F);
|
|
+ this.applyExhaustion(world.paperSpigotConfig.playerSwimmingExhaustion * (float) i * 0.01F); // PaperSpigot - Configurable swimming exhaustion
|
|
}
|
|
} else if (this.M()) {
|
|
i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F);
|
|
if (i > 0) {
|
|
this.a(StatisticList.i, i);
|
|
- this.applyExhaustion(0.015F * (float) i * 0.01F);
|
|
+ this.applyExhaustion(world.paperSpigotConfig.playerSwimmingExhaustion * (float) i * 0.01F); // PaperSpigot - Configurable swimming (diving) exhaustion
|
|
}
|
|
} else if (this.h_()) {
|
|
if (d1 > 0.0D) {
|
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
index 1d01f89cc..df84df542 100644
|
|
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
@@ -121,4 +121,12 @@ public class PaperSpigotWorldConfig
|
|
fishingMinTicks = getInt( "fishing-time-range.MinimumTicks", 100 );
|
|
fishingMaxTicks = getInt( "fishing-time-range.MaximumTicks", 900 );
|
|
}
|
|
+
|
|
+ public float blockBreakExhaustion;
|
|
+ public float playerSwimmingExhaustion;
|
|
+ private void exhaustionValues ()
|
|
+ {
|
|
+ blockBreakExhaustion = getFloat( "player-exhaustion.block-break", 0.025F );
|
|
+ playerSwimmingExhaustion = getFloat("player-exhaustion.swimming", 0.015F );
|
|
+ }
|
|
}
|
|
--
|
|
2.13.3
|
|
|