2018-06-09 13:09:21 +02:00
From 12d1cdf6353a40f0870d48ccc90a0d216a2b6917 Mon Sep 17 00:00:00 2001
2016-03-01 00:09:49 +01:00
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 1 Mar 2016 13:09:16 -0600
Subject: [PATCH] Configurable baby zombie movement speed
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2018-06-09 13:09:21 +02:00
index 4a692ac1b..d44cacc7e 100644
2016-03-01 00:09:49 +01:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2018-01-11 06:31:19 +01:00
@@ -72,4 +72,10 @@ public class PaperWorldConfig {
2016-03-01 00:09:49 +01:00
log("Max height for cactus growth " + cactusMaxHeight + ". Max height for reed growth " + reedMaxHeight);
}
+
+ public double babyZombieMovementSpeed;
+ private void babyZombieMovementSpeed() {
+ babyZombieMovementSpeed = getDouble("baby-zombie-movement-speed", 0.5D); // Player moves at 0.1F, for reference
+ log("Baby zombies will move at the speed of " + babyZombieMovementSpeed);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
2018-06-09 13:09:21 +02:00
index 11c0f24f1..277f1414a 100644
2016-03-01 00:09:49 +01:00
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
2016-05-12 04:07:46 +02:00
@@ -16,7 +16,7 @@ public class EntityZombie extends EntityMonster {
2016-03-01 00:09:49 +01:00
protected static final IAttribute a = (new AttributeRanged((IAttribute) null, "zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance");
private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
- private static final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", 0.5D, 1);
+ private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", world.paperConfig.babyZombieMovementSpeed, 1); // Paper - Remove static - Make baby speed configurable
2017-05-14 20:05:01 +02:00
private static final DataWatcherObject<Boolean> bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
private static final DataWatcherObject<Integer> by = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> bz = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.h);
2016-11-17 03:23:38 +01:00
@@ -102,9 +102,9 @@ public class EntityZombie extends EntityMonster {
2016-03-01 00:09:49 +01:00
if (this.world != null && !this.world.isClientSide) {
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
- attributeinstance.c(EntityZombie.c);
+ attributeinstance.c(this.c);
if (flag) {
- attributeinstance.b(EntityZombie.c);
+ attributeinstance.b(this.c);
}
}
--
2018-06-09 13:09:21 +02:00
2.17.1
2016-03-01 00:09:49 +01:00