예제 #1
0
  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) {
    }
  }
예제 #2
0
  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;
  }
예제 #3
0
 @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;
 }
예제 #4
0
 @Override
 public boolean isValidBlockType(int type) {
   return BlockType.fromID(type) != null;
 }