spigot/CraftBukkit-Patches/0047-Allow-Disabling-Zombie-Villager-Aggression.patch

40 lines
2.1 KiB
Diff
Raw Normal View History

2017-03-15 20:51:00 +11:00
From 39ae368a3093b2690d4a63235fb96f5400ddb78d Mon Sep 17 00:00:00 2001
2014-04-12 14:18:37 +10:00
From: Dylan Xaldin <Puremin0rez515@gmail.com>
Date: Thu, 12 Dec 2013 18:05:03 -0600
Subject: [PATCH] Allow Disabling Zombie Villager Aggression
Ability to configure if Zombies will be aggressive towards Villagers.
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
2016-11-17 12:41:12 +11:00
index 0cce37b..497d559 100644
2014-04-12 14:18:37 +10:00
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
2016-11-17 12:41:12 +11:00
@@ -44,7 +44,7 @@ public class EntityZombie extends EntityMonster {
2014-04-12 14:18:37 +10:00
this.goalSelector.a(6, new PathfinderGoalMoveThroughVillage(this, 1.0D, false));
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, true, new Class[] { EntityPigZombie.class}));
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, true));
2016-03-01 08:33:06 +11:00
- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false));
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false)); // Spigot
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityIronGolem.class, true));
2014-04-12 14:18:37 +10:00
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index bdb7bed..4276472 100644
2014-04-12 14:18:37 +10:00
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -208,4 +208,11 @@ public class SpigotWorldConfig
2016-03-01 08:33:06 +11:00
arrowDespawnRate = getInt( "arrow-despawn-rate", 1200 );
log( "Arrow Despawn Rate: " + arrowDespawnRate );
2014-04-12 14:18:37 +10:00
}
+
+ public boolean zombieAggressiveTowardsVillager;
+ private void zombieAggressiveTowardsVillager()
+ {
+ zombieAggressiveTowardsVillager = getBoolean( "zombie-aggressive-towards-villager", true );
+ log( "Zombie Aggressive Towards Villager: " + zombieAggressiveTowardsVillager );
+ }
}
--
2016-11-17 12:41:12 +11:00
2.9.3
2014-04-12 14:18:37 +10:00