2020-05-06 11:48:49 +02:00
From 0000000000000000000000000000000000000000 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
2020-11-12 05:58:42 +01:00
index d97288b27668e0544b05ce110bfc6a0834cc263d..29f35535fab41aee6d253de9f9bd566d0fc28d65 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
2020-11-12 05:58:42 +01:00
@@ -74,4 +74,15 @@ public class PaperWorldConfig {
2016-03-01 00:09:49 +01:00
log("Max height for cactus growth " + cactusMaxHeight + ". Max height for reed growth " + reedMaxHeight);
}
+
2019-10-27 00:55:58 +02:00
+ public double babyZombieMovementModifier;
+ private void babyZombieMovementModifier() {
+ babyZombieMovementModifier = getDouble("baby-zombie-movement-modifier", 0.5D);
2019-10-27 01:07:42 +02:00
+ if (PaperConfig.version < 20) {
2019-10-27 00:55:58 +02:00
+ babyZombieMovementModifier = getDouble("baby-zombie-movement-speed", 0.5D);
+ set("baby-zombie-movement-modifier", babyZombieMovementModifier);
+ }
+
+ log("Baby zombies will move at the speed of " + babyZombieMovementModifier);
2016-03-01 00:09:49 +01:00
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
2020-11-12 05:58:42 +01:00
index a3f608e3a06abfa4268278b6f1298ece36264a02..d07847876e22971b4a90f67d8281bf08361424e0 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
2020-06-25 11:27:25 +02:00
@@ -21,7 +21,7 @@ import org.bukkit.event.entity.EntityTransformEvent;
public class EntityZombie extends EntityMonster {
2016-03-01 00:09:49 +01:00
2019-04-24 03:00:24 +02:00
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);
2020-06-25 11:27:25 +02:00
+ private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE); private final AttributeModifier babyModifier = this.c; // Paper - remove static - Make baby speed configurable
private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
2020-08-25 04:22:08 +02:00
private static final DataWatcherObject<Integer> bo = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
2019-04-24 03:00:24 +02:00
public static final DataWatcherObject<Boolean> DROWN_CONVERTING = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
2020-08-25 04:22:08 +02:00
@@ -124,9 +124,9 @@ public class EntityZombie extends EntityMonster {
2016-03-01 00:09:49 +01:00
if (this.world != null && !this.world.isClientSide) {
2020-06-25 11:27:25 +02:00
AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
2016-03-01 00:09:49 +01:00
2020-06-25 11:27:25 +02:00
- attributemodifiable.removeModifier(EntityZombie.c);
+ attributemodifiable.removeModifier(this.babyModifier); // Paper
2016-03-01 00:09:49 +01:00
if (flag) {
2020-06-25 11:27:25 +02:00
- attributemodifiable.b(EntityZombie.c);
+ attributemodifiable.b(this.babyModifier); // Paper
2016-03-01 00:09:49 +01:00
}
}