From 0c233f3ce4aae8964e6cf2db9c3cf03018ad3931 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Fri, 13 Aug 2021 21:52:26 -0400 Subject: [PATCH] fix tick manager bigs --- .../net/tylermurphy/hideAndSeek/commands/SetSeeker.java | 6 +++++- .../net/tylermurphy/hideAndSeek/manager/TickManager.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/commands/SetSeeker.java b/src/main/java/net/tylermurphy/hideAndSeek/commands/SetSeeker.java index 948b899..5a2fc4b 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/commands/SetSeeker.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/commands/SetSeeker.java @@ -10,6 +10,10 @@ import net.tylermurphy.hideAndSeek.ICommand; public class SetSeeker implements ICommand { public void execute(CommandSender sender, String[] args) { + if(!status.equals("Standby") && !status.equals("Setup")) { + sender.sendMessage(errorPrefix + "Game is currently in session"); + return; + } String playerName; if(args.length < 1) { playerName = sender.getName(); @@ -25,7 +29,7 @@ public class SetSeeker implements ICommand { Hider.addEntry(temp.getName()); } Seeker.addEntry(player.getName()); - sender.sendMessage(String.format("%s Set %s as the seaker.", messagePrefix, args[0])); + sender.sendMessage(String.format("%s Set %s as the seaker.", messagePrefix, playerName)); } public String getLabel() { diff --git a/src/main/java/net/tylermurphy/hideAndSeek/manager/TickManager.java b/src/main/java/net/tylermurphy/hideAndSeek/manager/TickManager.java index 8ebe34b..3ef536b 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/manager/TickManager.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/manager/TickManager.java @@ -35,6 +35,10 @@ public class TickManager { checkTeams(); + for(Player player : playerList.values()) { + player.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, 1000000, 127, false, false)); + } + if(status.equals("Standby") || status.equals("Setup")) { onStandby(); } else if(status.equals("Starting")) { @@ -104,7 +108,7 @@ public class TickManager { private static void onStandby() { for(Player player : playerList.values()) { - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 1000000, 127, false, false)); + player.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1000000, 127, false, false)); } }