mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 04:55:47 +01:00
e4d10a6d67
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 122289ff Add FaceAttachable interface to handle Grindstone facing in common with Switches a6db750e SPIGOT-5647: ZombieVillager entity should have getVillagerType() CraftBukkit Changes:bbe3d58e
SPIGOT-5650: Lectern.setPage(int) causes a NullPointerException3075579f
Add FaceAttachable interface to handle Grindstone facing in common with Switches95bd4238
SPIGOT-5647: ZombieVillager entity should have getVillagerType()4d975ac3
SPIGOT-5617: setBlockData does not work when NotPlayEvent is called by redstone current
55 lines
3.1 KiB
Diff
55 lines
3.1 KiB
Diff
From c71eb474e0735aac8eea843c10613e160978410b Mon Sep 17 00:00:00 2001
|
|
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 098bd3fba8..912611cf1a 100644
|
|
--- 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 {
|
|
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);
|
|
+ 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);
|
|
+ }
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
index 7783b57912..0240cef74a 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
@@ -21,7 +21,7 @@ public class EntityZombie extends EntityMonster {
|
|
|
|
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);
|
|
+ private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", world.paperConfig.babyZombieMovementModifier, AttributeModifier.Operation.MULTIPLY_BASE); private final AttributeModifier babyModifier = this.c; // Paper - remove static - Make baby speed configurable
|
|
private static final DataWatcherObject<Boolean> bw = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
|
|
private static final DataWatcherObject<Integer> bx = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
|
|
public static final DataWatcherObject<Boolean> DROWN_CONVERTING = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
|
|
@@ -129,9 +129,9 @@ public class EntityZombie extends EntityMonster {
|
|
if (this.world != null && !this.world.isClientSide) {
|
|
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
|
|
|
- attributeinstance.removeModifier(EntityZombie.c);
|
|
+ attributeinstance.removeModifier(this.babyModifier); // Paper
|
|
if (flag) {
|
|
- attributeinstance.addModifier(EntityZombie.c);
|
|
+ attributeinstance.addModifier(this.babyModifier); // Paper
|
|
}
|
|
}
|
|
|
|
--
|
|
2.25.1
|
|
|