mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
57 lines
No EOL
3.3 KiB
Diff
57 lines
No EOL
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
|
Date: Fri, 28 Nov 2014 01:41:54 -0600
|
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/Block.java
|
|
+++ b/src/main/java/net/minecraft/server/Block.java
|
|
@@ -0,0 +0,0 @@ public class Block {
|
|
|
|
public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, TileEntity tileentity) {
|
|
entityhuman.b(StatisticList.MINE_BLOCK_COUNT[getId(this)]);
|
|
- entityhuman.applyExhaustion(0.025F);
|
|
+ entityhuman.applyExhaustion(world.paperSpigotConfig.blockBreakExhaustion); // PaperSpigot - Configurable block break exhaustion
|
|
if (this.G() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman)) {
|
|
ItemStack itemstack = this.i(iblockdata);
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
|
@@ -0,0 +0,0 @@ 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.p, 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.V()) {
|
|
i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F);
|
|
if (i > 0) {
|
|
this.a(StatisticList.l, 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.j_()) {
|
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- 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
|
|
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 );
|
|
+ }
|
|
}
|
|
--
|