Files
Purpur/patches/server/0040-Make-Iron-Golems-Swim.patch
William Blake Galbreath 6a50851051 Rebuild patches
2020-08-23 16:16:47 -05:00

35 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 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
diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java
index 0a5c27e73..bdff23688 100644
--- a/src/main/java/net/minecraft/server/EntityIronGolem.java
+++ b/src/main/java/net/minecraft/server/EntityIronGolem.java
@@ -24,6 +24,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable {
@Override
protected void initPathfinder() {
+ if (world.purpurConfig.ironGolemCanSwim) this.goalSelector.a(0, new PathfinderGoalFloat(this)); // Purpur
this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, true));
this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.9D, 32.0F));
this.goalSelector.a(2, new PathfinderGoalStrollVillage(this, 0.6D, false));
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 52e459002..1bee83e61 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -137,6 +137,11 @@ public class PurpurWorldConfig {
illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
}
+ public boolean ironGolemCanSwim = false;
+ private void ironGolemSettings() {
+ ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
+ }
+
public double rabbitNaturalToast = 0.0D;
public double rabbitNaturalKiller = 0.0D;
private void rabbitSettings() {