diff options
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/util/Util.java')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/util/Util.java | 54 |
1 files changed, 11 insertions, 43 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/Util.java b/src/main/java/net/tylermurphy/hideAndSeek/util/Util.java index 3ab04a9..c24936b 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/util/Util.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/util/Util.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import java.util.List; import net.md_5.bungee.api.ChatColor; +import net.tylermurphy.hideAndSeek.configuration.Items; import net.tylermurphy.hideAndSeek.configuration.LocalizationString; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -55,48 +56,18 @@ public class Util { for (PotionEffect effect : player.getActivePotionEffects()) { player.removePotionEffect(effect.getType()); } - player.addPotionEffect(new PotionEffect(PotionEffectType.DOLPHINS_GRACE, 1000000, 1, false, false)); if (Main.plugin.board.isSeeker(player)) { - ItemStack diamondSword = new ItemStack(Material.DIAMOND_SWORD, 1); - diamondSword.addEnchantment(Enchantment.DAMAGE_ALL, 1); - ItemMeta diamondSwordMeta = diamondSword.getItemMeta(); - diamondSwordMeta.setDisplayName("Seeker Sword"); - diamondSwordMeta.setUnbreakable(true); - diamondSword.setItemMeta(diamondSwordMeta); - player.getInventory().addItem(diamondSword); - - ItemStack wackyStick = new ItemStack(Material.STICK, 1); - wackyStick.addUnsafeEnchantment(Enchantment.KNOCKBACK, 3); - ItemMeta wackyStickMeta = wackyStick.getItemMeta(); - wackyStickMeta.setDisplayName("Wacky Stick"); - wackyStick.setItemMeta(wackyStickMeta); - player.getInventory().addItem(wackyStick); - - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 1000000, 2, false, false)); - player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000, 1, false, false)); - player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, 1000000, 1, false, false)); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 1000000, 10, false, false)); + if(pvpEnabled) + for(ItemStack item : Items.SEEKER_ITEMS) + player.getInventory().addItem(item); + for(PotionEffect effect : Items.SEEKER_EFFECTS) + player.addPotionEffect(effect); } else if (Main.plugin.board.isHider(player)) { - ItemStack stoneSword = new ItemStack(Material.STONE_SWORD, 1); - stoneSword.addEnchantment(Enchantment.DAMAGE_ALL, 2); - ItemMeta stoneSwordMeta = stoneSword.getItemMeta(); - stoneSwordMeta.setDisplayName("Hider Sword"); - stoneSwordMeta.setUnbreakable(true); - stoneSword.setItemMeta(stoneSwordMeta); - player.getInventory().addItem(stoneSword); - - ItemStack splashPotion = new ItemStack(Material.SPLASH_POTION, 1); - PotionMeta splashPotionMeta = (PotionMeta) splashPotion.getItemMeta(); - splashPotionMeta.setBasePotionData(new PotionData(PotionType.REGEN)); - splashPotion.setItemMeta(splashPotionMeta); - player.getInventory().addItem(splashPotion); - - ItemStack potion = new ItemStack(Material.POTION, 2); - PotionMeta potionMeta = (PotionMeta) potion.getItemMeta(); - potionMeta.setBasePotionData(new PotionData(PotionType.INSTANT_HEAL)); - potion.setItemMeta(potionMeta); - player.getInventory().addItem(potion); - + if(pvpEnabled) + for(ItemStack item : Items.HIDER_ITEMS) + player.getInventory().addItem(item); + for(PotionEffect effect : Items.HIDER_EFFECTS) + player.addPotionEffect(effect); if(glowEnabled) { ItemStack snowball = new ItemStack(Material.SNOWBALL, 1); ItemMeta snowballMeta = snowball.getItemMeta(); @@ -109,9 +80,6 @@ public class Util { snowball.setItemMeta(snowballMeta); player.getInventory().addItem(snowball); } - - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 1000000, 1, false, false)); } } - }
\ No newline at end of file |