2015-02-28 11:36:22 +00:00
|
|
|
From 70d25cc0672928042930789bd318ba3ab9bc70d5 Mon Sep 17 00:00:00 2001
|
2014-08-17 21:47:36 +00:00
|
|
|
From: lazertester <austin.techhead@gmail.com>
|
|
|
|
Date: Sun, 17 Aug 2014 19:56:17 +1000
|
|
|
|
Subject: [PATCH] Add Hunger Config Values
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
2015-02-28 11:36:22 +00:00
|
|
|
index 2004d67..d73395a 100644
|
2014-08-17 21:47:36 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
2015-02-28 11:36:22 +00:00
|
|
|
@@ -1084,7 +1084,7 @@ public abstract class EntityHuman extends EntityLiving {
|
2014-08-17 21:47:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- this.applyExhaustion(0.3F);
|
|
|
|
+ this.applyExhaustion(world.spigotConfig.combatExhaustion); // Spigot - Change to use configurable value
|
|
|
|
} else if (flag1) {
|
|
|
|
entity.extinguish();
|
|
|
|
}
|
2015-02-28 11:36:22 +00:00
|
|
|
@@ -1331,9 +1331,9 @@ public abstract class EntityHuman extends EntityLiving {
|
|
|
|
super.bF();
|
2014-11-28 01:17:45 +00:00
|
|
|
this.b(StatisticList.u);
|
2014-08-17 21:47:36 +00:00
|
|
|
if (this.isSprinting()) {
|
|
|
|
- this.applyExhaustion(0.8F);
|
|
|
|
+ this.applyExhaustion(world.spigotConfig.sprintExhaustion); // Spigot - Change to use configurable value
|
|
|
|
} else {
|
|
|
|
- this.applyExhaustion(0.2F);
|
|
|
|
+ this.applyExhaustion(world.spigotConfig.walkExhaustion); // Spigot - Change to use configurable value
|
|
|
|
}
|
|
|
|
|
2014-11-28 01:17:45 +00:00
|
|
|
}
|
2014-08-17 21:47:36 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java
|
2015-02-28 11:36:22 +00:00
|
|
|
index 456b9b3..3af4180 100644
|
2014-08-17 21:47:36 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/FoodMetaData.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -63,7 +63,7 @@ public class FoodMetaData {
|
2014-08-17 21:47:36 +00:00
|
|
|
if (this.foodTickTimer >= 80) {
|
|
|
|
// CraftBukkit - added RegainReason
|
|
|
|
entityhuman.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED);
|
|
|
|
- this.a(3.0F);
|
|
|
|
+ this.a(entityhuman.world.spigotConfig.regenExhaustion); // Spigot - Change to use configurable value
|
|
|
|
this.foodTickTimer = 0;
|
|
|
|
}
|
|
|
|
} else if (this.foodLevel <= 0) {
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2015-02-28 11:36:22 +00:00
|
|
|
index d644922..75edbb9 100644
|
2014-08-17 21:47:36 +00:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2015-02-28 11:36:22 +00:00
|
|
|
@@ -301,4 +301,16 @@ public class SpigotWorldConfig
|
2014-08-17 21:47:36 +00:00
|
|
|
largeFeatureSeed = getInt( "seed-feature", 14357617 );
|
|
|
|
log( "Custom Map Seeds: Village: " + villageSeed + " Feature: " + largeFeatureSeed );
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public float walkExhaustion;
|
|
|
|
+ public float sprintExhaustion;
|
|
|
|
+ public float combatExhaustion;
|
|
|
|
+ public float regenExhaustion;
|
|
|
|
+ private void initHunger()
|
|
|
|
+ {
|
|
|
|
+ walkExhaustion = (float) getDouble( "hunger.walk-exhaustion", 0.2 );
|
|
|
|
+ sprintExhaustion = (float) getDouble( "hunger.sprint-exhaustion", 0.8 );
|
|
|
|
+ combatExhaustion = (float) getDouble( "hunger.combat-exhaustion", 0.3 );
|
|
|
|
+ regenExhaustion = (float) getDouble( "hunger.regen-exhaustion", 3 );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2014-11-28 01:17:45 +00:00
|
|
|
2.1.0
|
2014-08-17 21:47:36 +00:00
|
|
|
|