aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0019-Configurable-baby-zombie-movement-speed.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0019-Configurable-baby-zombie-movement-speed.patch')
-rw-r--r--patches/server/0019-Configurable-baby-zombie-movement-speed.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patches/server/0019-Configurable-baby-zombie-movement-speed.patch b/patches/server/0019-Configurable-baby-zombie-movement-speed.patch
new file mode 100644
index 0000000000..e0d10bc34b
--- /dev/null
+++ b/patches/server/0019-Configurable-baby-zombie-movement-speed.patch
@@ -0,0 +1,30 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zach Brown <[email protected]>
+Date: Tue, 1 Mar 2016 13:09:16 -0600
+Subject: [PATCH] Configurable baby zombie movement speed
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+index ee91459775aada8cc2e5c4403436b11c15e8e674..1b48576beca178af14bfab297bd427b5f5bdaf42 100644
+--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
++++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+@@ -77,6 +77,7 @@ public class Zombie extends Monster {
+
+ private static final UUID SPEED_MODIFIER_BABY_UUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
+ private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE);
++ private final AttributeModifier babyModifier = new net.minecraft.world.entity.ai.attributes.AttributeModifier(SPEED_MODIFIER_BABY.getId(), SPEED_MODIFIER_BABY.getName(), this.level.paperConfig().entities.behavior.babyZombieMovementModifier, SPEED_MODIFIER_BABY.getOperation()); // Paper - Make baby speed configurable
+ private static final EntityDataAccessor<Boolean> DATA_BABY_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN);
+ private static final EntityDataAccessor<Integer> DATA_SPECIAL_TYPE_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT);
+ public static final EntityDataAccessor<Boolean> DATA_DROWNED_CONVERSION_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN);
+@@ -184,9 +185,9 @@ public class Zombie extends Monster {
+ if (this.level != null && !this.level.isClientSide) {
+ AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED);
+
+- attributemodifiable.removeModifier(Zombie.SPEED_MODIFIER_BABY);
++ attributemodifiable.removeModifier(this.babyModifier); // Paper
+ if (baby) {
+- attributemodifiable.addTransientModifier(Zombie.SPEED_MODIFIER_BABY);
++ attributemodifiable.addTransientModifier(this.babyModifier); // Paper
+ }
+ }
+