From d0af9772123bb477a8479f8e420ed4b0ea0da088 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Wed, 6 Jul 2022 20:05:21 +0100 Subject: [PATCH] Fix issue when creating sign with own name without existing account This was only an issue if the autofill functionality for the own name wasn't used. Now if there is no account with a certain name then the player can use it if it matches their user name --- src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java b/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java index 2f1c26b..684c4fb 100644 --- a/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java +++ b/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java @@ -287,6 +287,11 @@ public class NameManager implements Listener { ChestShop.callEvent(queryEvent); Account account = queryEvent.getAccount(); if (account == null) { + // There is no account by the provided name, but it matches the player name + // Return true as they specified their own name and a new account should get created + if (player.getName().equalsIgnoreCase(name)) { + return true; + } ChestShop.logDebug(player.getName() + " cannot use the name " + name + " for a shop as no account with that name exists"); return false; }