diff options
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/util/StructureGrowDelegate.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/util/StructureGrowDelegate.java b/src/main/java/org/bukkit/craftbukkit/util/StructureGrowDelegate.java index 6566b9e0..bb6a5796 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/StructureGrowDelegate.java +++ b/src/main/java/org/bukkit/craftbukkit/util/StructureGrowDelegate.java @@ -3,6 +3,8 @@ package org.bukkit.craftbukkit.util; import java.util.ArrayList; import java.util.List; +import net.minecraft.server.Block; +import net.minecraft.server.Blocks; import net.minecraft.server.World; import org.bukkit.BlockChangeDelegate; @@ -39,6 +41,12 @@ public class StructureGrowDelegate implements BlockChangeDelegate { } public int getTypeId(int x, int y, int z) { + for (BlockState state : blocks) { + if (state.getX() == x && state.getY() == y && state.getZ() == z) { + return state.getTypeId(); + } + } + return world.getBlockTypeIdAt(x, y, z); } @@ -51,6 +59,12 @@ public class StructureGrowDelegate implements BlockChangeDelegate { } public boolean isEmpty(int x, int y, int z) { + for (BlockState state : blocks) { + if (state.getX() == x && state.getY() == y && state.getZ() == z) { + return Block.e(state.getTypeId()) == Blocks.AIR; + } + } + return world.getBlockAt(x, y, z).isEmpty(); } } |