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

40 lines
2.4 KiB
Diff
Raw Normal View History

2021-07-07 00:00:00 +10:00
From 9dd4307b89014e54accd0832ea66fc93e41758d6 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.
2021-03-16 09:00:00 +11:00
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java
2021-07-07 00:00:00 +10:00
index daed6f0e0..7b60a0a12 100644
2021-03-16 09:00:00 +11:00
--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java
2021-06-11 15:00:00 +10:00
@@ -123,7 +123,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));
2021-06-11 15:00:00 +10:00
+ if ( level.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));
2021-06-11 15:00:00 +10:00
this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.BABY_ON_LAND_SELECTOR));
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
2021-01-31 10:08:46 +11:00
index e1842e6de..d3a4779c2 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
@@ -230,4 +230,11 @@ public class SpigotWorldConfig
2021-01-31 10:08:46 +11:00
tridentDespawnRate = getInt( "trident-despawn-rate", arrowDespawnRate );
log( "Arrow Despawn Rate: " + arrowDespawnRate + " Trident Respawn Rate:" + tridentDespawnRate );
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 );
+ }
}
--
2.25.1
2014-04-12 14:18:37 +10:00