aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0385-Add-option-to-allow-iron-golems-to-spawn-in-air.patch
blob: 25b2ec11ca7864fa0766669851a2cf900b8f480a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 13 Apr 2019 16:50:58 -0500
Subject: [PATCH] Add option to allow iron golems to spawn in air


diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 1eea1d2b0747b904ff30f0c6debb8f04fcbb6923..9ce95f6b6b53f6f30d3c9aeaee8938354fc0d3b5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -423,6 +423,11 @@ public class PaperWorldConfig {
         scanForLegacyEnderDragon = getBoolean("game-mechanics.scan-for-legacy-ender-dragon", true);
     }
 
+    public boolean ironGolemsCanSpawnInAir = false;
+    private void ironGolemsCanSpawnInAir() {
+        ironGolemsCanSpawnInAir = getBoolean("iron-golems-can-spawn-in-air", ironGolemsCanSpawnInAir);
+    }
+
     public boolean armorStandEntityLookups = true;
     private void armorStandEntityLookups() {
         armorStandEntityLookups = getBoolean("armor-stands-do-collision-entity-lookups", true);
diff --git a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
index cc02d6324c61ce5e6387577fd08c6dfb549001bc..bf731a227944875320857e5838d50f15af13b0c1 100644
--- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
+++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
@@ -322,7 +322,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
         BlockPos blockposition1 = blockposition.below();
         BlockState iblockdata = world.getBlockState(blockposition1);
 
-        if (!iblockdata.entityCanStandOn((BlockGetter) world, blockposition1, (Entity) this)) {
+        if (!iblockdata.entityCanStandOn((BlockGetter) world, blockposition1, (Entity) this) && !level.paperConfig.ironGolemsCanSpawnInAir) { // Paper
             return false;
         } else {
             for (int i = 1; i < 3; ++i) {