mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-01 14:33:21 +01:00
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
This commit is contained in:
parent
e3cd50cf75
commit
d0af977212
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user