Skip to content

Commit

Permalink
Merge pull request #9 from Feli499/long-player-names-shop-creation-fa…
Browse files Browse the repository at this point in the history
…iled

Long player names shop creation failed
  • Loading branch information
Brokkonaut committed Feb 23, 2024
2 parents 9e577dc + 8fcc3c2 commit c2a77ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public static void onPreShopCreation(PreShopCreationEvent event) {
} else
name = NameManager.getNameFor(player);

event.setOwnerName(name.substring(0, Math.min(name.length(), 15)));
event.setOwnerName(name);
}
}
14 changes: 10 additions & 4 deletions src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,20 @@ public static UUID getUUIDForFullName(String name) {
return fullNamesToUUID.get(name.toLowerCase());
}

public static UUID getUUIDFor(String shortName) {
if (ChestShopSign.isAdminshopLine(shortName)) {
public static UUID getUUIDFor(String name) {
if (ChestShopSign.isAdminshopLine(name)) {
return adminShopUUID;
}
if (Properties.SERVER_ECONOMY_ACCOUNT != null && Properties.SERVER_ECONOMY_ACCOUNT.length() > 0 && Properties.SERVER_ECONOMY_ACCOUNT.equals(shortName)) {
if (Properties.SERVER_ECONOMY_ACCOUNT != null && Properties.SERVER_ECONOMY_ACCOUNT.length() > 0
&& Properties.SERVER_ECONOMY_ACCOUNT.equals(name)) {
return serverAccountUUID;
}
return usedShortNames.get(shortName.toLowerCase());

UUID uuid = usedShortNames.get(name.toLowerCase());
if (uuid != null)
return uuid;

return getUUIDForFullName(name);
}

public static String getFullNameFor(UUID playerId) {
Expand Down

0 comments on commit c2a77ba

Please sign in to comment.