From 55c215062f388861f26db787df155877aa105d74 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Thu, 28 Apr 2022 16:00:34 -0400 Subject: [PATCH] change lobby start item to start permission from op --- .../java/net/tylermurphy/hideAndSeek/game/EventListener.java | 2 +- src/main/java/net/tylermurphy/hideAndSeek/game/Game.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java b/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java index 962dcf0..668a446 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/EventListener.java @@ -298,7 +298,7 @@ public class EventListener implements Listener { Game.leave(event.getPlayer()); } - if (temp.getItemMeta().getDisplayName().equalsIgnoreCase(lobbyStartItem.getItemMeta().getDisplayName()) && temp.getType() == lobbyStartItem.getType()) { + if (temp.getItemMeta().getDisplayName().equalsIgnoreCase(lobbyStartItem.getItemMeta().getDisplayName()) && temp.getType() == lobbyStartItem.getType() && event.getPlayer().hasPermission("hideandseek.start")) { event.setCancelled(true); if (Game.isNotSetup()) { event.getPlayer().sendMessage(errorPrefix + message("GAME_SETUP")); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java index e6149f0..6a6ccaa 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/Game.java @@ -260,7 +260,7 @@ public class Game { public static void join(Player player){ if(Game.status == Status.STANDBY) { player.getInventory().clear(); - if(lobbyStartItem != null && (!lobbyItemStartAdmin || player.isOp())) + if(lobbyStartItem != null && (!lobbyItemStartAdmin || player.hasPermission("hideandseek.start"))) player.getInventory().setItem(lobbyItemStartPosition, lobbyStartItem); if(lobbyLeaveItem != null) player.getInventory().setItem(lobbyItemLeavePosition, lobbyLeaveItem);