Files
Purpur/patches/server/0030-Make-Iron-Golems-Swim.patch
William Blake Galbreath a32448bda1 Merge in Tuinity patches
2020-03-08 12:49:59 -05:00

43 lines
2.2 KiB
Diff

From 389fb5986fcd93d1b4ffca65e00d40379d6a7402 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 e2604d54b..55c026d73 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -336,10 +336,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