update Explore, get and list
This commit is contained in:
parent
a9fd510e28
commit
0b70b503ca
|
@ -52,7 +52,7 @@ import org.bukkit.command.CommandSender;
|
|||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
@CommandInfo(name = "explore",usageParameters = "[player name]")
|
||||
@CommandInfo(name = "explore", usageParameters = "[player name]")
|
||||
public class ExploreCommand extends IoMCommand {
|
||||
@Override
|
||||
protected void run() throws CommandException {
|
||||
|
@ -81,8 +81,14 @@ public class ExploreCommand extends IoMCommand {
|
|||
return;
|
||||
}
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(uuid);
|
||||
if (offlinePlayer == null) {
|
||||
warning(sender, I.t("The player {0} does not exist.", playerName));
|
||||
return;
|
||||
}
|
||||
if (sender.isOnline()) {
|
||||
Gui.open(sender, new MapListGui(offlinePlayer,playerName));
|
||||
//RunTask.nextTick(() -> {
|
||||
Gui.open(sender, new MapListGui(offlinePlayer, playerName));
|
||||
//});
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -80,8 +80,6 @@ public class GetCommand extends IoMCommand {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//TODO passer en static
|
||||
ImageOnMap.getPlugin().getCommandWorker().offlineNameFetch(playerName, uuid -> {
|
||||
|
||||
|
|
|
@ -80,7 +80,9 @@ public class ListCommand extends IoMCommand {
|
|||
|
||||
//TODO passer en static
|
||||
ImageOnMap.getPlugin().getCommandWorker().offlineNameFetch(playerName, uuid -> {
|
||||
List<ImageMap> mapList = MapManager.getMapList(uuid);
|
||||
if (!sender.isOnline()) {
|
||||
return;
|
||||
}
|
||||
if (uuid == null) {
|
||||
try {
|
||||
throwInvalidArgument(I.t("Player {} not found.", playerName));
|
||||
|
@ -89,6 +91,7 @@ public class ListCommand extends IoMCommand {
|
|||
}
|
||||
return;
|
||||
}
|
||||
List<ImageMap> mapList = MapManager.getMapList(uuid);
|
||||
if (mapList.isEmpty()) {
|
||||
info(sender, I.t("No map found."));
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue