From 3d7c8c6c494c6304b0d14c588fbf7d847a33565b Mon Sep 17 00:00:00 2001 From: Maik E Date: Mon, 1 Jan 2024 17:08:00 +0100 Subject: [PATCH] Fix accessor addition logic in ChestShop This commit refactors the addAccessor command logic in the ChestShop application. It now compares the newAccessor to the actual owner of the chest shop instead of the player's ID. This change ensures more accurate assignment of access permissions. --- src/main/java/com/Acrobot/ChestShop/Commands/AddAccessor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/Acrobot/ChestShop/Commands/AddAccessor.java b/src/main/java/com/Acrobot/ChestShop/Commands/AddAccessor.java index 64dbc0da0..e3faa3f47 100644 --- a/src/main/java/com/Acrobot/ChestShop/Commands/AddAccessor.java +++ b/src/main/java/com/Acrobot/ChestShop/Commands/AddAccessor.java @@ -61,7 +61,8 @@ public boolean onCommand(CommandSender sender, Command command, String label, St return true; } - if (player.getUniqueId().equals(newAccessor)) { + UUID owner = ChestShopSign.getOwner(sign); + if (owner.equals(newAccessor)) { sender.sendMessage(Messages.prefix(Messages.OWNER_CANT_BE_ACCESSOR)); return true; }