Add option for zombies targetting turtle eggs

This commit is contained in:
William Blake Galbreath
2019-08-17 15:28:30 -05:00
parent 7853ac14cd
commit 04cc274bbf
2 changed files with 47 additions and 0 deletions

View File

@@ -192,6 +192,11 @@ mobs
- **default**: 2 - **default**: 2
- **description**: How often (in ticks) should villager's tick their brain logic. Vanilla value is to tick every tick (1). Higher amounts makes them tick less often to reduce lag, but setting it too high could result is unresponsive villagers. - **description**: How often (in ticks) should villager's tick their brain logic. Vanilla value is to tick every tick (1). Higher amounts makes them tick less often to reduce lag, but setting it too high could result is unresponsive villagers.
* zombie
* target-turtle-eggs
- **default**: true
- **description**: Should zombies target/stomp turtle eggs
* zombie_horse * zombie_horse
* spawn-chance * spawn-chance
- **default**: 0 - **default**: 0

View File

@@ -0,0 +1,42 @@
From ac6b964fcc587f744b965cfd03e45663667bb065 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 17 Aug 2019 15:27:09 -0500
Subject: [PATCH] Add option for zombies targetting turtle eggs
---
src/main/java/net/minecraft/server/EntityZombie.java | 2 +-
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 96676a786..b426941f5 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -48,7 +48,7 @@ public class EntityZombie extends EntityMonster {
@Override
protected void initPathfinder() {
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
- this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3));
+ if (net.pl3x.purpur.PurpurConfig.zombieTargetsTurtleEggs)this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3)); // Purpur
this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
this.l();
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index ee83df5cc..0022211be 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -248,6 +248,11 @@ public class PurpurConfig {
villagerBrainTicks = getInt("settings.mobs.villager.brain-ticks", villagerBrainTicks);
}
+ public static boolean zombieTargetsTurtleEggs = true;
+ private static void zombieSettings() {
+ zombieTargetsTurtleEggs = getBoolean("settings.mobs.zombie.target-turtle-eggs", zombieTargetsTurtleEggs);
+ }
+
public static float zombieHorseSpawnChance = 0F;
private static void zombieHorseSettings() {
zombieHorseSpawnChance = (float) getDouble("settings.mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
--
2.23.0.rc1