From ad708dd3f3f506e93dd6652361029e41f2b7e41c Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sat, 13 Apr 2019 17:00:18 -0500 Subject: [PATCH] Add option to allow iron golems to spawn in air (Closes #1965, Closes #1851) --- ...to-allow-iron-golems-to-spawn-in-air.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Spigot-Server-Patches/0447-Add-option-to-allow-iron-golems-to-spawn-in-air.patch diff --git a/Spigot-Server-Patches/0447-Add-option-to-allow-iron-golems-to-spawn-in-air.patch b/Spigot-Server-Patches/0447-Add-option-to-allow-iron-golems-to-spawn-in-air.patch new file mode 100644 index 0000000000..d6d2c88e59 --- /dev/null +++ b/Spigot-Server-Patches/0447-Add-option-to-allow-iron-golems-to-spawn-in-air.patch @@ -0,0 +1,38 @@ +From 1a07d33dd52337ae02f97e5add9c62150bf32990 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath +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 7d408542e..c7cde1d0a 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -415,6 +415,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 int bedSearchRadius = 1; + private void bedSearchRadius() { + bedSearchRadius = getInt("bed-search-radius", 1); +diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java +index 2f764776b..7f6a56776 100644 +--- a/src/main/java/net/minecraft/server/EntityIronGolem.java ++++ b/src/main/java/net/minecraft/server/EntityIronGolem.java +@@ -221,7 +221,7 @@ public class EntityIronGolem extends EntityGolem { + BlockPosition blockposition1 = blockposition.down(); + IBlockData iblockdata = iworldreader.getType(blockposition1); + +- if (!iblockdata.a((IBlockAccess) iworldreader, blockposition1, (Entity) this)) { ++ if (!iblockdata.a((IBlockAccess) iworldreader, blockposition1, (Entity) this) && !world.paperConfig.ironGolemsCanSpawnInAir) { // Paper + return false; + } else { + for (int i = 1; i < 3; ++i) { +-- +2.25.0 +