Paper/Spigot-Server-Patches/0562-Add-zombie-targets-turtle-egg-config.patch

34 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 23 Aug 2020 15:47:34 +0200
Subject: [PATCH] Add zombie targets turtle egg config
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 54e23de4a5058d6327bd2fdc7016e2ac3b287af1..11460f83fa2f4b075a4d37c0ff94ace960a89b60 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -656,4 +656,9 @@ public class PaperWorldConfig {
maxLightningFlashDistance = 512; // Vanilla value
}
}
+
+ public boolean zombiesTargetTurtleEggs = true;
+ private void zombiesTargetTurtleEggs() {
+ zombiesTargetTurtleEggs = getBoolean("zombies-target-turtle-eggs", zombiesTargetTurtleEggs);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 2ad7a9634a26c19c52b52d8da3eb5446ef113823..a11612fa05f171bbdcc3ad525d9f371cc099ac50 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -46,7 +46,7 @@ public class EntityZombie extends EntityMonster {
@Override
protected void initPathfinder() {
- this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3));
+ if (world.paperConfig.zombiesTargetTurtleEggs) this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3)); // Paper
this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
this.m();