use of com.sk89q.worldedit.blocks.BaseBlock in project Prism-Bukkit by prism.
the class PrismWorldEditLogger method onBlockChange.
@Override
protected void onBlockChange(Vector pt, BaseBlock newBlock) {
if (!Prism.config.getBoolean("prism.tracking.world-edit"))
return;
BaseBlock oldBlock = getBlock(pt);
Location loc = new Location(world, pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
RecordingQueue.addToQueue(ActionFactory.createBlockChange("world-edit", loc, oldBlock.getId(), (byte) oldBlock.getData(), newBlock.getId(), (byte) newBlock.getData(), player.getName()));
}
use of com.sk89q.worldedit.blocks.BaseBlock in project Skree by Skelril.
the class SkyWarsInstance method showStartingPlatform.
private void showStartingPlatform(boolean present) {
Location<World> platformLocation = startingLocation.add(0, -1, 0);
EditSession editor = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new WorldResolver(getRegion().getExtent()).getWorldEditWorld(), -1);
com.sk89q.worldedit.Vector origin = new com.sk89q.worldedit.Vector(platformLocation.getX(), platformLocation.getY(), platformLocation.getZ());
BaseBlock targetBlock;
if (present) {
targetBlock = WorldEdit.getInstance().getBaseBlockFactory().getBaseBlock(BlockID.STAINED_GLASS, 15);
} else {
targetBlock = WorldEdit.getInstance().getBaseBlockFactory().getBaseBlock(BlockID.AIR);
}
try {
editor.makeCylinder(origin, new SingleBlockPattern(targetBlock), 12, 1, true);
} catch (MaxChangedBlocksException e) {
e.printStackTrace();
}
}
Aggregations