testserver/Spigot-Server-Patches/0011-Configurable-baby-zomb...

52 lines
3.1 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2016-02-29 23:09:49 +00: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
index 098bd3fba867c0e4c6c58748aa6e2e632737a948..912611cf1aeccf5a82a789aab07d76723d4357cc 100644
2016-02-29 23:09:49 +00:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -73,4 +73,15 @@ public class PaperWorldConfig {
2016-02-29 23:09:49 +00:00
log("Max height for cactus growth " + cactusMaxHeight + ". Max height for reed growth " + reedMaxHeight);
}
+
+ public double babyZombieMovementModifier;
+ private void babyZombieMovementModifier() {
+ babyZombieMovementModifier = getDouble("baby-zombie-movement-modifier", 0.5D);
2019-10-26 23:07:42 +00:00
+ if (PaperConfig.version < 20) {
+ 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-02-29 23:09:49 +00:00
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 4b924ce42c9440c06c8c4f04dd4262289cfee6b7..951cf5546af11434971a26dca15c20c25e6c555e 100644
2016-02-29 23:09:49 +00:00
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
2020-06-25 09:27:25 +00:00
@@ -21,7 +21,7 @@ import org.bukkit.event.entity.EntityTransformEvent;
public class EntityZombie extends EntityMonster {
2016-02-29 23:09:49 +00:00
2019-04-24 01:00:24 +00: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 09:27:25 +00: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);
private static final DataWatcherObject<Integer> bv = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
2019-04-24 01:00:24 +00:00
public static final DataWatcherObject<Boolean> DROWN_CONVERTING = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
2020-06-25 09:27:25 +00:00
@@ -123,9 +123,9 @@ public class EntityZombie extends EntityMonster {
2016-02-29 23:09:49 +00:00
if (this.world != null && !this.world.isClientSide) {
2020-06-25 09:27:25 +00:00
AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
2016-02-29 23:09:49 +00:00
2020-06-25 09:27:25 +00:00
- attributemodifiable.removeModifier(EntityZombie.c);
+ attributemodifiable.removeModifier(this.babyModifier); // Paper
2016-02-29 23:09:49 +00:00
if (flag) {
2020-06-25 09:27:25 +00:00
- attributemodifiable.b(EntityZombie.c);
+ attributemodifiable.b(this.babyModifier); // Paper
2016-02-29 23:09:49 +00:00
}
}