Renamed the method consumePlayerCommand

This commit is contained in:
Vlammar 2021-05-31 22:34:49 +02:00
parent 468d3af7d5
commit e1fd9ca2d8
7 changed files with 8 additions and 8 deletions

View File

@ -53,7 +53,7 @@ import org.bukkit.entity.Player;
public abstract class IoMCommand extends Command {
protected void consumePlayerCommand(String arg, Consumer<UUID> consumer) {
protected void retrieveUUID(String arg, Consumer<UUID> consumer) {
UUID uuid;
OfflinePlayer offlinePlayer;

View File

@ -101,7 +101,7 @@ public class DeleteCommand extends IoMCommand {
mapName = arguments.get(0);
}
consumePlayerCommand(playerName, uuid -> {
retrieveUUID(playerName, uuid -> {
ImageMap map = MapManager.getMap(uuid, mapName);
if (map == null) {

View File

@ -74,7 +74,7 @@ public class ExploreCommand extends IoMCommand {
playerName = sender.getName();
}
consumePlayerCommand(playerName, uuid -> {
retrieveUUID(playerName, uuid -> {
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(uuid);
if (sender.isOnline()) {

View File

@ -83,7 +83,7 @@ public class GetCommand extends IoMCommand {
consumePlayerCommand(playerName, uuid -> {
retrieveUUID(playerName, uuid -> {
if (!sender.isOnline()) {
return;

View File

@ -102,7 +102,7 @@ public class GiveCommand extends IoMCommand {
final Player sender = playerSender();
consumePlayerCommand(from, uuid -> {
retrieveUUID(from, uuid -> {
final ImageMap map = MapManager.getMap(uuid, mapName);
if (map == null) {
@ -110,7 +110,7 @@ public class GiveCommand extends IoMCommand {
return;
}
consumePlayerCommand(playerName, uuid2 -> {
retrieveUUID(playerName, uuid2 -> {
if (Bukkit.getPlayer((uuid2)) != null && Bukkit.getPlayer((uuid2)).isOnline()
&& map.give(Bukkit.getPlayer(uuid2))) {
info(I.t("The requested map was too big to fit in your inventory."));

View File

@ -78,7 +78,7 @@ public class ListCommand extends IoMCommand {
final Player sender = playerSender();
consumePlayerCommand(playerName, uuid -> {
retrieveUUID(playerName, uuid -> {
List<ImageMap> mapList = MapManager.getMapList(uuid);
if (mapList.isEmpty()) {
info(sender, I.t("No map found."));

View File

@ -156,7 +156,7 @@ public class UpdateCommand extends IoMCommand {
//TODO passer en static
//ImageOnMap.getPlugin().getCommandWorker().offlineNameFetch(playerName, uuid -> {
consumePlayerCommand(playerName, uuid -> {
retrieveUUID(playerName, uuid -> {
ImageMap map = MapManager.getMap(uuid, mapName);