public TARDISCommands(TARDIS plugin) {
   this.plugin = plugin;
   // add transparent blocks
   transparent.add((byte) Material.AIR.getId());
   transparent.add((byte) Material.SNOW.getId());
   transparent.add((byte) Material.LONG_GRASS.getId());
   transparent.add((byte) Material.VINE.getId());
   // add first arguments
   firstArgs.add("chameleon");
   firstArgs.add("save");
   firstArgs.add("removesave");
   firstArgs.add("list");
   firstArgs.add("help");
   firstArgs.add("find");
   firstArgs.add("reload");
   firstArgs.add("add");
   firstArgs.add("remove");
   firstArgs.add("update");
   firstArgs.add("rebuild");
   firstArgs.add("comehere");
   firstArgs.add("direction");
   firstArgs.add("setdest");
   firstArgs.add("hide");
   firstArgs.add("home");
   firstArgs.add("occupy");
   firstArgs.add("namekey");
   firstArgs.add("version");
 }
 /**
  * Checks if the player is on a ladder or vine.
  *
  * @return If so.
  */
 public boolean isOnLadder() {
   if (onLadder == null) {
     final int typeId = getTypeId();
     onLadder = typeId == Material.LADDER.getId() || typeId == Material.VINE.getId();
   }
   return onLadder;
 }
示例#3
0
 private static void initTransparentBlocks() {
   transparentBlocks.add(((Integer) Material.AIR.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.BREWING_STAND.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.BROWN_MUSHROOM.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.CAKE.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.CROPS.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.DETECTOR_RAIL.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.DIODE_BLOCK_ON.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.DIODE_BLOCK_OFF.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.LADDER.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.LAVA.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.LEVER.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.LONG_GRASS.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.MELON_STEM.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.NETHER_STALK.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.PAINTING.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.PORTAL.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.POWERED_RAIL.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.PUMPKIN_STEM.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.RAILS.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.RED_MUSHROOM.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.RED_ROSE.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.REDSTONE_TORCH_ON.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.REDSTONE_TORCH_OFF.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.REDSTONE_WIRE.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.SAPLING.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.SIGN_POST.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.SNOW.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.TORCH.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.VINE.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.WALL_SIGN.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.WATER.getId()).byteValue());
   transparentBlocks.add(((Integer) Material.YELLOW_FLOWER.getId()).byteValue());
 }
 public PlayerManager() {
   nonSolid.add(0);
   for (int b = 8; b < 12; b++) nonSolid.add(b);
   nonSolid.add(Material.SNOW.getId());
   nonSolid.add(Material.LONG_GRASS.getId());
   nonSolid.add(Material.RED_MUSHROOM.getId());
   nonSolid.add(Material.RED_ROSE.getId());
   nonSolid.add(Material.YELLOW_FLOWER.getId());
   nonSolid.add(Material.BROWN_MUSHROOM.getId());
   nonSolid.add(Material.SIGN_POST.getId());
   nonSolid.add(Material.WALL_SIGN.getId());
   nonSolid.add(Material.FIRE.getId());
   nonSolid.add(Material.TORCH.getId());
   nonSolid.add(Material.REDSTONE_WIRE.getId());
   nonSolid.add(Material.REDSTONE_TORCH_OFF.getId());
   nonSolid.add(Material.REDSTONE_TORCH_ON.getId());
   nonSolid.add(Material.VINE.getId());
 }
 /**
  * Checks if the player is above a ladder or vine.<br>
  * Does not save back value to field.
  *
  * @return If so.
  */
 public boolean isAboveLadder() {
   final int typeId = getTypeIdBelow();
   return typeId == Material.LADDER.getId() || typeId == Material.VINE.getId();
 }