Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.Xyfa.kitpvp;
- import Listeners.BlockBreak;
- import Listeners.BlockPlace;
- import Listeners.DropItem;
- import Listeners.EnterRegion;
- import Listeners.EntityExplode;
- import Listeners.EntityHitOrLaunch;
- import Listeners.Fishermanevents;
- import Listeners.Interact;
- import Listeners.LeaveRegion;
- import Listeners.PlayerDeath;
- import Listeners.PlayerJoin;
- import Listeners.PlayerLeave;
- import Listeners.PreProcess;
- import Listeners.Respawn;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.Collection;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.List;
- import java.util.logging.Logger;
- import org.bukkit.Bukkit;
- import org.bukkit.Color;
- import org.bukkit.FireworkEffect;
- import org.bukkit.FireworkEffect.Builder;
- import org.bukkit.FireworkEffect.Type;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.Server;
- import org.bukkit.World;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.command.PluginCommand;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.configuration.file.FileConfigurationOptions;
- import org.bukkit.entity.Firework;
- import org.bukkit.entity.Player;
- import org.bukkit.entity.TNTPrimed;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.PlayerInventory;
- import org.bukkit.inventory.meta.FireworkMeta;
- import org.bukkit.inventory.meta.ItemMeta;
- import org.bukkit.inventory.meta.LeatherArmorMeta;
- import org.bukkit.plugin.PluginManager;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- public class KitPvP
- extends JavaPlugin
- {
- public final Server server = getServer();
- public final Interact interact = new Interact(this);
- public final PlayerJoin pj = new PlayerJoin(this);
- public final DropItem di = new DropItem(this);
- public final PlayerDeath pd = new PlayerDeath(this);
- public final PreProcess pp = new PreProcess(this);
- public final PlayerLeave pl = new PlayerLeave(this);
- public final Respawn r = new Respawn(this);
- public final BlockPlace bp = new BlockPlace(this);
- public final BlockBreak bb = new BlockBreak(this);
- public final Fishermanevents fme = new Fishermanevents(this);
- public final EntityHitOrLaunch ehol = new EntityHitOrLaunch(this);
- public final LeaveRegion lr = new LeaveRegion(this);
- public final EnterRegion er = new EnterRegion(this);
- public final EntityExplode ee = new EntityExplode(this);
- public final ArrayList<Player> stomper = new ArrayList();
- public final HashMap<Player, Boolean> isinRegion = new HashMap();
- public final ArrayList<TNTPrimed> tnts = new ArrayList();
- public final ArrayList<Player> dead = new ArrayList();
- public final HashMap<Player, String> kit = new HashMap();
- public final Logger log = Logger.getLogger("Minecraft");
- public void onEnable()
- {
- this.server.getPluginManager().registerEvents(this.interact, this);
- this.server.getPluginManager().registerEvents(this.pj, this);
- this.server.getPluginManager().registerEvents(this.di, this);
- this.server.getPluginManager().registerEvents(this.pd, this);
- this.server.getPluginManager().registerEvents(this.pp, this);
- this.server.getPluginManager().registerEvents(this.pl, this);
- this.server.getPluginManager().registerEvents(this.r, this);
- this.server.getPluginManager().registerEvents(this.ehol, this);
- this.server.getPluginManager().registerEvents(this.bp, this);
- this.server.getPluginManager().registerEvents(this.bb, this);
- this.server.getPluginManager().registerEvents(this.fme, this);
- this.server.getPluginManager().registerEvents(this.lr, this);
- this.server.getPluginManager().registerEvents(this.er, this);
- this.server.getPluginManager().registerEvents(this.ee, this);
- getCommand("damage").setExecutor(new Damage(this));
- getConfig().options().copyDefaults();
- saveDefaultConfig();
- }
- public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
- {
- if (label.equalsIgnoreCase("kit"))
- {
- if (!(sender instanceof Player))
- {
- sender.sendMessage("Only players can pick kits!");
- return true;
- }
- Player p = (Player)sender;
- if ((args.length == 0) ||
- (args.length >= 2))
- {
- p.sendMessage("§b§lHearty§6§lPVP §8» §bInvalid §6argument§b lenght. Please use §6/Kit (kit)");
- return true;
- }
- if (args[0].equalsIgnoreCase("archer"))
- {
- kit(p.getInventory(), p, "Archer");
- this.kit.put(p, "Archer");
- return true;
- }
- if (args[0].equalsIgnoreCase("pyro"))
- {
- kit(p.getInventory(), p, "Pyro");
- this.kit.put(p, "Pyro");
- return true;
- }
- if (args[0].equalsIgnoreCase("ninja"))
- {
- if (p.hasPermission("KitPvP.kit.ninja"))
- {
- kit(p.getInventory(), p, "Ninja");
- this.kit.put(p, "Ninja");
- return true;
- }
- p.sendMessage("§b§lHearty§6§lPVP §8» §bYou don't have permission to use this kit. Buy it @ http://heartymcpvp.enjin.com");
- return true;
- }
- if (args[0].equalsIgnoreCase("snowporter"))
- {
- if (p.hasPermission("KitPvP.kit.snowporter"))
- {
- kit(p.getInventory(), p, "SnowPorter");
- this.kit.put(p, "SnowPorter");
- return true;
- }
- p.sendMessage("§b§lHearty§6§lPVP §8» §bYou don't have permission to use this kit. Buy it @ http://heartymcpvp.enjin.com");
- return true;
- }
- if (args[0].equalsIgnoreCase("fisherman"))
- {
- kit(p.getInventory(), p, "Fisherman");
- this.kit.put(p, "Fisherman");
- return true;
- }
- if (args[0].equalsIgnoreCase("bomber"))
- {
- kit(p.getInventory(), p, "Bomber");
- this.kit.put(p, "Bomber");
- return true;
- }
- if (args[0].equalsIgnoreCase("snail"))
- {
- if (p.hasPermission("KitPvP.kit.snail"))
- {
- kit(p.getInventory(), p, "Snail");
- this.kit.put(p, "Snail");
- return true;
- }
- p.sendMessage("§b§lHearty§6§lPVP §8» §bYou don't have permission to use this kit. Buy it @ http://heartymcpvp.enjin.com");
- return true;
- }
- if (args[0].equalsIgnoreCase("stomper"))
- {
- if (p.hasPermission("KitPvP.kit.stomper"))
- {
- kit(p.getInventory(), p, "Stomper");
- this.kit.put(p, "Stomper");
- this.stomper.add(p);
- return true;
- }
- p.sendMessage("§b§lHearty§6§lPVP §8» §bYou don't have permission to use this kit. Buy it @ http://heartymcpvp.enjin.com");
- return true;
- }
- if (args[0].equalsIgnoreCase("viper"))
- {
- kit(p.getInventory(), p, "Viper");
- this.kit.put(p, "Viper");
- return true;
- }
- p.sendMessage("§b§lHearty§6§lPVP §8» §bThere is not kit called '§6" + args[0] + "§b'! Use §6/kits§b to see what kits there are.");
- return true;
- }
- if (label.equalsIgnoreCase("menu"))
- {
- if (!(sender instanceof Player))
- {
- sender.sendMessage("Only players can open the menu!");
- return true;
- }
- Player p = (Player)sender;
- openKitMenu(p);
- }
- else if (label.equalsIgnoreCase("kits"))
- {
- sender.sendMessage("§b§lHearty§6§lPVP §8» §bCurrent available kits are: §6Pyro§b, §6Fisherman§b, §6Bomber§b, §6Snail§b, §6SnowPorter§b, §6Ninja§b, §6Stomper§b.");
- return true;
- }
- return false;
- }
- public void launchFireworks(Location loc, Color color, boolean trail, boolean flicker, FireworkEffect.Type effect, int amount)
- {
- int i = 0;
- while (i < amount)
- {
- Firework fw = (Firework)loc.getWorld().spawn(loc, Firework.class);
- FireworkEffect fwme = FireworkEffect.builder().trail(trail).flicker(flicker).withColor(color).with(effect).build();
- FireworkMeta fwm = fw.getFireworkMeta();
- fwm.clearEffects();
- fwm.addEffect(fwme);
- fw.setFireworkMeta(fwm);
- i++;
- }
- }
- public void kit(PlayerInventory inv, Player p, String kit)
- {
- if (!this.dead.contains(p))
- {
- p.sendMessage("§b§lHearty§6§lPVP §8» §bYou choosed kit §6" + kit);
- ItemStack pyroBoots;
- if (kit.equalsIgnoreCase("pyro"))
- {
- ItemStack pyroSword = new ItemStack(Material.WOOD_SWORD);
- ItemMeta pyroSwordMeta = pyroSword.getItemMeta();
- pyroSwordMeta.setDisplayName("§6Pyro Sword");
- List<String> pyroSwordLore = Arrays.asList(new String[] { "§8Set your enemie on fire!!!" });
- pyroSwordMeta.setLore(pyroSwordLore);
- pyroSword.setItemMeta(pyroSwordMeta);
- ItemStack pyroBow = new ItemStack(Material.BOW);
- ItemMeta pyroBowMeta = pyroBow.getItemMeta();
- pyroBowMeta.setDisplayName("§6Pyro Bow");
- List<String> pyroBowLore = Arrays.asList(new String[] { "§8Just a normal bow... NO!", "§8This bow sets your enemie", "§8on fire for 15 seconds!" });
- pyroBowMeta.setLore(pyroBowLore);
- pyroBow.setItemMeta(pyroBowMeta);
- ItemStack pyroArrows = new ItemStack(Material.ARROW, 64);
- ItemStack pyroArrows2 = new ItemStack(Material.ARROW, 64);
- ItemMeta pyroMeta = pyroArrows.getItemMeta();
- pyroMeta.setDisplayName("§6Pyro Arrow");
- pyroArrows.setItemMeta(pyroMeta);
- pyroArrows2.setItemMeta(pyroMeta);
- ItemStack pyroHelmet = new ItemStack(Material.FIRE);
- ItemMeta pyroHelmetMeta = pyroHelmet.getItemMeta();
- pyroHelmetMeta.setDisplayName("§6Pyro Helmet");
- pyroHelmet.setItemMeta(pyroHelmetMeta);
- ItemStack pyroChestplate = new ItemStack(Material.LEATHER_CHESTPLATE);
- ItemMeta pyroChestplateMeta = pyroChestplate.getItemMeta();
- pyroChestplateMeta.setDisplayName("§6Pyro Chestplate");
- pyroChestplate.setItemMeta(pyroChestplateMeta);
- ItemStack pyroLeggings = new ItemStack(Material.LEATHER_LEGGINGS);
- ItemMeta pyroLeggingsMeta = pyroLeggings.getItemMeta();
- pyroLeggingsMeta.setDisplayName("§6Pyro Leggings");
- pyroLeggings.setItemMeta(pyroLeggingsMeta);
- pyroBoots = new ItemStack(Material.LEATHER_BOOTS);
- ItemMeta pyroBootsMeta = pyroBoots.getItemMeta();
- pyroBootsMeta.setDisplayName("§6Pyro Boots");
- pyroBoots.setItemMeta(pyroBootsMeta);
- inv.clear();
- inv.setHelmet(null);
- inv.setChestplate(null);
- inv.setLeggings(null);
- inv.setBoots(null);
- inv.setItem(0, pyroSword);
- inv.setItem(1, pyroBow);
- inv.setItem(19, pyroArrows);
- inv.setItem(28, pyroArrows2);
- inv.setHelmet(pyroHelmet);
- inv.setChestplate(pyroChestplate);
- inv.setLeggings(pyroLeggings);
- inv.setBoots(pyroBoots);
- for (PotionEffect effect : p.getActivePotionEffects()) {
- p.removePotionEffect(effect.getType());
- }
- p.setHealth(20.0D);
- p.setFoodLevel(20);
- this.dead.add(p);
- }
- else
- {
- ItemMeta sbMeta;
- if (kit.equalsIgnoreCase("snowporter"))
- {
- ItemStack snowSword = new ItemStack(Material.STONE_SWORD);
- ItemMeta snowSwordMeta = snowSword.getItemMeta();
- snowSwordMeta.setDisplayName("§fSnowPorter Sword");
- List<String> snowSwordLore = Arrays.asList(new String[] { "§8Hit 'em!" });
- snowSwordMeta.setLore(snowSwordLore);
- snowSword.setItemMeta(snowSwordMeta);
- ItemStack sb = new ItemStack(Material.SNOW_BALL, 16);
- sbMeta = sb.getItemMeta();
- sbMeta.setDisplayName("§fSnowPorter");
- List<String> sbLore = Arrays.asList(new String[] { "§8Throw on a player for a SUPRISE!" });
- sbMeta.setLore(sbLore);
- sb.setItemMeta(sbMeta);
- ItemStack snowHelmet = new ItemStack(Material.SNOW_BALL);
- ItemMeta snowHelmetMeta = snowHelmet.getItemMeta();
- snowHelmetMeta.setDisplayName("§fSnowPorter Helmet");
- snowHelmet.setItemMeta(snowHelmetMeta);
- ItemStack snowChestplate = new ItemStack(Material.IRON_CHESTPLATE);
- ItemMeta snowChestplateMeta = snowChestplate.getItemMeta();
- snowChestplateMeta.setDisplayName("§fSnowPorter Chestplate");
- snowChestplate.setItemMeta(snowChestplateMeta);
- ItemStack snowLeggings = new ItemStack(Material.IRON_LEGGINGS);
- ItemMeta snowLeggingsMeta = snowLeggings.getItemMeta();
- snowLeggingsMeta.setDisplayName("§fSnowPorter Leggings");
- snowLeggings.setItemMeta(snowLeggingsMeta);
- ItemStack snowBoots = new ItemStack(Material.LEATHER_BOOTS);
- ItemMeta snowBootsMeta = snowBoots.getItemMeta();
- snowBootsMeta.setDisplayName("§fSnowPorter Boots");
- snowBoots.setItemMeta(snowBootsMeta);
- inv.clear();
- inv.setHelmet(null);
- inv.setChestplate(null);
- inv.setLeggings(null);
- inv.setBoots(null);
- inv.setItem(0, snowSword);
- inv.setItem(1, sb);
- inv.setHelmet(snowHelmet);
- inv.setChestplate(snowChestplate);
- inv.setLeggings(snowLeggings);
- inv.setBoots(snowBoots);
- for (PotionEffect effect : p.getActivePotionEffects()) {
- p.removePotionEffect(effect.getType());
- }
- p.setHealth(20.0D);
- p.setFoodLevel(20);
- this.dead.add(p);
- }
- else if (kit.equalsIgnoreCase("ninja"))
- {
- ItemStack NinjaSword = new ItemStack(Material.DIAMOND_SWORD);
- ItemMeta NinjaSwordMeta = NinjaSword.getItemMeta();
- NinjaSwordMeta.setDisplayName("§8Ninja Sword");
- List<String> NinjaSwordLore = Arrays.asList(new String[] { "§8REMOVE A RANDOM AMOUNT ", "§8OF HEALTH FROM ", "§8THE PLAYER YOU HIT!" });
- NinjaSwordMeta.setLore(NinjaSwordLore);
- NinjaSword.setItemMeta(NinjaSwordMeta);
- inv.clear();
- inv.setHelmet(null);
- inv.setChestplate(null);
- inv.setLeggings(null);
- inv.setBoots(null);
- inv.setItem(0, NinjaSword);
- for (PotionEffect effect : p.getActivePotionEffects()) {
- p.removePotionEffect(effect.getType());
- }
- p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 100000, 1));
- p.setHealth(20.0D);
- p.setFoodLevel(20);
- this.dead.add(p);
- }
- else
- {
- ItemMeta archerBootsMeta;
- if (kit.equalsIgnoreCase("archer"))
- {
- ItemStack archerSword = new ItemStack(Material.STONE_SWORD);
- ItemMeta archerSwordMeta = archerSword.getItemMeta();
- archerSwordMeta.setDisplayName("§7Archer Sword");
- List<String> archerSwordLore = Arrays.asList(new String[] { "§8Not very useful", "§8if you're a good", "bow-shooter..." });
- archerSwordMeta.setLore(archerSwordLore);
- archerSword.setItemMeta(archerSwordMeta);
- ItemStack archerBow = new ItemStack(Material.STONE_SWORD);
- ItemMeta archerBowMeta = archerBow.getItemMeta();
- archerBowMeta.setDisplayName("§7Archer Bow");
- List<String> archerBowLore = Arrays.asList(new String[] { "§8Bow of gods..." });
- archerBowMeta.setLore(archerBowLore);
- archerBow.setItemMeta(archerBowMeta);
- ItemStack archerHelmet = new ItemStack(Material.CHAINMAIL_HELMET);
- ItemMeta archerHelmetMeta = archerHelmet.getItemMeta();
- archerHelmetMeta.setDisplayName("§7Archer Helmet");
- archerHelmet.setItemMeta(archerHelmetMeta);
- ItemStack archerChestplate = new ItemStack(Material.CHAINMAIL_CHESTPLATE);
- ItemMeta archerChestplateMeta = archerChestplate.getItemMeta();
- archerChestplateMeta.setDisplayName("§7Archer Chestplate");
- archerChestplate.setItemMeta(archerChestplateMeta);
- ItemStack archerLeggings = new ItemStack(Material.CHAINMAIL_LEGGINGS);
- ItemMeta archerLeggingsMeta = archerLeggings.getItemMeta();
- archerLeggingsMeta.setDisplayName("§7Archer Leggings");
- archerLeggings.setItemMeta(archerLeggingsMeta);
- ItemStack archerBoots = new ItemStack(Material.CHAINMAIL_BOOTS);
- archerBootsMeta = archerBoots.getItemMeta();
- archerBootsMeta.setDisplayName("§7Archer Boots");
- archerBoots.setItemMeta(archerBootsMeta);
- inv.clear();
- inv.setHelmet(null);
- inv.setChestplate(null);
- inv.setLeggings(null);
- inv.setBoots(null);
- inv.setItem(0, archerSword);
- inv.setItem(1, archerBow);
- inv.setHelmet(archerHelmet);
- inv.setChestplate(archerChestplate);
- inv.setLeggings(archerLeggings);
- inv.setBoots(archerBoots);
- for (PotionEffect effect : p.getActivePotionEffects()) {
- p.removePotionEffect(effect.getType());
- }
- p.setHealth(20.0D);
- p.setFoodLevel(20);
- this.dead.add(p);
- }
- else
- {
- ItemStack chestplate;
- PotionEffect effect;
- if (kit.equalsIgnoreCase("fisherman"))
- {
- ItemStack fisherman = new ItemStack(Material.STONE_SWORD);
- ItemMeta fishMeta = fisherman.getItemMeta();
- fishMeta.setDisplayName("§bFisherman Sword");
- fisherman.setItemMeta(fishMeta);
- ItemStack rod = new ItemStack(Material.FISHING_ROD);
- ItemMeta rodMeta = rod.getItemMeta();
- rodMeta.setDisplayName("§bFisher");
- rod.setItemMeta(rodMeta);
- ItemStack helmet = new ItemStack(Material.LEATHER_HELMET);
- ItemMeta helMeta = helmet.getItemMeta();
- helMeta.setDisplayName("§bFisherman Helmet");
- helmet.setItemMeta(helMeta);
- chestplate = new ItemStack(Material.IRON_CHESTPLATE);
- ItemMeta cheMeta = chestplate.getItemMeta();
- cheMeta.setDisplayName("§bFisherman Chestplate");
- chestplate.setItemMeta(cheMeta);
- ItemStack leggings = new ItemStack(Material.IRON_LEGGINGS);
- ItemMeta legMeta = leggings.getItemMeta();
- legMeta.setDisplayName("§bFisherman Leggings");
- leggings.setItemMeta(legMeta);
- ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
- ItemMeta botMeta = boots.getItemMeta();
- botMeta.setDisplayName("§bFisherman Boots");
- boots.setItemMeta(botMeta);
- inv.clear();
- inv.setHelmet(null);
- inv.setChestplate(null);
- inv.setLeggings(null);
- inv.setBoots(null);
- for (archerBootsMeta = p.getActivePotionEffects().iterator(); archerBootsMeta.hasNext();)
- {
- effect = (PotionEffect)archerBootsMeta.next();
- p.removePotionEffect(effect.getType());
- }
- p.setHealth(20.0D);
- p.setFoodLevel(20);
- inv.setItem(0, fisherman);
- inv.setItem(1, rod);
- inv.setHelmet(helmet);
- inv.setChestplate(chestplate);
- inv.setLeggings(leggings);
- inv.setBoots(boots);
- this.dead.add(p);
- }
- else if (kit.equalsIgnoreCase("bomber"))
- {
- ItemStack tnt = new ItemStack(Material.TNT, 32);
- ItemMeta tntMeta = tnt.getItemMeta();
- tntMeta.setDisplayName("§4Bomber");
- List<String> lore = Arrays.asList(new String[] { "§4KAMIKAZE" });
- tntMeta.setLore(lore);
- tnt.setItemMeta(tntMeta);
- ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE);
- ItemMeta chestMeta = chestplate.getItemMeta();
- chestMeta.setDisplayName("§4Bomber Chestplate");
- chestplate.setItemMeta(chestMeta);
- inv.clear();
- inv.setHelmet(null);
- inv.setChestplate(null);
- inv.setLeggings(null);
- inv.setBoots(null);
- inv.setItem(0, tnt);
- inv.setChestplate(chestplate);
- for (PotionEffect effect : p.getActivePotionEffects()) {
- p.removePotionEffect(effect.getType());
- }
- p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 100000, 0));
- p.setHealth(20.0D);
- p.setFoodLevel(20);
- this.dead.add(p);
- }
- else
- {
- ItemStack chest;
- LeatherArmorMeta legMeta;
- if (kit.equalsIgnoreCase("snail"))
- {
- ItemStack sword = new ItemStack(Material.STONE_SWORD);
- ItemMeta swordMeta = sword.getItemMeta();
- swordMeta.setDisplayName("§2Snail Sword");
- List<String> lore = Arrays.asList(new String[] { "§860% Procent chance that", "§8enemy gets slowness!" });
- swordMeta.setLore(lore);
- sword.setItemMeta(swordMeta);
- ItemStack helmet = new ItemStack(Material.LEATHER_HELMET);
- LeatherArmorMeta helmetMeta = (LeatherArmorMeta)helmet.getItemMeta();
- helmetMeta.setDisplayName("§2Snail Helmet");
- helmetMeta.setColor(Color.GREEN);
- helmet.setItemMeta(helmetMeta);
- chest = new ItemStack(Material.LEATHER_CHESTPLATE);
- LeatherArmorMeta chestMeta = (LeatherArmorMeta)chest.getItemMeta();
- chestMeta.setDisplayName("§2Snail Chestplate");
- chestMeta.setColor(Color.GREEN);
- chest.setItemMeta(chestMeta);
- ItemStack leg = new ItemStack(Material.LEATHER_LEGGINGS);
- legMeta = (LeatherArmorMeta)leg.getItemMeta();
- legMeta.setDisplayName("§2Snail Leggings");
- legMeta.setColor(Color.GREEN);
- leg.setItemMeta(legMeta);
- ItemStack bo = new ItemStack(Material.LEATHER_BOOTS);
- LeatherArmorMeta boMeta = (LeatherArmorMeta)bo.getItemMeta();
- boMeta.setDisplayName("§2Snail Boots");
- boMeta.setColor(Color.GREEN);
- bo.setItemMeta(boMeta);
- inv.clear();
- inv.setHelmet(null);
- inv.setChestplate(null);
- inv.setLeggings(null);
- inv.setBoots(null);
- inv.setItem(0, sword);
- inv.setHelmet(helmet);
- inv.setChestplate(chest);
- inv.setLeggings(leg);
- inv.setBoots(bo);
- for (PotionEffect effect : p.getActivePotionEffects()) {
- p.removePotionEffect(effect.getType());
- }
- p.setHealth(20.0D);
- p.setFoodLevel(20);
- this.dead.add(p);
- }
- else if (kit.equalsIgnoreCase("Stomper"))
- {
- ItemStack sword = new ItemStack(Material.STONE_SWORD);
- ItemMeta swordMeta = sword.getItemMeta();
- swordMeta.setDisplayName("§3Stomper Sword");
- sword.setItemMeta(swordMeta);
- ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE);
- ItemStack boots = new ItemStack(Material.DIAMOND_BOOTS);
- inv.clear();
- inv.setHelmet(null);
- inv.setChestplate(null);
- inv.setLeggings(null);
- inv.setBoots(null);
- inv.setItem(0, sword);
- inv.setChestplate(chest);
- inv.setBoots(boots);
- for (PotionEffect effect : p.getActivePotionEffects()) {
- p.removePotionEffect(effect.getType());
- }
- p.setHealth(20.0D);
- p.setFoodLevel(20);
- this.dead.add(p);
- }
- else if (kit.equalsIgnoreCase("Viper"))
- {
- ItemStack sword = new ItemStack(Material.STONE_SWORD);
- ItemMeta swordMeta = sword.getItemMeta();
- swordMeta.setDisplayName("§5Viper Sword");
- List<String> lore = Arrays.asList(new String[] { "§8§o45% chance to ", "§8§opoison your enemie!" });
- swordMeta.setLore(lore);
- sword.setItemMeta(swordMeta);
- ItemStack helmet = new ItemStack(Material.IRON_HELMET);
- ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE);
- ItemStack leg = new ItemStack(Material.LEATHER_LEGGINGS);
- ItemStack boots = new ItemStack(Material.IRON_BOOTS);
- inv.clear();
- inv.setHelmet(null);
- inv.setChestplate(null);
- inv.setLeggings(null);
- inv.setBoots(null);
- inv.setItem(0, sword);
- inv.setHelmet(helmet);
- inv.setChestplate(chestplate);
- inv.setLeggings(leg);
- inv.setBoots(boots);
- for (PotionEffect effect : p.getActivePotionEffects()) {
- p.removePotionEffect(effect.getType());
- }
- p.setHealth(20.0D);
- p.setFoodLevel(20);
- this.dead.add(p);
- }
- }
- }
- }
- }
- }
- else
- {
- p.sendMessage("§b§lHearty§6§lPVP §8» §bYou need to §6respawn§b to get another §6kit§b!");
- }
- }
- public void openKitMenu(Player p)
- {
- Inventory inv = Bukkit.createInventory(p, 54, "§b§lKit§6§lMenu!");
- for (int i = 0; i < 54; i++)
- {
- ItemStack glass = new ItemStack(Material.STAINED_GLASS_PANE);
- glass.setDurability((short)5);
- inv.setItem(i, glass);
- }
- ItemStack pyro = new ItemStack(Material.FIRE, 1);
- ItemMeta pyroMeta = pyro.getItemMeta();
- pyroMeta.setDisplayName("§6Pyro Kit");
- List<String> pyroLore = Arrays.asList(new String[] { "§8§oFIIIREEEE!" });
- pyroMeta.setLore(pyroLore);
- pyro.setItemMeta(pyroMeta);
- ItemStack snow = new ItemStack(Material.SNOW_BALL, 1);
- ItemMeta snowMeta = snow.getItemMeta();
- snowMeta.setDisplayName("§fSnowPorter Kit");
- List<String> snowLore = Arrays.asList(new String[] { "§8§oSwitch locations ", "§8§owith the player you hit!" });
- snowMeta.setLore(snowLore);
- snow.setItemMeta(snowMeta);
- ItemStack Ninja = new ItemStack(Material.DIAMOND_SWORD, 1);
- ItemMeta NinjaMeta = Ninja.getItemMeta();
- NinjaMeta.setDisplayName("§8Ninja Kit");
- List<String> NinjaLore = Arrays.asList(new String[] { "§8§oRemove a random amount of health", "§8§ofrom the player you hit" });
- NinjaMeta.setLore(NinjaLore);
- Ninja.setItemMeta(NinjaMeta);
- ItemStack fisherman = new ItemStack(Material.FISHING_ROD);
- ItemMeta fishMeta = fisherman.getItemMeta();
- fishMeta.setDisplayName("§bFisherman Kit");
- List<String> fishLore = Arrays.asList(new String[] { "§8§oFish your enemies!" });
- fishMeta.setLore(fishLore);
- fisherman.setItemMeta(fishMeta);
- ItemStack bomber = new ItemStack(Material.TNT);
- ItemMeta bomberMeta = bomber.getItemMeta();
- bomberMeta.setDisplayName("§4Bomber Kit");
- List<String> bomberlore = Arrays.asList(new String[] { "§8§oBlow your enemies up in the air!" });
- bomberMeta.setLore(bomberlore);
- bomber.setItemMeta(bomberMeta);
- ItemStack snail = new ItemStack(Material.SLIME_BALL);
- ItemMeta snailMeta = snail.getItemMeta();
- snailMeta.setDisplayName("§2Snail Kit");
- List<String> snailLore = Arrays.asList(new String[] { "§8§o60% chance to give slowness", "§8§oto your enemies!" });
- snailMeta.setLore(snailLore);
- snail.setItemMeta(snailMeta);
- ItemStack stomper = new ItemStack(Material.DIAMOND_BOOTS);
- ItemMeta stomMeta = stomper.getItemMeta();
- stomMeta.setDisplayName("§3Stomper Kit");
- List<String> stomperLore = Arrays.asList(new String[] { "§8§oSendover your falldamage", "§8§oto the players near! BE CAREFUL", "§8§oIf they're sneaking", "§8§othey wont take too much damage!" });
- stomMeta.setLore(stomperLore);
- stomper.setItemMeta(stomMeta);
- ItemStack viper = new ItemStack(Material.POTION);
- ItemMeta vipMeta = viper.getItemMeta();
- viper.setDurability((short)16452);
- vipMeta.setDisplayName("§5Viper Kit");
- List<String> viperLore = Arrays.asList(new String[] { "§8§o45% chance to", "§8§opoison target." });
- vipMeta.setLore(viperLore);
- viper.setItemMeta(vipMeta);
- ItemStack separate = new ItemStack(Material.STAINED_GLASS_PANE);
- ItemMeta sepMeta = separate.getItemMeta();
- List<String> lore = Arrays.asList(new String[] { "§b<--- §6User§b kits", "", "§6Donor§b kits --->" });
- sepMeta.setLore(lore);
- sepMeta.setDisplayName("§d");
- separate.setDurability((short)11);
- separate.setItemMeta(sepMeta);
- ItemStack close = new ItemStack(Material.TNT);
- ItemMeta closeMeta = close.getItemMeta();
- closeMeta.setDisplayName("§4Click to close!");
- close.setItemMeta(closeMeta);
- inv.setItem(10, pyro);
- inv.setItem(11, fisherman);
- inv.setItem(12, bomber);
- inv.setItem(19, viper);
- inv.setItem(13, separate);
- inv.setItem(14, snail);
- inv.setItem(15, snow);
- inv.setItem(16, Ninja);
- inv.setItem(23, stomper);
- inv.setItem(53, close);
- p.openInventory(inv);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement