Skip to content

Commit

Permalink
Remove unused import and simplify conditional in NameChecker
Browse files Browse the repository at this point in the history
Removed extra import 'Permission' and simplified a conditional statement in the NameChecker class. This refactoring streamlines the logic for setting the name during PreShopCreationEvent, making the code more straightforward without changing functionality.
  • Loading branch information
Feli499 committed Jan 1, 2024
1 parent a439c2d commit 76053f4
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -5,7 +5,6 @@
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;

import com.Acrobot.ChestShop.Permission;
import com.Acrobot.ChestShop.Configuration.Properties;
import com.Acrobot.ChestShop.Events.PreShopCreationEvent;
import com.Acrobot.ChestShop.UUIDs.NameManager;
Expand All @@ -22,8 +21,7 @@ public static void onPreShopCreation(PreShopCreationEvent event) {
Player player = event.getPlayer();
if (Properties.ADMIN_SHOP_NAME.equalsIgnoreCase(name)) {
name = Properties.ADMIN_SHOP_NAME;
}
if (name.isEmpty() || (!NameManager.canUseName(player, name) && !Permission.has(player, Permission.ADMIN))) {
} else {
name = NameManager.getNameFor(player);
}
event.setOwnerName(name);
Expand Down

0 comments on commit 76053f4

Please sign in to comment.