mirror of
https://github.com/zDevelopers/ImageOnMap.git
synced 2024-11-16 23:25:11 +01:00
Renamed the method consumePlayerCommand
This commit is contained in:
parent
468d3af7d5
commit
e1fd9ca2d8
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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()) {
|
||||
|
@ -83,7 +83,7 @@ public class GetCommand extends IoMCommand {
|
||||
|
||||
|
||||
|
||||
consumePlayerCommand(playerName, uuid -> {
|
||||
retrieveUUID(playerName, uuid -> {
|
||||
|
||||
if (!sender.isOnline()) {
|
||||
return;
|
||||
|
@ -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."));
|
||||
|
@ -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."));
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user