Search in sources :

Example 1 with BaseBlock

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()));
}
Also used : BaseBlock(com.sk89q.worldedit.blocks.BaseBlock) Location(org.bukkit.Location)

Example 2 with BaseBlock

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();
    }
}
Also used : EditSession(com.sk89q.worldedit.EditSession) World(org.spongepowered.api.world.World) BaseBlock(com.sk89q.worldedit.blocks.BaseBlock) SingleBlockPattern(com.sk89q.worldedit.patterns.SingleBlockPattern) MaxChangedBlocksException(com.sk89q.worldedit.MaxChangedBlocksException)

Aggregations

BaseBlock (com.sk89q.worldedit.blocks.BaseBlock)2 EditSession (com.sk89q.worldedit.EditSession)1 MaxChangedBlocksException (com.sk89q.worldedit.MaxChangedBlocksException)1 SingleBlockPattern (com.sk89q.worldedit.patterns.SingleBlockPattern)1 Location (org.bukkit.Location)1 World (org.spongepowered.api.world.World)1