Example #1
0
  public void applyInventory(final BattlePlayer p) {
    Player pl = (Player) p;
    Inventory i = pl.getInventory();

    ItemStack HEALTH_POTION = new ItemStack(Material.POTION, 1, (short) 16373);
    ItemStack COOKED_FISH = new ItemStack(Material.COOKED_FISH, 2);
    ItemStack BOW = new ItemStack(Material.BOW, 1);
    ItemStack ARROWS = new ItemStack(Material.ARROW, 48);
    ItemStack LEATHER_HELMET = new ItemStack(Material.LEATHER_HELMET, 1);
    ItemStack IRON_CHESTPLATE = new ItemStack(Material.IRON_CHESTPLATE, 1);
    ItemStack CHAINMAIL_PANTS = new ItemStack(Material.CHAINMAIL_LEGGINGS, 1);
    ItemStack GOLD_BOOTS = new ItemStack(Material.GOLD_BOOTS, 1);
    ItemStack IRON_SWORD = new ItemStack(Material.IRON_SWORD, 1);

    ArmourUtils.colourArmourAccordingToTeam(p, new ItemStack[] {LEATHER_HELMET});

    pl.getInventory().setBoots(GOLD_BOOTS);
    pl.getInventory().setLeggings(CHAINMAIL_PANTS);
    pl.getInventory().setChestplate(IRON_CHESTPLATE);
    pl.getInventory().setHelmet(LEATHER_HELMET);

    i.setItem(0, IRON_SWORD);
    i.setItem(1, BOW);
    i.setItem(3, COOKED_FISH);
    i.setItem(4, HEALTH_POTION);
    i.setItem(28, ARROWS);

    if (p.getTeamType() == Team.TDM_BLUE) p.setItem(5, Material.ENDER_PEARL, 2);
  }
Example #2
0
  public void applyInventory(final BattlePlayer p) {
    Inventory i = p.getInventory();

    ItemStack HEALTH_POTION = new ItemStack(Material.POTION, 1, (short) 16373);
    ItemStack STEAK = new ItemStack(Material.COOKED_BEEF, 3);
    ItemStack BOW = new ItemStack(Material.BOW, 1);
    ItemStack ARROWS = new ItemStack(Material.ARROW, 64);
    ItemStack IRON_HELMET = new ItemStack(Material.IRON_HELMET, 1);
    ItemStack IRON_CHESTPLATE = new ItemStack(Material.IRON_CHESTPLATE, 1);
    ItemStack IRON_PANTS = new ItemStack(Material.IRON_LEGGINGS, 1);
    ItemStack IRON_BOOTS = new ItemStack(Material.IRON_BOOTS, 1);
    ItemStack IRON_SWORD = new ItemStack(Material.IRON_SWORD, 1);
    ItemStack EXP = new ItemStack(Material.EXP_BOTTLE, 5);
    ItemStack FISHING_ROD = new ItemStack(Material.FISHING_ROD, 1);

    ItemMeta fishing_rod = FISHING_ROD.getItemMeta();
    fishing_rod.setDisplayName(ChatColor.BLUE + "Grappling hook");
    FISHING_ROD.setItemMeta(fishing_rod);

    p.getInventory().setBoots(IRON_BOOTS);
    p.getInventory().setLeggings(IRON_PANTS);
    p.getInventory().setChestplate(IRON_CHESTPLATE);
    p.getInventory().setHelmet(IRON_HELMET);

    i.setItem(0, IRON_SWORD);
    i.setItem(1, BOW);
    i.setItem(2, FISHING_ROD);
    i.setItem(5, EXP);
    i.setItem(3, STEAK);
    i.setItem(4, HEALTH_POTION);
    i.setItem(9, ARROWS);
    p.getInventory().getBoots().addEnchantment(Enchantment.PROTECTION_FALL, 4);
  }
