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

44 lines
2.0 KiB
Diff

From 347bab8975bf4d615060df418ca3c90d15681583 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 48ae578..f818eca 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