PlotSquared/src/main/java/com/plotsquared/bukkit/util/BukkitSetBlockManager.java

29 lines
976 B
Java
Raw Normal View History

2015-07-30 19:24:01 +02:00
package com.plotsquared.bukkit.util;
2015-02-23 06:29:45 +01:00
2015-07-30 16:25:16 +02:00
import java.util.ArrayList;
import java.util.Collection;
2015-02-23 06:29:45 +01:00
import org.bukkit.Chunk;
import org.bukkit.World;
2015-07-30 16:25:16 +02:00
import com.intellectualcrafters.plot.object.ChunkLoc;
import com.intellectualcrafters.plot.util.BlockUpdateUtil;
2015-02-23 06:29:45 +01:00
public abstract class BukkitSetBlockManager extends BlockUpdateUtil {
public static BukkitSetBlockManager setBlockManager = null;
public abstract void set(final org.bukkit.World world, final int x, final int y, final int z, final int blockId, final byte data);
public abstract void update(Collection<Chunk> list);
2015-02-23 06:29:45 +01:00
@Override
public void update(final String worldname, final Collection<ChunkLoc> chunkLocs) {
2015-02-23 06:29:45 +01:00
final World world = BukkitUtil.getWorld(worldname);
final ArrayList<Chunk> chunks = new ArrayList<Chunk>();
for (final ChunkLoc loc : chunkLocs) {
chunks.add(world.getChunkAt(loc.x, loc.z));
}
setBlockManager.update(chunks);
}
}