Files
Purpur/patches/server/0027-Make-Iron-Golems-Swim.patch
William Blake Galbreath 4757060211 Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
df0d7b0d Update upstream CB
6ea3c2cf [CI-SKIP] Rebuild patches
d7bed4cb Heavily optimise random block ticking (#2914)
b66d9ff8 Update upstream CB
ba71c5d6 Stop stripping private use block Unicode from signs
28d9dcfc Entity Jump API (#1587)
9976a768 Fix PlayerNaturallySpawnCreaturesEvent boolean inversion
054e20da Clean up imports on ThrownEggHatchEvent
a8984ccb Add ThrownEggHatchEvent (#1982)
9f24d495 Allow nerfed blazes, endermen to take water damage (#2847)
2020-02-12 21:21:34 -06:00

43 lines
2.2 KiB
Diff

From 7ca5c1da4ff3f87675377993d9051bc7f81299e2 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 15 Jun 2019 03:12:15 -0500
Subject: [PATCH] Make Iron Golems Swim
---
src/main/java/net/minecraft/server/EntityIronGolem.java | 1 +
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
2 files changed, 3 insertions(+)
diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java
index 46e4574e5..5414d6975 100644
--- a/src/main/java/net/minecraft/server/EntityIronGolem.java
+++ b/src/main/java/net/minecraft/server/EntityIronGolem.java
@@ -36,6 +36,7 @@ public class EntityIronGolem extends EntityGolem {
@Override
protected void initPathfinder() {
+ if (world.purpurConfig.ironGolemCanSwim) this.goalSelector.a(0, new PathfinderGoalFloat(this)); // Purpur
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, true));
this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.9D, 32.0F));
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 737eecb34..2d51bbab2 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -333,10 +333,12 @@ public class PurpurWorldConfig {
public boolean ironGolemRidable = false;
public boolean ironGolemRidableInWater = false;
public boolean ironGolemRequireShiftToMount = true;
+ public boolean ironGolemCanSwim = false;
private void ironGolemSettings() {
ironGolemRidable = getBoolean("mobs.iron_golem.ridable", ironGolemRidable);
ironGolemRidableInWater = getBoolean("mobs.iron_golem.ridable-in-water", ironGolemRidableInWater);
ironGolemRequireShiftToMount = getBoolean("mobs.iron_golem.require-shift-to-mount", ironGolemRequireShiftToMount);
+ ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
}
public boolean llamaRidableInWater = false;
--
2.24.0