Skip to content

Commit

Permalink
Update NameChecker to handle blank owner names
Browse files Browse the repository at this point in the history
This commit updates the NameChecker in the ChestShopListener, ensuring that when a blank owner name is provided, it defaults to the player's unique ID. This change facilitates smoother store creation for players and improves data consistency.
  • Loading branch information
Feli499 committed Jan 1, 2024
1 parent 5aecc9e commit 8857089
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -22,7 +22,7 @@ public static void onPreShopCreation(PreShopCreationEvent event) {
String name = event.getOwnerName();

Player player = event.getPlayer();
UUID uuidForFullName = NameManager.getUUIDFor(name);
UUID uuidForFullName = name.isBlank() ? player.getUniqueId() : NameManager.getUUIDFor(name);

if (!uuidForFullName.equals(player.getUniqueId()) && Permission.has(player, Permission.ADMIN)) {
name = NameManager.getFullNameFor(uuidForFullName);
Expand Down

0 comments on commit 8857089

Please sign in to comment.