Search in sources :

Example 1 with BlockAction

use of me.botsko.prism.actions.BlockAction in project Prism-Bukkit by prism.

the class ActionFactory method createBlock.

/**
     * GenericAction
     * 
     * @param action_type
     * @param player
     */
public static Handler createBlock(String action_type, String player) {
    final BlockAction a = new BlockAction();
    a.setActionType(action_type);
    a.setPlayerName(player);
    return a;
}
Also used : BlockAction(me.botsko.prism.actions.BlockAction)

Example 2 with BlockAction

use of me.botsko.prism.actions.BlockAction in project Prism-Bukkit by prism.

the class ActionFactory method createBlock.

/**
     * BlockAction
     *
     * @param action_type
     * @param state
     * @param player
     */
public static Handler createBlock(String action_type, BlockState state, String player) {
    final BlockAction a = new BlockAction();
    a.setActionType(action_type);
    a.setBlock(state);
    a.setPlayerName(player);
    return a;
}
Also used : BlockAction(me.botsko.prism.actions.BlockAction)

Example 3 with BlockAction

use of me.botsko.prism.actions.BlockAction in project Prism-Bukkit by prism.

the class PrismPlayerEvents method recordCocoaPlantEvent.

/**
     * 
     * @param block
     * @param inhand
     * @param player
     */
protected void recordCocoaPlantEvent(Block block, ItemStack inhand, BlockFace clickedFace, String player) {
    if (!Prism.getIgnore().event("block-place", block))
        return;
    if (block.getType().equals(Material.LOG) && block.getData() >= 3 && inhand.getTypeId() == 351 && inhand.getDurability() == 3) {
        final Location newLoc = block.getRelative(clickedFace).getLocation();
        final Block actualBlock = block.getWorld().getBlockAt(newLoc);
        // This is a lame way to do this
        final BlockAction action = new BlockAction();
        action.setActionType("block-place");
        action.setPlayerName(player);
        action.setX(actualBlock.getX());
        action.setY(actualBlock.getY());
        action.setZ(actualBlock.getZ());
        action.setWorldName(newLoc.getWorld().getName());
        action.setBlockId(127);
        action.setBlockSubId((byte) 1);
        RecordingQueue.addToQueue(action);
    }
}
Also used : BlockAction(me.botsko.prism.actions.BlockAction) Block(org.bukkit.block.Block) Location(org.bukkit.Location)

Example 4 with BlockAction

use of me.botsko.prism.actions.BlockAction in project Prism-Bukkit by prism.

the class ActionFactory method createBlock.

/**
     * BlockAction
     *
     * @param action_type
     * @param block
     * @param player
     */
public static Handler createBlock(String action_type, Block block, String player) {
    final BlockAction a = new BlockAction();
    a.setActionType(action_type);
    a.setBlock(block);
    a.setPlayerName(player);
    return a;
}
Also used : BlockAction(me.botsko.prism.actions.BlockAction)

Aggregations

BlockAction (me.botsko.prism.actions.BlockAction)4 Location (org.bukkit.Location)1 Block (org.bukkit.block.Block)1