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

40 lines
2.2 KiB
Diff
Raw Normal View History

2019-07-20 09:00:00 +10:00
From 60e175a24f0e37404e8f8dd6695ed242d2446f4f 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
2019-07-20 09:00:00 +10:00
index a8857ebdf..2b4a9ffe8 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
2019-07-20 09:00:00 +10:00
@@ -56,7 +56,7 @@ public class EntityZombie extends EntityMonster {
2018-07-15 10:00:00 +10:00
this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D));
2019-04-23 12:00:00 +10:00
this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(EntityPigZombie.class));
2018-12-26 08:00:00 +11:00
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
2019-04-23 12:00:00 +10:00
- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false));
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); // Spigot
2018-12-26 08:00:00 +11:00
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
2019-04-23 12:00:00 +10:00
this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bz));
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 0c65258fd..807405171 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
@@ -221,4 +221,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 );
+ }
}
--
2019-04-23 09:33:25 +10:00
2.20.1
2014-04-12 14:18:37 +10:00