Example #3
0
  public void applyInventory(final BattlePlayer p) {
    Inventory i = p.getInventory();

    ItemStack HEALTH_POTION = new ItemStack(Material.POTION, 1, (short) 16373);
    ItemStack STEAK = new ItemStack(Material.COOKED_BEEF, 3);
    ItemStack BOW = new ItemStack(Material.BOW, 1);
    ItemStack ARROWS = new ItemStack(Material.ARROW, 64);
    ItemStack LEATHER_BOOTS = new ItemStack(Material.LEATHER_BOOTS, 1);
    ItemStack LEATHER_PANTS = new ItemStack(Material.LEATHER_LEGGINGS, 1);
    ItemStack LEATHER_CHESTPLATE = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
    ItemStack MASK = new ItemStack(Material.SKULL_ITEM, 1);
    ItemStack STONE_SWORD = new ItemStack(Material.STONE_SWORD, 1);
    ItemStack EXP = new ItemStack(Material.EXP_BOTTLE, 5);

    ArmourUtils.colourArmourAccordingToTeam(
        p, new ItemStack[] {LEATHER_CHESTPLATE, LEATHER_PANTS, LEATHER_BOOTS});
    MASK.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 1);

    p.getInventory().setBoots(LEATHER_BOOTS);
    p.getInventory().setLeggings(LEATHER_PANTS);
    p.getInventory().setChestplate(LEATHER_CHESTPLATE);
    p.getInventory().setHelmet(MASK);

    i.setItem(0, STONE_SWORD);
    i.setItem(1, BOW);
    i.setItem(2, STEAK);
    i.setItem(3, HEALTH_POTION);
    i.setItem(4, EXP);
    i.setItem(9, ARROWS);
  }
 public void applyInventory(final BattlePlayer p) {
   p.sendMessage(ChatColor.GOLD + "Welcome to The Battle Reverie!");
   p.sendMessage(
       ChatColor.GOLD
           + "This is an arena that specialises in "
           + ChatColor.BOLD
           + "quadruple brawling!");
 }
  public void applyInventory(final BattlePlayer p) {
    Inventory i = p.getInventory();

    ItemStack IRON_HELMET = new ItemStack(Material.IRON_HELMET, 1);
    ItemStack LEATHER_CHESTPLATE = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
    ItemStack IRON_PANTS = new ItemStack(Material.IRON_LEGGINGS, 1);
    ItemStack IRON_BOOTS = new ItemStack(Material.IRON_BOOTS, 1);

    ArmourUtils.colourArmourAccordingToTeam(p, new ItemStack[] {LEATHER_CHESTPLATE});

    p.getInventory().setBoots(IRON_BOOTS);
    p.getInventory().setLeggings(IRON_PANTS);
    p.getInventory().setChestplate(LEATHER_CHESTPLATE);
    p.getInventory().setHelmet(IRON_HELMET);

    i.setItem(0, new ItemStack(Material.DIAMOND_SWORD, 1));
    i.setItem(1, new ItemStack(Material.BOW, 1));
    i.setItem(2, new ItemStack(Material.DIAMOND_PICKAXE, 1));
    i.setItem(3, new ItemStack(Material.COOKED_BEEF, 3));
    i.setItem(4, new ItemStack(Material.GOLDEN_APPLE, 2));
    i.setItem(5, new ItemStack(Material.LOG, 64));
    i.setItem(8, new ItemStack(Material.ENDER_PEARL, 1));
    i.setItem(9, new ItemStack(Material.ARROW, 64));
  }
  @EventHandler
  public void onBlockClick(PlayerInteractEvent event) {

    Player p = event.getPlayer();

    if (p.getLocation().getWorld().getName().equals(getName())) {

      if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
        Block b = event.getClickedBlock();
        World w = Bukkit.getWorld(getName());

        Team team = BattlePlayer.getBattlePlayer(p).getTeamType();
        if (b.getType().equals(Material.PISTON_BASE)) {
          if (b.getLocation().equals(new Location(w, -38, 75, 43))) {
            p.teleport(new Location(w, -29, 74, 43)); // red
          } else if (b.getLocation().equals(new Location(w, 74, 75, 43))) {
            p.teleport(new Location(w, 66, 75, 43)); // blue
          }
        }
      }
    }
  }
 public void applyInventory(final BattlePlayer p) {
   p.sendMessage(ChatColor.GOLD + "Interact with one of the signs to change class!");
 }