From 6c95e8a95ee92c51a31e1ac339dd6dbf32828a19 Mon Sep 17 00:00:00 2001 From: Prokopyl Date: Tue, 31 Mar 2015 19:17:06 +0200 Subject: [PATCH] * NEW: Implemented the list, get and delete maptool commands. --- .../moribus/imageonmap/commands/Command.java | 43 +++++++++-- .../moribus/imageonmap/commands/Commands.java | 7 +- .../maptool/DeleteConfirmCommand.java | 52 +++++++++++++ .../maptool/DeleteNoConfirmCommand.java | 54 ++++++++++++++ .../commands/maptool/GetCommand.java | 46 ++++++++++++ .../commands/maptool/ListCommand.java | 56 ++++++++++++++ .../imageonmap/image/ImageIOExecutor.java | 26 +++++++ .../fr/moribus/imageonmap/map/ImageMap.java | 54 ++++++++++++-- .../fr/moribus/imageonmap/map/MapManager.java | 73 +++++++++++++++++-- .../imageonmap/map/PlayerMapStore.java | 63 ++++++++++++++-- .../fr/moribus/imageonmap/map/PosterMap.java | 9 ++- src/main/resources/help/maptool.txt | 7 +- .../help/maptool/delete-noconfirm.txt | 4 + src/main/resources/help/maptool/delete.txt | 5 ++ src/main/resources/help/maptool/get.txt | 3 + src/main/resources/help/maptool/list.txt | 1 + 16 files changed, 475 insertions(+), 28 deletions(-) create mode 100644 src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java create mode 100644 src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteNoConfirmCommand.java create mode 100644 src/main/java/fr/moribus/imageonmap/commands/maptool/GetCommand.java create mode 100644 src/main/java/fr/moribus/imageonmap/commands/maptool/ListCommand.java create mode 100644 src/main/resources/help/maptool/delete-noconfirm.txt create mode 100644 src/main/resources/help/maptool/delete.txt create mode 100644 src/main/resources/help/maptool/get.txt create mode 100644 src/main/resources/help/maptool/list.txt diff --git a/src/main/java/fr/moribus/imageonmap/commands/Command.java b/src/main/java/fr/moribus/imageonmap/commands/Command.java index 4c4d1ab..b0840d8 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/Command.java +++ b/src/main/java/fr/moribus/imageonmap/commands/Command.java @@ -19,6 +19,8 @@ package fr.moribus.imageonmap.commands; import fr.moribus.imageonmap.commands.CommandException.Reason; +import fr.moribus.imageonmap.map.ImageMap; +import fr.moribus.imageonmap.map.MapManager; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -129,6 +131,35 @@ abstract public class Command return (Player)sender; } + protected ImageMap getMapFromArgs() throws CommandException + { + return getMapFromArgs(playerSender(), 0, true); + } + + protected ImageMap getMapFromArgs(Player player, int index, boolean expand) throws CommandException + { + if(args.length <= index) throwInvalidArgument("You need to give a map name."); + + ImageMap map; + String mapName = args[index]; + + if(expand) + { + for(int i = index + 1, c = args.length; i < c; i++) + { + mapName += " " + args[i]; + } + } + + mapName = mapName.trim(); + + map = MapManager.getMap(player.getUniqueId(), mapName); + + if(map == null) error("This map does not exist."); + + return map; + } + ///////////// Methods for command execution ///////////// @@ -190,21 +221,21 @@ abstract public class Command return matches; } - /*protected List getMatchingToolNames(Player player, String prefix) + protected List getMatchingMapNames(Player player, String prefix) { - return getMatchingToolNames(ToolManager.getToolList(player.getUniqueId()), prefix); + return getMatchingToolNames(MapManager.getMapList(player.getUniqueId()), prefix); } - protected List getMatchingToolNames(Iterable tools, String prefix) + protected List getMatchingToolNames(Iterable maps, String prefix) { List matches = new ArrayList(); - for(CommandTool tool : tools) + for(ImageMap map : maps) { - if(tool.getId().startsWith(prefix)) matches.add(tool.getId()); + if(map.getId().startsWith(prefix)) matches.add(map.getId()); } return matches; - }*/ + } } diff --git a/src/main/java/fr/moribus/imageonmap/commands/Commands.java b/src/main/java/fr/moribus/imageonmap/commands/Commands.java index 227b31b..887d12b 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/Commands.java +++ b/src/main/java/fr/moribus/imageonmap/commands/Commands.java @@ -41,7 +41,12 @@ import org.bukkit.plugin.java.JavaPlugin; public enum Commands implements TabCompleter, CommandExecutor { MAPTOOL(new String[]{"maptool"}, - NewCommand.class), + NewCommand.class, + ListCommand.class, + GetCommand.class, + DeleteConfirmCommand.class, + DeleteNoConfirmCommand.class + ), TOMAP(MAPTOOL, NewCommand.class, "tomap"); diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java new file mode 100644 index 0000000..d4a87ca --- /dev/null +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2013 Moribus + * Copyright (C) 2015 ProkopyL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package fr.moribus.imageonmap.commands.maptool; + +import fr.moribus.imageonmap.commands.*; +import fr.moribus.imageonmap.map.ImageMap; +import java.util.List; + +@CommandInfo(name = "delete", usageParameters = "[tool name]") +public class DeleteConfirmCommand extends Command +{ + + public DeleteConfirmCommand(Commands commandGroup) { + super(commandGroup); + } + + @Override + protected void run() throws CommandException + { + ImageMap map = getMapFromArgs(); + tellRaw("{text:\"You are going to delete \",extra:[{text:\""+ map.getId() +"\",color:gold},{text:\". Are you sure ? \",color:white}," + + "{text:\"[Confirm]\", color:green, clickEvent:{action:run_command,value:\"/maptool delete-noconfirm "+ map.getId() +"\"}, " + + "hoverEvent:{action:show_text,value:{text:\"This map will be deleted \",extra:[{text:\"forever\",color:red,bold:true,italic:true,underlined:true}, {text:\" !\", underlined:true}],underlined:true}}}]}"); + + } + + @Override + protected List complete() throws CommandException + { + if(args.length == 1) + return getMatchingMapNames(playerSender(), args[0]); + return null; + } + +} + diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteNoConfirmCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteNoConfirmCommand.java new file mode 100644 index 0000000..f61160d --- /dev/null +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteNoConfirmCommand.java @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2013 Moribus + * Copyright (C) 2015 ProkopyL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package fr.moribus.imageonmap.commands.maptool; + +import fr.moribus.imageonmap.commands.*; +import fr.moribus.imageonmap.map.ImageMap; +import fr.moribus.imageonmap.map.MapManager; +import java.util.List; +import org.bukkit.entity.Player; + + +@CommandInfo(name = "delete-noconfirm", usageParameters = "[map name]") +public class DeleteNoConfirmCommand extends Command +{ + + public DeleteNoConfirmCommand(Commands commandGroup) { + super(commandGroup); + } + + @Override + protected void run() throws CommandException + { + Player player = playerSender(); + ImageMap map = getMapFromArgs(); + MapManager.clear(player.getInventory(), map); + MapManager.deleteMap(map); + info("Map successfully deleted."); + } + + @Override + protected List complete() throws CommandException + { + if(args.length == 1) + return getMatchingMapNames(playerSender(), args[0]); + return null; + } +} + diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/GetCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/GetCommand.java new file mode 100644 index 0000000..716b337 --- /dev/null +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/GetCommand.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2013 Moribus + * Copyright (C) 2015 ProkopyL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package fr.moribus.imageonmap.commands.maptool; + +import fr.moribus.imageonmap.commands.*; +import java.util.List; +import org.bukkit.entity.Player; + +@CommandInfo(name = "get") +public class GetCommand extends Command +{ + public GetCommand(Commands commandGroup) { + super(commandGroup); + } + + @Override + protected void run() throws CommandException + { + Player player = playerSender(); + getMapFromArgs().give(player.getInventory()); + } + + @Override + protected List complete() throws CommandException + { + if(args.length == 1) + return getMatchingMapNames(playerSender(), args[0]); + return null; + } +} diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/ListCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/ListCommand.java new file mode 100644 index 0000000..d59a177 --- /dev/null +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/ListCommand.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 Moribus + * Copyright (C) 2015 ProkopyL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package fr.moribus.imageonmap.commands.maptool; + +import fr.moribus.imageonmap.commands.*; +import fr.moribus.imageonmap.map.ImageMap; +import fr.moribus.imageonmap.map.MapManager; +import java.util.List; +import org.bukkit.entity.Player; + +@CommandInfo(name = "list") +public class ListCommand extends Command +{ + public ListCommand(Commands commandGroup) { + super(commandGroup); + } + + @Override + protected void run() throws CommandException + { + Player player = playerSender(); + List mapList = MapManager.getMapList(player.getUniqueId()); + + if(mapList.isEmpty()) + { + info("No map found."); + return; + } + + info(mapList.size() + " maps found."); + + String sMapList = mapList.get(0).getId(); + for(int i = 1, c = mapList.size(); i < c; i++) + { + sMapList += "§7,§r" + mapList.get(i).getId(); + } + player.sendMessage(sMapList); + } + +} diff --git a/src/main/java/fr/moribus/imageonmap/image/ImageIOExecutor.java b/src/main/java/fr/moribus/imageonmap/image/ImageIOExecutor.java index a29a874..715efe6 100644 --- a/src/main/java/fr/moribus/imageonmap/image/ImageIOExecutor.java +++ b/src/main/java/fr/moribus/imageonmap/image/ImageIOExecutor.java @@ -19,10 +19,13 @@ package fr.moribus.imageonmap.image; import fr.moribus.imageonmap.ImageOnMap; +import fr.moribus.imageonmap.map.ImageMap; import fr.moribus.imageonmap.worker.Worker; +import fr.moribus.imageonmap.worker.WorkerCallback; import fr.moribus.imageonmap.worker.WorkerRunnable; import java.awt.image.BufferedImage; import java.io.File; +import java.nio.file.Files; import javax.imageio.ImageIO; public class ImageIOExecutor extends Worker @@ -86,4 +89,27 @@ public class ImageIOExecutor extends Worker ImageIOExecutor.saveImage(ImageOnMap.getPlugin().getImageFile(mapsIDs[i]), image.getImageAt(i)); } } + + static public void deleteImage(ImageMap map) + { + short[] mapsIDs = map.getMapsIDs(); + for(int i = 0, c = mapsIDs.length; i < c; i++) + { + deleteImage(ImageOnMap.getPlugin().getImageFile(mapsIDs[i])); + } + } + + static public void deleteImage(final File file) + { + instance.submitQuery(new WorkerRunnable() + { + @Override + public Void run() throws Throwable + { + Files.delete(file.toPath()); + return null; + } + + }); + } } diff --git a/src/main/java/fr/moribus/imageonmap/map/ImageMap.java b/src/main/java/fr/moribus/imageonmap/map/ImageMap.java index fbaa806..143bdb4 100644 --- a/src/main/java/fr/moribus/imageonmap/map/ImageMap.java +++ b/src/main/java/fr/moribus/imageonmap/map/ImageMap.java @@ -36,21 +36,43 @@ public abstract class ImageMap implements ConfigurationSerializable static public final int WIDTH = 128; static public final int HEIGHT = 128; + static public final String DEFAULT_NAME = "Map"; + private String id; private final UUID userUUID; private final Type mapType; - private String imageName; + private String name; protected ImageMap(UUID userUUID, Type mapType) + { + this(userUUID, mapType, null, null); + } + + protected ImageMap(UUID userUUID, Type mapType, String id, String name) { this.userUUID = userUUID; this.mapType = mapType; + this.id = id; + this.name = name; + + if(this.id == null) + { + if(this.name == null) this.name = DEFAULT_NAME; + this.id = MapManager.getNextAvailableMapID(name, userUUID); + } } public abstract short[] getMapsIDs(); public abstract boolean managesMap(short mapID); + public boolean managesMap(ItemStack item) + { + if(item == null) return false; + if(item.getType() != Material.MAP) return false; + return managesMap(item.getDurability()); + } + public void give(Inventory inventory) { short[] mapsIDs = getMapsIDs(); @@ -85,8 +107,10 @@ public abstract class ImageMap implements ConfigurationSerializable protected ImageMap(Map map, UUID userUUID, Type mapType) throws InvalidConfigurationException { - this(userUUID, mapType); - this.imageName = getNullableFieldValue(map, "name"); + this(userUUID, mapType, + (String) getNullableFieldValue(map, "id"), + (String) getNullableFieldValue(map, "name")); + } protected abstract void postSerialize(Map map); @@ -95,8 +119,9 @@ public abstract class ImageMap implements ConfigurationSerializable public Map serialize() { Map map = new HashMap(); + map.put("id", id); map.put("type", mapType.toString()); - map.put("name", imageName); + map.put("name", name); this.postSerialize(map); return map; } @@ -128,13 +153,26 @@ public abstract class ImageMap implements ConfigurationSerializable return userUUID; } - public String getImageName() + public String getName() { - return imageName; + return name; + } + + public String getId() + { + return id; } - public void setImageName(String imageName) + public void rename(String id, String name) { - this.imageName = imageName; + this.id = id; + this.name = name; + } + + public void rename(String name) + { + if(this.name.equals(name)) return; + this.id = MapManager.getNextAvailableMapID(name, userUUID); + this.name = name; } } diff --git a/src/main/java/fr/moribus/imageonmap/map/MapManager.java b/src/main/java/fr/moribus/imageonmap/map/MapManager.java index a6cec80..d0aaa40 100644 --- a/src/main/java/fr/moribus/imageonmap/map/MapManager.java +++ b/src/main/java/fr/moribus/imageonmap/map/MapManager.java @@ -19,10 +19,15 @@ package fr.moribus.imageonmap.map; import fr.moribus.imageonmap.ImageOnMap; +import fr.moribus.imageonmap.image.ImageIOExecutor; import fr.moribus.imageonmap.image.PosterImage; import java.util.ArrayList; +import java.util.List; import java.util.UUID; import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitTask; abstract public class MapManager @@ -55,10 +60,22 @@ abstract public class MapManager return false; } + static public boolean managesMap(ItemStack item) + { + synchronized(playerMaps) + { + for(PlayerMapStore mapStore : playerMaps) + { + if(mapStore.managesMap(item)) return true; + } + } + return false; + } + static public ImageMap createMap(UUID playerUUID, short mapID) { ImageMap newMap = new SingleMap(playerUUID, mapID); - addMap(newMap, playerUUID); + addMap(newMap); return newMap; } @@ -73,7 +90,7 @@ abstract public class MapManager { newMap = new PosterMap(playerUUID, mapsIDs, image.getColumns(), image.getLines()); } - addMap(newMap, playerUUID); + addMap(newMap); return newMap; } @@ -87,9 +104,15 @@ abstract public class MapManager return mapsIds; } - static public void addMap(ImageMap map, UUID playerUUID) + static public void addMap(ImageMap map) { - getPlayerMapStore(playerUUID).addMap(map); + getPlayerMapStore(map.getUserUUID()).addMap(map); + } + + static public void deleteMap(ImageMap map) + { + ImageIOExecutor.deleteImage(map); + getPlayerMapStore(map.getUserUUID()).deleteMap(map); } static public void notifyModification(UUID playerUUID) @@ -99,13 +122,50 @@ abstract public class MapManager Bukkit.getScheduler().runTaskLater(ImageOnMap.getPlugin(), new AutosaveRunnable(), SAVE_DELAY); } + static public String getNextAvailableMapID(String mapId, UUID playerUUID) + { + return getPlayerMapStore(playerUUID).getNextAvailableMapID(mapId); + } + + static public List getMapList(UUID playerUUID) + { + return getPlayerMapStore(playerUUID).getMapList(); + } + + static public ImageMap getMap(UUID playerUUID, String mapId) + { + return getPlayerMapStore(playerUUID).getMap(mapId); + } + + static public void clear(Inventory inventory) + { + for(int i = 0, c = inventory.getSize(); i < c; i++) + { + if(managesMap(inventory.getItem(i))) + { + inventory.setItem(i, new ItemStack(Material.AIR)); + } + } + } + + static public void clear(Inventory inventory, ImageMap map) + { + for(int i = 0, c = inventory.getSize(); i < c; i++) + { + if(map.managesMap(inventory.getItem(i))) + { + inventory.setItem(i, new ItemStack(Material.AIR)); + } + } + } + static public void save() { synchronized(playerMaps) { for(PlayerMapStore tStore : playerMaps) { - tStore.saveMapsFile(); + tStore.save(); } } } @@ -117,6 +177,7 @@ abstract public class MapManager { store = new PlayerMapStore(playerUUID); synchronized(playerMaps){playerMaps.add(store);} + store.load(); } return store; } @@ -142,7 +203,7 @@ abstract public class MapManager { for(PlayerMapStore toolStore : playerMaps) { - if(toolStore.isModified()) toolStore.saveMapsFile(); + if(toolStore.isModified()) toolStore.save(); } autosaveTask = null; } diff --git a/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java b/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java index cb8bc9a..d964d98 100644 --- a/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java +++ b/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java @@ -32,6 +32,7 @@ import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.serialization.ConfigurationSerializable; +import org.bukkit.inventory.ItemStack; public class PlayerMapStore implements ConfigurationSerializable { @@ -42,7 +43,6 @@ public class PlayerMapStore implements ConfigurationSerializable public PlayerMapStore(UUID playerUUID) { this.playerUUID = playerUUID; - loadMapsFile(); } public boolean managesMap(short mapID) @@ -54,12 +54,65 @@ public class PlayerMapStore implements ConfigurationSerializable return false; } + public boolean managesMap(ItemStack item) + { + for(ImageMap map : mapList) + { + if(map.managesMap(item)) return true; + } + return false; + } + public void addMap(ImageMap map) { mapList.add(map); notifyModification(); } + public void deleteMap(ImageMap map) + { + mapList.remove(map); + notifyModification(); + } + + public boolean mapExists(String id) + { + for(ImageMap map : mapList) + { + if(map.getId().equals(id)) return true; + } + + return false; + } + + public String getNextAvailableMapID(String mapId) + { + if(!mapExists(mapId)) return mapId; + int id = 0; + + do + { + id++; + }while(mapExists(mapId + "-" + id)); + + return mapId + "-" + id; + } + + public List getMapList() + { + return new ArrayList(mapList); + } + + public ImageMap getMap(String mapId) + { + for(ImageMap map : mapList) + { + if(map.getId().equals(mapId)) return map; + } + + return null; + } + /* ===== Getters & Setters ===== */ public UUID getUUID() @@ -123,23 +176,23 @@ public class PlayerMapStore implements ConfigurationSerializable private FileConfiguration getToolConfig() { - if(mapConfig == null) loadMapsFile(); + if(mapConfig == null) load(); return mapConfig; } - private void loadMapsFile() + public void load() { if(mapsFile == null) { mapsFile = new File(ImageOnMap.getPlugin().getMapsDirectory(), playerUUID.toString() + ".yml"); - if(!mapsFile.exists()) saveMapsFile(); + if(!mapsFile.exists()) save(); } mapConfig = YamlConfiguration.loadConfiguration(mapsFile); loadFromConfig(getToolConfig().getConfigurationSection("PlayerMapStore")); } - public void saveMapsFile() + public void save() { if(mapsFile == null || mapConfig == null) return; getToolConfig().set("PlayerMapStore", this.serialize()); diff --git a/src/main/java/fr/moribus/imageonmap/map/PosterMap.java b/src/main/java/fr/moribus/imageonmap/map/PosterMap.java index 700e725..f99b544 100644 --- a/src/main/java/fr/moribus/imageonmap/map/PosterMap.java +++ b/src/main/java/fr/moribus/imageonmap/map/PosterMap.java @@ -18,6 +18,7 @@ package fr.moribus.imageonmap.map; +import java.util.List; import java.util.Map; import java.util.UUID; import org.bukkit.configuration.InvalidConfigurationException; @@ -61,7 +62,13 @@ public class PosterMap extends ImageMap columnCount = getFieldValue(map, "columns"); rowCount = getFieldValue(map, "rows"); - mapsIDs = getFieldValue(map, "mapsIDs"); + + List idList = getFieldValue(map, "mapsIDs"); + mapsIDs = new short[idList.size()]; + for(int i = 0, c = idList.size(); i < c; i++) + { + mapsIDs[i] = (short) ((int) idList.get(i)); + } } @Override diff --git a/src/main/resources/help/maptool.txt b/src/main/resources/help/maptool.txt index b9b0178..6e79a99 100644 --- a/src/main/resources/help/maptool.txt +++ b/src/main/resources/help/maptool.txt @@ -1,2 +1,7 @@ This command manages and creates ImagesOnMaps. -new: Creates a new ImageOnMap. \ No newline at end of file +new: Creates a new ImageOnMap +delete: Deletes a map. +delete-noconfirm: Deletes a map. Deletion is permanent and made without confirmation +get: Gives you a map. +list: Lists all the map you currently have. +help : Use help for more information about a command. \ No newline at end of file diff --git a/src/main/resources/help/maptool/delete-noconfirm.txt b/src/main/resources/help/maptool/delete-noconfirm.txt new file mode 100644 index 0000000..1b3212d --- /dev/null +++ b/src/main/resources/help/maptool/delete-noconfirm.txt @@ -0,0 +1,4 @@ +Deletes a map, and removes all parts and copies from your inventory. +§cWARNING: §r THERE WILL BE NO CONFIRMATION. MAP DELETION IS §lPERMANENT§r. + +[map name] : The name of the map you want to delete. \ No newline at end of file diff --git a/src/main/resources/help/maptool/delete.txt b/src/main/resources/help/maptool/delete.txt new file mode 100644 index 0000000..81848b1 --- /dev/null +++ b/src/main/resources/help/maptool/delete.txt @@ -0,0 +1,5 @@ +Deletes a map, and removes all parts and copies from your inventory. +As deletion is permanent, a confirmation message will be shown +to the sending player. + +[map name] : The name of the map you want to delete. \ No newline at end of file diff --git a/src/main/resources/help/maptool/get.txt b/src/main/resources/help/maptool/get.txt new file mode 100644 index 0000000..455d44d --- /dev/null +++ b/src/main/resources/help/maptool/get.txt @@ -0,0 +1,3 @@ +Gives you a map, by putting it directly in your inventory. + + : The name of the map you want to get. \ No newline at end of file diff --git a/src/main/resources/help/maptool/list.txt b/src/main/resources/help/maptool/list.txt new file mode 100644 index 0000000..2b8d9a3 --- /dev/null +++ b/src/main/resources/help/maptool/list.txt @@ -0,0 +1 @@ +Gives you a list of all the maps you currently have. \ No newline at end of file