Search in sources :

Example 1 with SingleBlockPattern

use of com.sk89q.worldedit.patterns.SingleBlockPattern 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

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