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 new file mode 100644 index 0000000000..eb83172e86 --- /dev/null +++ b/paper-server/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 list; + + public BlockStateListPopulator(World world, List 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 getList() { + return list; + } + + public World getWorld() { + return world; + } +}