From a90a7edd7648b74e74afd5c2e4e3fedc42b32d6e Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 10 Mar 2012 23:01:39 -0600 Subject: [PATCH] Only remove blocks when golem is successfully spawned. Fixes BUKKIT-1094 By: feildmaster --- .../craftbukkit/util/BlockStateListPopulator.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java b/paper-server/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java index eb83172e86..2c27517386 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.util; +import java.util.ArrayList; import java.util.List; import org.bukkit.World; import org.bukkit.block.BlockState; @@ -8,6 +9,10 @@ public class BlockStateListPopulator { private final World world; private final List list; + public BlockStateListPopulator(World world) { + this(world, new ArrayList()); + } + public BlockStateListPopulator(World world, List list) { this.world = world; this.list = list; @@ -19,6 +24,12 @@ public class BlockStateListPopulator { list.add(state); } + public void updateList() { + for (BlockState state : list) { + state.update(true); + } + } + public List getList() { return list; }