2015-05-26 11:16:27 +02:00
|
|
|
From a0076cb8755ae27f36b727b9a23a2b29f33dfacb Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +02: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
|
2015-05-09 22:23:26 +02:00
|
|
|
index 91bb046..1a8d3d8 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
2015-02-28 12:36:22 +01:00
|
|
|
@@ -38,12 +38,12 @@ public class EntityZombie extends EntityMonster {
|
2014-11-28 02:17:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
protected void n() {
|
2014-07-21 22:46:54 +02:00
|
|
|
- this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityVillager.class, 1.0D, true));
|
2014-11-28 02:17:45 +01:00
|
|
|
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityVillager.class, 1.0D, true)); // Spigot
|
|
|
|
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityIronGolem.class, 1.0D, true));
|
2014-07-21 22:46:54 +02:00
|
|
|
this.goalSelector.a(6, new PathfinderGoalMoveThroughVillage(this, 1.0D, false));
|
2014-11-28 02:17:45 +01:00
|
|
|
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, true, new Class[] { EntityPigZombie.class}));
|
|
|
|
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, true));
|
|
|
|
- this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false));
|
|
|
|
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false)); // Spigot
|
|
|
|
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityIronGolem.class, true));
|
2014-07-21 22:46:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2015-05-26 11:16:27 +02:00
|
|
|
index 5d2b755..f6fc0a2 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2015-05-26 11:16:27 +02:00
|
|
|
@@ -247,4 +247,11 @@ public class SpigotWorldConfig
|
2014-07-21 22:46:54 +02:00
|
|
|
|
|
|
|
antiXrayInstance = new AntiXray( this );
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean zombieAggressiveTowardsVillager;
|
|
|
|
+ private void zombieAggressiveTowardsVillager()
|
|
|
|
+ {
|
|
|
|
+ zombieAggressiveTowardsVillager = getBoolean( "zombie-aggressive-towards-villager", true );
|
|
|
|
+ log( "Zombie Aggressive Towards Villager: " + zombieAggressiveTowardsVillager );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2015-05-09 22:23:26 +02:00
|
|
|
2.1.4
|
2014-07-21 22:46:54 +02:00
|
|
|
|