summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/Start.java')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Start.java82
1 files changed, 13 insertions, 69 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java
index 4bedd2f..05565da 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java
@@ -90,6 +90,9 @@ public class Start implements ICommand {
player.sendTitle(ChatColor.GOLD + "" + ChatColor.BOLD + "HIDER", ChatColor.WHITE + message("HIDERS_SUBTITLE").toString(), 10, 70, 20);
}
Worldborder.resetWorldborder("hideandseek_"+spawnWorld);
+ for(Player player : Main.plugin.board.getPlayers()){
+ Main.plugin.board.createGameBoard(player);
+ }
Main.plugin.board.reloadGameBoards();
Main.plugin.status = "Starting";
int temp = Main.plugin.gameId;
@@ -106,7 +109,7 @@ public class Start implements ICommand {
Util.broadcastMessage(messagePrefix + message("START"));
Main.plugin.status = "Playing";
for(Player player : Main.plugin.board.getPlayers()) {
- resetPlayer(player);
+ Util.resetPlayer(player);
}
Main.plugin.worldborder = null;
Main.plugin.taunt = null;
@@ -116,11 +119,15 @@ public class Start implements ICommand {
Main.plugin.worldborder = new Worldborder(Main.plugin.gameId);
Main.plugin.worldborder.schedule();
}
-
- Main.plugin.taunt = new Taunt(Main.plugin.gameId);
- Main.plugin.taunt.schedule();
-
- Main.plugin.glow = new Glow(Main.plugin.gameId);
+
+ if(tauntEnabled) {
+ Main.plugin.taunt = new Taunt(Main.plugin.gameId);
+ Main.plugin.taunt.schedule();
+ }
+
+ if (glowEnabled) {
+ Main.plugin.glow = new Glow(Main.plugin.gameId);
+ }
if(gameLength > 0) {
Main.plugin.timeLeft = gameLength;
@@ -130,69 +137,6 @@ public class Start implements ICommand {
}
- public static void resetPlayer(Player player) {
- player.getInventory().clear();
- 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));
- }
- 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);
-
- ItemStack snowball = new ItemStack(Material.SNOWBALL,1);
- ItemMeta snowballMeta = snowball.getItemMeta();
- snowballMeta.setDisplayName("Glow Powerup");
- List<String> snowballLore = new ArrayList<String>();
- snowballLore.add("Throw to make all seekers glow");
- snowballLore.add("Last 30s, all hiders can see it");
- snowballLore.add("Time stacks on multi use");
- snowballMeta.setLore(snowballLore);
- snowball.setItemMeta(snowballMeta);
- player.getInventory().addItem(snowball);
-
- player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 1000000, 1, false, false));
- }
- }
-
public String getLabel() {
return "start";
}