Paper/Spigot-Server-Patches/0559-Add-zombie-targets-turtle-egg-config.patch
Josh Roy b31089a929
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5325)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
d264e972 #591: Add option for a consumer before spawning an item
1c537fce #590: Add spawn and transform reasons for piglin zombification.

CraftBukkit Changes:
ee5006d1 #810: Add option for a consumer before spawning an item
f6a39d3c #809: Add spawn and transform reasons for piglin zombification.
0c24068a Organise imports

Spigot Changes:
bff52619 Organise imports
2021-03-08 15:12:31 -08:00

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 978062774c1db286bfb9b0ffdef19d880b1f249b..36ecdfce84141ac731b827e469ac842f5c666259 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -668,4 +668,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 555c74feb0d678d8f05d89e274f4736fc35ffebf..3e0b12fef4e0aa5bf8a9b905b829e2a305a53d12 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -45,7 +45,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();