testserver/CraftBukkit-Patches/0156-Configurable-baby-zomb...

44 lines
2.0 KiB
Diff
Raw Normal View History

2014-06-22 20:55:54 +00:00
From a9032dacbabca8fe1dbeee1af2b4e34b58df3d43 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Wed, 21 May 2014 15:35:12 -0500
Subject: [PATCH] Configurable baby zombie movement speed
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 6cb5b14..66dd5fa 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -13,11 +13,13 @@ import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityTargetEvent;
//CraftBukkit end
+import org.spigotmc.SpigotWorldConfig; // PaperSpigot
+
public class EntityZombie extends EntityMonster {
protected static final IAttribute bp = (new AttributeRanged("zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).a("Spawn Reinforcements Chance");
private static final UUID bq = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
- private static final AttributeModifier br = new AttributeModifier(bq, "Baby speed boost", 0.5D, 1);
+ private static final AttributeModifier br = new AttributeModifier(bq, "Baby speed boost", SpigotWorldConfig.babyZombieMovementSpeed, 1); // PaperSpigot - Make baby zombie movement speed configurable
private final PathfinderGoalBreakDoor bs = new PathfinderGoalBreakDoor(this);
private int bt;
private boolean bu = false;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 8f8e936..20a1189 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -354,4 +354,10 @@ public class SpigotWorldConfig
{
playerBlockingDamageMultiplier = getFloat( "player-blocking-damage-multiplier", 0.5F );
}
+
+ public static double babyZombieMovementSpeed;
+ private void setBabyZombieMovementSpeed()
+ {
+ babyZombieMovementSpeed = getDouble( "baby-zombie-movement-speed", 0.5D );
+ }
}
--
1.9.1