Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
36 Zeilen
2.0 KiB
Diff
36 Zeilen
2.0 KiB
Diff
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 38aa300d296124729297aa5c6975f797961d7063..fbfff8b0647bdd1caf8b4ff0841a230417bebdb6 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 b73968d0aa35d42db3cfecbbb056f24d87fb5cf5..d6bff18a60e1b0b507a3797742bfafff2fad10d2 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java
|
|
@@ -323,7 +323,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
|
BlockPos blockposition1 = blockposition.below();
|
|
BlockState iblockdata = world.getBlockState(blockposition1);
|
|
|
|
- if (!iblockdata.entityCanStandOn(world, blockposition1, this)) {
|
|
+ if (!iblockdata.entityCanStandOn(world, blockposition1, this) && !level.paperConfig.ironGolemsCanSpawnInAir) { // Paper
|
|
return false;
|
|
} else {
|
|
for (int i = 1; i < 3; ++i) {
|