Skip to content

Commit

Permalink
Limit shop owner name and item name length
Browse files Browse the repository at this point in the history
The code modifications limit the length of the shop owner's name and the item name by using a substring operation in NameChecker.java and ItemChecker.java. The aim is to enhance compatibility and prevent potential display or processing issues due to excessively long names.
  • Loading branch information
Feli499 committed Jan 1, 2024
1 parent bb9221a commit 88b4015
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -49,6 +49,6 @@ public static String getSignItemName(ItemStack itemStack) {
}
}

return itemName;
return itemName.substring(0, Math.min(itemName.length(), 15));
}
}
Expand Up @@ -29,6 +29,6 @@ public static void onPreShopCreation(PreShopCreationEvent event) {
} else
name = NameManager.getNameFor(player);

event.setOwnerName(name);
event.setOwnerName(name.substring(0, Math.min(name.length(), 15)));
}
}

0 comments on commit 88b4015

Please sign in to comment.