summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2021-10-29 19:57:40 -0400
committerTyler Murphy <tylermurphy534@gmail.com>2021-10-29 19:57:40 -0400
commit4188dadbe3825178349417ba8d594bca00761dc4 (patch)
treea69504786a52d1263cd8face36e93608dd440d12 /src/main/java/net/tylermurphy/hideAndSeek/command
parent1.3.1 build 2 (diff)
downloadkenshinshideandseek-4188dadbe3825178349417ba8d594bca00761dc4.tar.gz
kenshinshideandseek-4188dadbe3825178349417ba8d594bca00761dc4.tar.bz2
kenshinshideandseek-4188dadbe3825178349417ba8d594bca00761dc4.zip
1.3.1 build 3
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Join.java7
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java1
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Start.java82
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java2
4 files changed, 20 insertions, 72 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Join.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Join.java
index 9e77381..b3691bf 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Join.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Join.java
@@ -29,18 +29,21 @@ public class Join implements ICommand {
sender.sendMessage(errorPrefix + message("GAME_INGAME"));
return;
}
-
+
if(Main.plugin.status.equals("Standby")) {
+ player.getInventory().clear();
Main.plugin.board.addHider(player);
if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player));
else Util.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player));
player.teleport(new Location(Bukkit.getWorld(lobbyWorld), lobbyPosition.getX(),lobbyPosition.getY(),lobbyPosition.getZ()));
player.setGameMode(GameMode.ADVENTURE);
+ Main.plugin.board.createLobbyBoard(player);
Main.plugin.board.reloadLobbyBoards();
} else {
- Main.plugin.board.addSeeker(player);
+ Main.plugin.board.addSpectator(player);
player.sendMessage(messagePrefix + message("GAME_JOIN_SPECTATOR"));
player.setGameMode(GameMode.SPECTATOR);
+ Main.plugin.board.createGameBoard(player);
player.teleport(new Location(Bukkit.getWorld("hideandseek_"+spawnWorld), spawnPosition.getX(),spawnPosition.getY(),spawnPosition.getZ()));
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java
index 73dafbd..8809b5d 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java
@@ -36,6 +36,7 @@ public class Leave implements ICommand {
Main.plugin.board.reloadLobbyBoards();
} else {
Main.plugin.board.reloadGameBoards();
+ Main.plugin.board.reloadBoardTeams();
}
}
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";
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java
index 52bf310..e4dd16e 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java
@@ -45,8 +45,8 @@ public class Stop implements ICommand {
Main.plugin.timeLeft = 0;
Worldborder.resetWorldborder("hideandseek_"+spawnWorld);
for(Player player : Main.plugin.board.getPlayers()) {
+ Main.plugin.board.createLobbyBoard(player);
player.setGameMode(GameMode.ADVENTURE);
- player.setLevel(0);
Main.plugin.board.addHider(player);
player.getInventory().clear();
player.teleport(new Location(Bukkit.getWorld(lobbyWorld), lobbyPosition.getX(),lobbyPosition.getY(),lobbyPosition.getZ()));