Example #1
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());
 }
Example #2
0
  public void load(DataInputStream in, String name, World w) {
    this.name = name;
    try {
      world = w;
      try {
        double x1 = in.readDouble();
        double y1 = in.readDouble();
        double z1 = in.readDouble();
        catArena.setLocB(world, x1, y1, z1);

        double x2 = in.readDouble();
        double y2 = in.readDouble();
        double z2 = in.readDouble();
        catArena.setLocG(world, x2, y2, z2);

        while (true) {

          int d = in.readInt();
          if (d == Material.CHEST.getId()) {
            blocks.add(new BlocksChest(in, world));
          } else if (d == Material.SIGN.getId() || d == Material.SIGN_POST.getId()) {
            blocks.add(new BlocksSign(in, world));

          } else {
            blocks.add(new Blocks(in, world));
          }
        }
      } catch (EOFException d) {

      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Example #3
0
  /**
   * If a given block is a sign, this will return the Sign state object. If it's not a sign, null
   * will be returned.
   *
   * @param b
   * @return
   */
  public Sign getSignState(final Block b) {
    Sign sign = null;

    final int typeId = b.getTypeId();
    if (typeId == Material.SIGN_POST.getId() || typeId == Material.WALL_SIGN.getId()) {
      BlockState bs = b.getState();
      sign = (Sign) bs;
    }

    return sign;
  }
 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());
 }