Resolve player names exactly in commands

This commit is contained in:
2026-09-26 22:46:45 -07:00
parent 81b34862b4
commit c127e45f8d
5 changed files with 31 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ package com.majinnaibu.bukkitplugins.metropolis.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.OfflinePlayer;
import com.majinnaibu.bukkitplugins.metropolis.MetropolisPlugin;
@@ -20,7 +21,12 @@ public class MetropolisHomeGenerateCommand implements CommandExecutor {
return false;
}
_plugin.generateHome(args[0]);
OfflinePlayer player = _plugin.getOfflinePlayer(args[0]);
if (player == null) {
sender.sendMessage("Unable to find player " + args[0]);
return false;
}
_plugin.generateHome(player);
sender.sendMessage("[Metropolis] Home generated for " + args[0]);