summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-01-15 12:00:38 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-15 12:01:11 +0000
commit65f30fd99d2a31d5980eafda3ac70028208f08af (patch)
tree4ff14fef200511049f0f96d2e0c8cb22a25b707a /src/main/java/org
parent233de0de2cc02150c57936b151981bd99ac2e8c6 (diff)
downloadcraftbukkit-65f30fd99d2a31d5980eafda3ac70028208f08af.tar
craftbukkit-65f30fd99d2a31d5980eafda3ac70028208f08af.tar.gz
craftbukkit-65f30fd99d2a31d5980eafda3ac70028208f08af.tar.lz
craftbukkit-65f30fd99d2a31d5980eafda3ac70028208f08af.tar.xz
craftbukkit-65f30fd99d2a31d5980eafda3ac70028208f08af.zip
Dragons now throw events when creating portals
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
new file mode 100644
index 00000000..eb83172e
--- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
@@ -0,0 +1,29 @@
+package org.bukkit.craftbukkit.util;
+
+import java.util.List;
+import org.bukkit.World;
+import org.bukkit.block.BlockState;
+
+public class BlockStateListPopulator {
+ private final World world;
+ private final List<BlockState> list;
+
+ public BlockStateListPopulator(World world, List<BlockState> list) {
+ this.world = world;
+ this.list = list;
+ }
+
+ public void setTypeId(int x, int y, int z, int type) {
+ BlockState state = world.getBlockAt(x, y, z).getState();
+ state.setTypeId(type);
+ list.add(state);
+ }
+
+ public List<BlockState> getList() {
+ return list;
+ }
+
+ public World getWorld() {
+ return world;
+ }
+}