public void doEffect() { try { if (effectID == 0) return; if (effectID == 2001 && BlockType.fromID(effectData) == null) return; Block b = SignUtil.getBackBlock(BukkitUtil.toSign(getSign()).getBlock()); for (int i = 0; i < times; i++) { b.getWorld() .playEffect(b.getLocation().add(offset), Effect.getById(effectID), effectData, 50); } } catch (Exception ignored) { } }
public boolean actSecondary( ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session, WorldVector clicked) { LocalWorld world = clicked.getWorld(); EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(world, -1, player); targetBlock = (editSession).getBlock(clicked); BlockType type = BlockType.fromID(targetBlock.getType()); if (type != null) { player.print("Replacer tool switched to: " + type.getName()); } return true; }
@Override public boolean usesBlockData(int type) { // We future proof here by assuming all unknown blocks use data return BlockType.usesData(type) || BlockType.fromID(type) == null; }
@Override public boolean isValidBlockType(int type) { return BlockType.fromID(type) != null; }