2019-07-28 16:32:14 +02:00
From 21e836a230f6b4ef85345c5faf0bd367259b1113 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
2019-07-28 16:32:14 +02:00
index 098bd3fba..55d8e74f8 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-07-24 02:24:44 +02:00
@@ -73,4 +73,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
2019-07-28 16:32:14 +02:00
index b8761e706..a3af14630 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
2019-07-28 16:32:14 +02:00
@@ -21,7 +21,7 @@ public class EntityZombie extends EntityMonster {
2016-03-01 00:09:49 +01:00
2019-04-24 03:00:24 +02:00
protected static final IAttribute d = (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, AttributeModifier.Operation.MULTIPLY_BASE);
2019-05-05 23:39:51 +02:00
+ private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", world.paperConfig.babyZombieMovementSpeed, AttributeModifier.Operation.MULTIPLY_BASE); private final AttributeModifier babyModifier = this.c; // Paper - remove static - Make baby speed configurable
2019-04-24 03:00:24 +02:00
private static final DataWatcherObject<Boolean> bz = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
private static final DataWatcherObject<Integer> bA = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
public static final DataWatcherObject<Boolean> DROWN_CONVERTING = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
2019-07-28 16:32:14 +02:00
@@ -129,9 +129,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);
2019-07-20 06:01:24 +02:00
- attributeinstance.removeModifier(EntityZombie.c);
+ attributeinstance.removeModifier(this.babyModifier); // Paper
2016-03-01 00:09:49 +01:00
if (flag) {
2019-07-20 06:01:24 +02:00
- attributeinstance.addModifier(EntityZombie.c);
+ attributeinstance.addModifier(this.babyModifier); // Paper
2016-03-01 00:09:49 +01:00
}
}
--
2019-07-20 06:01:24 +02:00
2.22.0
2016-03-01 00:09:49 +01:00