From 4885198888b5cb09c047823eddba468da4bfce20 Mon Sep 17 00:00:00 2001 From: kirbykirby56 Date: Sat, 24 Mar 2018 20:46:32 -0400 Subject: [PATCH 01/25] Add administrative commands --- .../fr/moribus/imageonmap/ImageOnMap.java | 22 +++- .../fr/moribus/imageonmap/Permissions.java | 7 +- .../commands/maptool/DebugCommand.java | 41 ++++++ .../commands/maptool/DeleteOtherCommand.java | 98 ++++++++++++++ .../commands/maptool/GetOtherCommand.java | 80 +++++++++++ .../commands/maptool/ListOtherCommand.java | 124 ++++++++++++++++++ .../fr/moribus/imageonmap/map/ImageMap.java | 8 +- .../fr/moribus/imageonmap/map/MapManager.java | 3 +- .../imageonmap/map/PlayerMapStore.java | 3 +- src/main/resources/config.yml | 9 ++ src/main/resources/help/maptool.txt | 1 + src/main/resources/help/maptool/getother.txt | 4 + src/main/resources/help/maptool/listother.txt | 1 + 13 files changed, 390 insertions(+), 11 deletions(-) create mode 100644 src/main/java/fr/moribus/imageonmap/commands/maptool/DebugCommand.java create mode 100644 src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java create mode 100644 src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java create mode 100644 src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java create mode 100644 src/main/resources/help/maptool/getother.txt create mode 100644 src/main/resources/help/maptool/listother.txt diff --git a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java index f16aa90..cd3f22a 100644 --- a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java +++ b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java @@ -18,13 +18,17 @@ package fr.moribus.imageonmap; +import fr.moribus.imageonmap.commands.maptool.DebugCommand; import fr.moribus.imageonmap.commands.maptool.DeleteCommand; -import fr.moribus.imageonmap.commands.maptool.ExploreCommand; -import fr.moribus.imageonmap.commands.maptool.GetCommand; -import fr.moribus.imageonmap.commands.maptool.GetRemainingCommand; +import fr.moribus.imageonmap.commands.maptool.DeleteOtherCommand; import fr.moribus.imageonmap.commands.maptool.ListCommand; +import fr.moribus.imageonmap.commands.maptool.ListOtherCommand; import fr.moribus.imageonmap.commands.maptool.MigrateCommand; import fr.moribus.imageonmap.commands.maptool.NewCommand; +import fr.moribus.imageonmap.commands.maptool.GetCommand; +import fr.moribus.imageonmap.commands.maptool.GetRemainingCommand; +import fr.moribus.imageonmap.commands.maptool.GetOtherCommand; +import fr.moribus.imageonmap.commands.maptool.ExploreCommand; import fr.moribus.imageonmap.image.ImageIOExecutor; import fr.moribus.imageonmap.image.ImageRendererExecutor; import fr.moribus.imageonmap.image.MapInitEvent; @@ -41,12 +45,12 @@ import fr.zcraft.zlib.tools.PluginLogger; import java.io.File; import java.io.IOException; + public final class ImageOnMap extends ZPlugin { static private final String IMAGES_DIRECTORY_NAME = "images"; static private final String MAPS_DIRECTORY_NAME = "maps"; static private ImageOnMap plugin; - private File imagesDirectory; private final File mapsDirectory; @@ -69,6 +73,7 @@ public final class ImageOnMap extends ZPlugin return new File(imagesDirectory, "map"+mapID+".png"); } + @SuppressWarnings ("unchecked") @Override public void onEnable() @@ -85,11 +90,12 @@ public final class ImageOnMap extends ZPlugin this.setEnabled(false); return; } - + + saveDefaultConfig(); loadComponents(I18n.class, Gui.class, Commands.class, PluginConfiguration.class, ImageIOExecutor.class, ImageRendererExecutor.class); - + //Init all the things ! MetricsLite.startMetrics(); I18n.setPrimaryLocale(PluginConfiguration.LANG.get()); @@ -101,8 +107,12 @@ public final class ImageOnMap extends ZPlugin Commands.register( "maptool", NewCommand.class, + DebugCommand.class, ListCommand.class, GetCommand.class, + GetOtherCommand.class, + ListOtherCommand.class, + DeleteOtherCommand.class, DeleteCommand.class, GetRemainingCommand.class, ExploreCommand.class, diff --git a/src/main/java/fr/moribus/imageonmap/Permissions.java b/src/main/java/fr/moribus/imageonmap/Permissions.java index abaa110..ba6c552 100644 --- a/src/main/java/fr/moribus/imageonmap/Permissions.java +++ b/src/main/java/fr/moribus/imageonmap/Permissions.java @@ -1,5 +1,5 @@ /* - * Copyright or © or Copr. AmauryCarrade (2015) + * Copyright or © or Copr. AmauryCarrade (2015) * * http://amaury.carrade.eu * @@ -38,9 +38,12 @@ public enum Permissions { NEW("imageonmap.new", "imageonmap.userender"), LIST("imageonmap.list"), + LISTOTHER("imageonmap.listother"), GET("imageonmap.get"), + GETOTHER("imageonmap.getother"), RENAME("imageonmap.rename"), DELETE("imageonmap.delete"), + DELETEOTHER("imageonmap.deleteother"), ADMINISTRATIVE("imageonmap.administrative") ; @@ -72,4 +75,4 @@ public enum Permissions return false; } -} +} \ No newline at end of file diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/DebugCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/DebugCommand.java new file mode 100644 index 0000000..9d43270 --- /dev/null +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/DebugCommand.java @@ -0,0 +1,41 @@ +/* + * 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.PluginConfiguration; +import fr.moribus.imageonmap.commands.IoMCommand; +import fr.zcraft.zlib.components.commands.CommandException; +import fr.zcraft.zlib.components.commands.CommandInfo; +import org.bukkit.entity.Player; + +@CommandInfo (name = "debug") +public class DebugCommand extends IoMCommand +{ + @Override + protected void run() throws CommandException + { + Player p = playerSender(); + p.sendMessage("Limit Map Size X" + PluginConfiguration.LIMIT_SIZE_X.get().toString()); + p.sendMessage("Limit Map Size Y" + PluginConfiguration.LIMIT_SIZE_Y.get().toString()); + p.sendMessage("Global Map Limit" + PluginConfiguration.MAP_GLOBAL_LIMIT.get().toString()); + p.sendMessage("Player Map Limit" + PluginConfiguration.MAP_PLAYER_LIMIT.get().toString()); + p.sendMessage("Collect Data" + PluginConfiguration.COLLECT_DATA.get().toString()); + p.sendMessage("Save Full Image" + PluginConfiguration.SAVE_FULL_IMAGE.get().toString()); + } +} diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java new file mode 100644 index 0000000..7f95328 --- /dev/null +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java @@ -0,0 +1,98 @@ +/* + * 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.Permissions; +import fr.moribus.imageonmap.commands.IoMCommand; +import fr.moribus.imageonmap.map.ImageMap; +import fr.moribus.imageonmap.map.MapManager; +import fr.moribus.imageonmap.map.MapManagerException; +import fr.zcraft.zlib.components.commands.CommandException; +import fr.zcraft.zlib.components.commands.CommandInfo; +import fr.zcraft.zlib.components.commands.WithFlags; +import fr.zcraft.zlib.components.i18n.I; +import fr.zcraft.zlib.tools.PluginLogger; + +import org.bukkit.Bukkit; +import org.bukkit.OfflinePlayer; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import java.util.List; +import java.util.UUID; + +@CommandInfo (name = "deleteother", usageParameters = " ") +@WithFlags ({"confirm"}) +public class DeleteOtherCommand extends IoMCommand +{ + @Override + protected void run() throws CommandException + { + if(args.length < 2) warning(I.t("Not enough parameters! Usage: /maptool deleteother ")); + if(!playerSender().hasPermission("imageonmap.delete.other")) { + warning(I.t("You do not have permission for this command. (imageonmap.delete.other)")); + return; + } + + Player player = null; + UUID uuid = null; + OfflinePlayer op = null; + player = Bukkit.getPlayer(args[0]); + if(player == null){ + op = Bukkit.getOfflinePlayer(args[0]); + if(op.hasPlayedBefore()) uuid = op.getUniqueId(); + else warning(I.t("We've never seen that player before!")); + } + else uuid = player.getUniqueId(); + String mapName = ""; + mapName = args[1]; + if(args.length > 2) for(int i = 2; i < args.length; i++) mapName += (" " + args[i - 1]); + + ImageMap map = MapManager.getMap(uuid, mapName); + + if(player != null) MapManager.clear(player.getInventory(), map); + //if(player == null) MapManager.clear(op.getPlayer().getInventory(), map); + + try + { + MapManager.deleteMap(map); + info(I.t("Map successfully deleted.")); + } + catch (MapManagerException ex) + { + PluginLogger.warning("A non-existent map was requested to be deleted", ex); + warning(I.t("This map does not exist.")); + } + } + + + @Override + protected List complete() throws CommandException + { + if(args.length == 1) + return getMatchingMapNames(playerSender(), args[0]); + + return null; + } + @Override + public boolean canExecute(CommandSender sender) + { + return Permissions.DELETEOTHER.grantedTo(sender); + } +} diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java new file mode 100644 index 0000000..d8529d5 --- /dev/null +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java @@ -0,0 +1,80 @@ +/* + * 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 java.util.UUID; + +import org.bukkit.Bukkit; +import org.bukkit.OfflinePlayer; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import fr.moribus.imageonmap.Permissions; +import fr.moribus.imageonmap.commands.IoMCommand; +import fr.moribus.imageonmap.map.ImageMap; +import fr.moribus.imageonmap.map.MapManager; +import fr.zcraft.zlib.components.commands.CommandException; +import fr.zcraft.zlib.components.commands.CommandInfo; +import fr.zcraft.zlib.components.i18n.I; + + +@CommandInfo (name = "getother", usageParameters = " ") +public class GetOtherCommand extends IoMCommand +{ + @SuppressWarnings("deprecation") + @Override + protected void run() throws CommandException + { + if(args.length < 2) warning(I.t("Not enough parameters! Usage: /maptool getother ")); + //Deny those who do not have permission. + if(!playerSender().hasPermission("imageonmap.get.other")) { + warning(I.t("You do not have permission for this command. (imageonmap.get.other)")); + return; + } + + Player player = null; + UUID uuid = null; + player = Bukkit.getPlayer(args[0]); + if(player == null){ + OfflinePlayer op = Bukkit.getOfflinePlayer(args[0]); + if(op.hasPlayedBefore()) uuid = op.getUniqueId(); + else warning(I.t("We've never seen that player before!")); + } + else { + uuid = player.getUniqueId(); + } + ImageMap map = null; + String mapName = ""; + mapName = args[1]; + if(args.length > 2) { + for(int i = 2; i < args.length; i++) { + mapName += (" " + args[i - 1]); + } + } + map = MapManager.getMap(uuid, mapName); + map.give(playerSender()); + return; + } + @Override + public boolean canExecute(CommandSender sender) + { + return Permissions.GETOTHER.grantedTo(sender); + } +} diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java new file mode 100644 index 0000000..292c1ea --- /dev/null +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java @@ -0,0 +1,124 @@ +/* + * 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 java.util.List; +import java.util.UUID; + +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.OfflinePlayer; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import fr.moribus.imageonmap.Permissions; +import fr.moribus.imageonmap.commands.IoMCommand; +import fr.moribus.imageonmap.map.ImageMap; +import fr.moribus.imageonmap.map.MapManager; +import fr.moribus.imageonmap.map.PosterMap; +import fr.zcraft.zlib.components.commands.CommandException; +import fr.zcraft.zlib.components.commands.CommandInfo; +import fr.zcraft.zlib.components.i18n.I; +import fr.zcraft.zlib.components.rawtext.RawText; +import fr.zcraft.zlib.components.rawtext.RawTextPart; +import fr.zcraft.zlib.tools.items.ItemStackBuilder; +import fr.zcraft.zlib.tools.text.RawMessage; + + +@CommandInfo (name = "listother", usageParameters = "") +public class ListOtherCommand extends IoMCommand +{ + @Override + protected void run() throws CommandException + { + if(args.length < 1) warning(I.t("Not enough parameters! Usage: /maptool listother ")); + if(!playerSender().hasPermission("imageonmap.list.other")) { + warning(I.t("You do not have permission for this command. (imageonmap.list.other)")); + return; + } + + Player player = null; + UUID uuid = null; + player = Bukkit.getPlayer(args[0]); + if(player == null){ + OfflinePlayer op = Bukkit.getOfflinePlayer(args[0]); + if(op.hasPlayedBefore()) { + uuid = op.getUniqueId(); + } + else { + warning(I.t("We've never seen that player before!")); + + } + } + else{ + uuid = player.getUniqueId(); + } + + List mapList = null; + try{ + mapList = MapManager.getMapList(uuid); + } + catch(Exception e){ + + } + if(mapList.isEmpty()) + { + info(I.t("No map found.")); + return; + } + + info(I.tn("{white}{bold}{0} map found.", "{white}{bold}{0} maps found.", mapList.size())); + + RawTextPart rawText = new RawText(""); + rawText = addMap(rawText, mapList.get(0)); + + for(int i = 1, c = mapList.size(); i < c; i++) + { + rawText = rawText.then(", ").color(ChatColor.GRAY); + rawText = addMap(rawText, mapList.get(i)); + } + + RawMessage.send(playerSender(), rawText.build()); + } + + private RawTextPart addMap(RawTextPart rawText, ImageMap map) + { + final String size = map.getType() == ImageMap.Type.SINGLE ? "1 × 1" : ((PosterMap) map).getColumnCount() + " × " + ((PosterMap) map).getRowCount(); + + return rawText + .then(map.getId()) + .color(ChatColor.WHITE) + .command(GetCommand.class, map.getId()) + .hover(new ItemStackBuilder(Material.MAP) + .title(ChatColor.GREEN + "" + ChatColor.BOLD + map.getName()) + .lore(ChatColor.GRAY + map.getId() + ", " + size) + .lore("") + .lore(I.t("{white}Click{gray} to get this map")) + .hideAttributes() + .item() + ); + } + @Override + public boolean canExecute(CommandSender sender) + { + return Permissions.LISTOTHER.grantedTo(sender); + } +} diff --git a/src/main/java/fr/moribus/imageonmap/map/ImageMap.java b/src/main/java/fr/moribus/imageonmap/map/ImageMap.java index bd71fad..4f12ca9 100644 --- a/src/main/java/fr/moribus/imageonmap/map/ImageMap.java +++ b/src/main/java/fr/moribus/imageonmap/map/ImageMap.java @@ -18,6 +18,7 @@ package fr.moribus.imageonmap.map; +import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.ui.MapItemManager; import fr.zcraft.zlib.components.i18n.I; import org.bukkit.Material; @@ -26,6 +27,7 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import java.io.File; import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -47,7 +49,6 @@ public abstract class ImageMap implements ConfigurationSerializable private final UUID userUUID; private final Type mapType; private String name; - protected ImageMap(UUID userUUID, Type mapType) { this(userUUID, mapType, null, null); @@ -84,6 +85,11 @@ public abstract class ImageMap implements ConfigurationSerializable return MapItemManager.give(player, this); } + public static File getFullImageFile(short mapIDstart, short mapIDend) + { + return new File(ImageOnMap.getPlugin().getImagesDirectory(), "_"+mapIDstart+"-"+mapIDend+".png"); + } + /* ====== Serialization methods ====== */ static public ImageMap fromConfig(Map map, UUID userUUID) throws InvalidConfigurationException diff --git a/src/main/java/fr/moribus/imageonmap/map/MapManager.java b/src/main/java/fr/moribus/imageonmap/map/MapManager.java index fa58f99..c4aa7bc 100644 --- a/src/main/java/fr/moribus/imageonmap/map/MapManager.java +++ b/src/main/java/fr/moribus/imageonmap/map/MapManager.java @@ -18,12 +18,13 @@ package fr.moribus.imageonmap.map; -import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.PluginConfiguration; import fr.moribus.imageonmap.image.ImageIOExecutor; import fr.moribus.imageonmap.image.PosterImage; import fr.moribus.imageonmap.map.MapManagerException.Reason; import fr.zcraft.zlib.tools.PluginLogger; +import fr.moribus.imageonmap.ImageOnMap; + import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.inventory.Inventory; diff --git a/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java b/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java index 0c8d531..c052165 100644 --- a/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java +++ b/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java @@ -18,10 +18,11 @@ package fr.moribus.imageonmap.map; -import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.PluginConfiguration; import fr.moribus.imageonmap.map.MapManagerException.Reason; import fr.zcraft.zlib.tools.PluginLogger; +import fr.moribus.imageonmap.ImageOnMap; + import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.InvalidConfigurationException; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 5ffe7d4..ab0ed6f 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -16,3 +16,12 @@ collect-data: true # 0 means unlimited. map-global-limit: 0 map-player-limit: 0 + + +#Maximum size in pixels for an image to be. 0 is unlimited. +limit-map-size-x: 0 +limit-map-size-y: 0 + + +#Should the full image be saved when a map is rendered? +save-full-image: false \ No newline at end of file diff --git a/src/main/resources/help/maptool.txt b/src/main/resources/help/maptool.txt index 8859d51..b211c1c 100644 --- a/src/main/resources/help/maptool.txt +++ b/src/main/resources/help/maptool.txt @@ -3,6 +3,7 @@ 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. +getother: Gets another player's map. getremaining: Gives you the remaining maps that could not fit in your inventory list: Lists all the map you currently have. explore: Opens a GUI to see and manage your maps. diff --git a/src/main/resources/help/maptool/getother.txt b/src/main/resources/help/maptool/getother.txt new file mode 100644 index 0000000..2c11fd3 --- /dev/null +++ b/src/main/resources/help/maptool/getother.txt @@ -0,0 +1,4 @@ +Gets another player's map. + +§6: §rThe name of the player who owns the map. +§6: §rThe name of the map. Use /maptool listother to get map names. \ No newline at end of file diff --git a/src/main/resources/help/maptool/listother.txt b/src/main/resources/help/maptool/listother.txt new file mode 100644 index 0000000..a24cb0a --- /dev/null +++ b/src/main/resources/help/maptool/listother.txt @@ -0,0 +1 @@ +Lists another player's maps. \ No newline at end of file From f5c3cb2bfd57cfe40b55af159421a50c41d18f19 Mon Sep 17 00:00:00 2001 From: kirbykirby56 Date: Sat, 24 Mar 2018 20:51:47 -0400 Subject: [PATCH 02/25] Removed debug-command --- .../fr/moribus/imageonmap/ImageOnMap.java | 2 - .../commands/maptool/DebugCommand.java | 41 ------------------- 2 files changed, 43 deletions(-) delete mode 100644 src/main/java/fr/moribus/imageonmap/commands/maptool/DebugCommand.java diff --git a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java index cd3f22a..d210ee3 100644 --- a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java +++ b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java @@ -18,7 +18,6 @@ package fr.moribus.imageonmap; -import fr.moribus.imageonmap.commands.maptool.DebugCommand; import fr.moribus.imageonmap.commands.maptool.DeleteCommand; import fr.moribus.imageonmap.commands.maptool.DeleteOtherCommand; import fr.moribus.imageonmap.commands.maptool.ListCommand; @@ -107,7 +106,6 @@ public final class ImageOnMap extends ZPlugin Commands.register( "maptool", NewCommand.class, - DebugCommand.class, ListCommand.class, GetCommand.class, GetOtherCommand.class, diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/DebugCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/DebugCommand.java deleted file mode 100644 index 9d43270..0000000 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/DebugCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.PluginConfiguration; -import fr.moribus.imageonmap.commands.IoMCommand; -import fr.zcraft.zlib.components.commands.CommandException; -import fr.zcraft.zlib.components.commands.CommandInfo; -import org.bukkit.entity.Player; - -@CommandInfo (name = "debug") -public class DebugCommand extends IoMCommand -{ - @Override - protected void run() throws CommandException - { - Player p = playerSender(); - p.sendMessage("Limit Map Size X" + PluginConfiguration.LIMIT_SIZE_X.get().toString()); - p.sendMessage("Limit Map Size Y" + PluginConfiguration.LIMIT_SIZE_Y.get().toString()); - p.sendMessage("Global Map Limit" + PluginConfiguration.MAP_GLOBAL_LIMIT.get().toString()); - p.sendMessage("Player Map Limit" + PluginConfiguration.MAP_PLAYER_LIMIT.get().toString()); - p.sendMessage("Collect Data" + PluginConfiguration.COLLECT_DATA.get().toString()); - p.sendMessage("Save Full Image" + PluginConfiguration.SAVE_FULL_IMAGE.get().toString()); - } -} From 4e4212e42fce3d7f2e7951d831c4e73afe1bf159 Mon Sep 17 00:00:00 2001 From: kirbykirby56 Date: Sat, 24 Mar 2018 21:05:14 -0400 Subject: [PATCH 03/25] Revert to 3d7d2fd Because I screwed up. --- .../fr/moribus/imageonmap/ImageOnMap.java | 22 ++++++------------- .../fr/moribus/imageonmap/Permissions.java | 7 ++---- .../fr/moribus/imageonmap/map/ImageMap.java | 8 +------ .../fr/moribus/imageonmap/map/MapManager.java | 3 +-- .../imageonmap/map/PlayerMapStore.java | 3 +-- src/main/resources/config.yml | 9 -------- src/main/resources/help/maptool.txt | 1 - 7 files changed, 12 insertions(+), 41 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java index d210ee3..f16aa90 100644 --- a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java +++ b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java @@ -19,15 +19,12 @@ package fr.moribus.imageonmap; import fr.moribus.imageonmap.commands.maptool.DeleteCommand; -import fr.moribus.imageonmap.commands.maptool.DeleteOtherCommand; -import fr.moribus.imageonmap.commands.maptool.ListCommand; -import fr.moribus.imageonmap.commands.maptool.ListOtherCommand; -import fr.moribus.imageonmap.commands.maptool.MigrateCommand; -import fr.moribus.imageonmap.commands.maptool.NewCommand; +import fr.moribus.imageonmap.commands.maptool.ExploreCommand; import fr.moribus.imageonmap.commands.maptool.GetCommand; import fr.moribus.imageonmap.commands.maptool.GetRemainingCommand; -import fr.moribus.imageonmap.commands.maptool.GetOtherCommand; -import fr.moribus.imageonmap.commands.maptool.ExploreCommand; +import fr.moribus.imageonmap.commands.maptool.ListCommand; +import fr.moribus.imageonmap.commands.maptool.MigrateCommand; +import fr.moribus.imageonmap.commands.maptool.NewCommand; import fr.moribus.imageonmap.image.ImageIOExecutor; import fr.moribus.imageonmap.image.ImageRendererExecutor; import fr.moribus.imageonmap.image.MapInitEvent; @@ -44,12 +41,12 @@ import fr.zcraft.zlib.tools.PluginLogger; import java.io.File; import java.io.IOException; - public final class ImageOnMap extends ZPlugin { static private final String IMAGES_DIRECTORY_NAME = "images"; static private final String MAPS_DIRECTORY_NAME = "maps"; static private ImageOnMap plugin; + private File imagesDirectory; private final File mapsDirectory; @@ -72,7 +69,6 @@ public final class ImageOnMap extends ZPlugin return new File(imagesDirectory, "map"+mapID+".png"); } - @SuppressWarnings ("unchecked") @Override public void onEnable() @@ -89,12 +85,11 @@ public final class ImageOnMap extends ZPlugin this.setEnabled(false); return; } - - + saveDefaultConfig(); loadComponents(I18n.class, Gui.class, Commands.class, PluginConfiguration.class, ImageIOExecutor.class, ImageRendererExecutor.class); - + //Init all the things ! MetricsLite.startMetrics(); I18n.setPrimaryLocale(PluginConfiguration.LANG.get()); @@ -108,9 +103,6 @@ public final class ImageOnMap extends ZPlugin NewCommand.class, ListCommand.class, GetCommand.class, - GetOtherCommand.class, - ListOtherCommand.class, - DeleteOtherCommand.class, DeleteCommand.class, GetRemainingCommand.class, ExploreCommand.class, diff --git a/src/main/java/fr/moribus/imageonmap/Permissions.java b/src/main/java/fr/moribus/imageonmap/Permissions.java index ba6c552..abaa110 100644 --- a/src/main/java/fr/moribus/imageonmap/Permissions.java +++ b/src/main/java/fr/moribus/imageonmap/Permissions.java @@ -1,5 +1,5 @@ /* - * Copyright or © or Copr. AmauryCarrade (2015) + * Copyright or © or Copr. AmauryCarrade (2015) * * http://amaury.carrade.eu * @@ -38,12 +38,9 @@ public enum Permissions { NEW("imageonmap.new", "imageonmap.userender"), LIST("imageonmap.list"), - LISTOTHER("imageonmap.listother"), GET("imageonmap.get"), - GETOTHER("imageonmap.getother"), RENAME("imageonmap.rename"), DELETE("imageonmap.delete"), - DELETEOTHER("imageonmap.deleteother"), ADMINISTRATIVE("imageonmap.administrative") ; @@ -75,4 +72,4 @@ public enum Permissions return false; } -} \ No newline at end of file +} diff --git a/src/main/java/fr/moribus/imageonmap/map/ImageMap.java b/src/main/java/fr/moribus/imageonmap/map/ImageMap.java index 4f12ca9..bd71fad 100644 --- a/src/main/java/fr/moribus/imageonmap/map/ImageMap.java +++ b/src/main/java/fr/moribus/imageonmap/map/ImageMap.java @@ -18,7 +18,6 @@ package fr.moribus.imageonmap.map; -import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.ui.MapItemManager; import fr.zcraft.zlib.components.i18n.I; import org.bukkit.Material; @@ -27,7 +26,6 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.io.File; import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -49,6 +47,7 @@ public abstract class ImageMap implements ConfigurationSerializable private final UUID userUUID; private final Type mapType; private String name; + protected ImageMap(UUID userUUID, Type mapType) { this(userUUID, mapType, null, null); @@ -85,11 +84,6 @@ public abstract class ImageMap implements ConfigurationSerializable return MapItemManager.give(player, this); } - public static File getFullImageFile(short mapIDstart, short mapIDend) - { - return new File(ImageOnMap.getPlugin().getImagesDirectory(), "_"+mapIDstart+"-"+mapIDend+".png"); - } - /* ====== Serialization methods ====== */ static public ImageMap fromConfig(Map map, UUID userUUID) throws InvalidConfigurationException diff --git a/src/main/java/fr/moribus/imageonmap/map/MapManager.java b/src/main/java/fr/moribus/imageonmap/map/MapManager.java index c4aa7bc..fa58f99 100644 --- a/src/main/java/fr/moribus/imageonmap/map/MapManager.java +++ b/src/main/java/fr/moribus/imageonmap/map/MapManager.java @@ -18,13 +18,12 @@ package fr.moribus.imageonmap.map; +import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.PluginConfiguration; import fr.moribus.imageonmap.image.ImageIOExecutor; import fr.moribus.imageonmap.image.PosterImage; import fr.moribus.imageonmap.map.MapManagerException.Reason; import fr.zcraft.zlib.tools.PluginLogger; -import fr.moribus.imageonmap.ImageOnMap; - import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.inventory.Inventory; diff --git a/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java b/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java index c052165..0c8d531 100644 --- a/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java +++ b/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java @@ -18,11 +18,10 @@ package fr.moribus.imageonmap.map; +import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.PluginConfiguration; import fr.moribus.imageonmap.map.MapManagerException.Reason; import fr.zcraft.zlib.tools.PluginLogger; -import fr.moribus.imageonmap.ImageOnMap; - import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.InvalidConfigurationException; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index ab0ed6f..5ffe7d4 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -16,12 +16,3 @@ collect-data: true # 0 means unlimited. map-global-limit: 0 map-player-limit: 0 - - -#Maximum size in pixels for an image to be. 0 is unlimited. -limit-map-size-x: 0 -limit-map-size-y: 0 - - -#Should the full image be saved when a map is rendered? -save-full-image: false \ No newline at end of file diff --git a/src/main/resources/help/maptool.txt b/src/main/resources/help/maptool.txt index b211c1c..8859d51 100644 --- a/src/main/resources/help/maptool.txt +++ b/src/main/resources/help/maptool.txt @@ -3,7 +3,6 @@ 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. -getother: Gets another player's map. getremaining: Gives you the remaining maps that could not fit in your inventory list: Lists all the map you currently have. explore: Opens a GUI to see and manage your maps. From 2050a113b58846c2586dab4020aa6c0ed79ed411 Mon Sep 17 00:00:00 2001 From: kirbykirby56 Date: Sat, 24 Mar 2018 21:06:49 -0400 Subject: [PATCH 04/25] Add administrative commands --- .../fr/moribus/imageonmap/ImageOnMap.java | 19 +++++++++++++------ .../fr/moribus/imageonmap/Permissions.java | 7 +++++-- .../fr/moribus/imageonmap/map/ImageMap.java | 8 +++++++- .../fr/moribus/imageonmap/map/MapManager.java | 3 ++- .../imageonmap/map/PlayerMapStore.java | 3 ++- src/main/resources/help/maptool.txt | 1 + 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java index f16aa90..3341659 100644 --- a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java +++ b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java @@ -19,12 +19,15 @@ package fr.moribus.imageonmap; import fr.moribus.imageonmap.commands.maptool.DeleteCommand; -import fr.moribus.imageonmap.commands.maptool.ExploreCommand; -import fr.moribus.imageonmap.commands.maptool.GetCommand; -import fr.moribus.imageonmap.commands.maptool.GetRemainingCommand; +import fr.moribus.imageonmap.commands.maptool.DeleteOtherCommand; import fr.moribus.imageonmap.commands.maptool.ListCommand; +import fr.moribus.imageonmap.commands.maptool.ListOtherCommand; import fr.moribus.imageonmap.commands.maptool.MigrateCommand; import fr.moribus.imageonmap.commands.maptool.NewCommand; +import fr.moribus.imageonmap.commands.maptool.GetCommand; +import fr.moribus.imageonmap.commands.maptool.GetRemainingCommand; +import fr.moribus.imageonmap.commands.maptool.GetOtherCommand; +import fr.moribus.imageonmap.commands.maptool.ExploreCommand; import fr.moribus.imageonmap.image.ImageIOExecutor; import fr.moribus.imageonmap.image.ImageRendererExecutor; import fr.moribus.imageonmap.image.MapInitEvent; @@ -46,7 +49,6 @@ public final class ImageOnMap extends ZPlugin static private final String IMAGES_DIRECTORY_NAME = "images"; static private final String MAPS_DIRECTORY_NAME = "maps"; static private ImageOnMap plugin; - private File imagesDirectory; private final File mapsDirectory; @@ -69,6 +71,7 @@ public final class ImageOnMap extends ZPlugin return new File(imagesDirectory, "map"+mapID+".png"); } + @SuppressWarnings ("unchecked") @Override public void onEnable() @@ -85,11 +88,12 @@ public final class ImageOnMap extends ZPlugin this.setEnabled(false); return; } - + + saveDefaultConfig(); loadComponents(I18n.class, Gui.class, Commands.class, PluginConfiguration.class, ImageIOExecutor.class, ImageRendererExecutor.class); - + //Init all the things ! MetricsLite.startMetrics(); I18n.setPrimaryLocale(PluginConfiguration.LANG.get()); @@ -103,6 +107,9 @@ public final class ImageOnMap extends ZPlugin NewCommand.class, ListCommand.class, GetCommand.class, + GetOtherCommand.class, + ListOtherCommand.class, + DeleteOtherCommand.class, DeleteCommand.class, GetRemainingCommand.class, ExploreCommand.class, diff --git a/src/main/java/fr/moribus/imageonmap/Permissions.java b/src/main/java/fr/moribus/imageonmap/Permissions.java index abaa110..ba6c552 100644 --- a/src/main/java/fr/moribus/imageonmap/Permissions.java +++ b/src/main/java/fr/moribus/imageonmap/Permissions.java @@ -1,5 +1,5 @@ /* - * Copyright or © or Copr. AmauryCarrade (2015) + * Copyright or © or Copr. AmauryCarrade (2015) * * http://amaury.carrade.eu * @@ -38,9 +38,12 @@ public enum Permissions { NEW("imageonmap.new", "imageonmap.userender"), LIST("imageonmap.list"), + LISTOTHER("imageonmap.listother"), GET("imageonmap.get"), + GETOTHER("imageonmap.getother"), RENAME("imageonmap.rename"), DELETE("imageonmap.delete"), + DELETEOTHER("imageonmap.deleteother"), ADMINISTRATIVE("imageonmap.administrative") ; @@ -72,4 +75,4 @@ public enum Permissions return false; } -} +} \ No newline at end of file diff --git a/src/main/java/fr/moribus/imageonmap/map/ImageMap.java b/src/main/java/fr/moribus/imageonmap/map/ImageMap.java index bd71fad..4f12ca9 100644 --- a/src/main/java/fr/moribus/imageonmap/map/ImageMap.java +++ b/src/main/java/fr/moribus/imageonmap/map/ImageMap.java @@ -18,6 +18,7 @@ package fr.moribus.imageonmap.map; +import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.ui.MapItemManager; import fr.zcraft.zlib.components.i18n.I; import org.bukkit.Material; @@ -26,6 +27,7 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import java.io.File; import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -47,7 +49,6 @@ public abstract class ImageMap implements ConfigurationSerializable private final UUID userUUID; private final Type mapType; private String name; - protected ImageMap(UUID userUUID, Type mapType) { this(userUUID, mapType, null, null); @@ -84,6 +85,11 @@ public abstract class ImageMap implements ConfigurationSerializable return MapItemManager.give(player, this); } + public static File getFullImageFile(short mapIDstart, short mapIDend) + { + return new File(ImageOnMap.getPlugin().getImagesDirectory(), "_"+mapIDstart+"-"+mapIDend+".png"); + } + /* ====== Serialization methods ====== */ static public ImageMap fromConfig(Map map, UUID userUUID) throws InvalidConfigurationException diff --git a/src/main/java/fr/moribus/imageonmap/map/MapManager.java b/src/main/java/fr/moribus/imageonmap/map/MapManager.java index fa58f99..c4aa7bc 100644 --- a/src/main/java/fr/moribus/imageonmap/map/MapManager.java +++ b/src/main/java/fr/moribus/imageonmap/map/MapManager.java @@ -18,12 +18,13 @@ package fr.moribus.imageonmap.map; -import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.PluginConfiguration; import fr.moribus.imageonmap.image.ImageIOExecutor; import fr.moribus.imageonmap.image.PosterImage; import fr.moribus.imageonmap.map.MapManagerException.Reason; import fr.zcraft.zlib.tools.PluginLogger; +import fr.moribus.imageonmap.ImageOnMap; + import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.inventory.Inventory; diff --git a/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java b/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java index 0c8d531..c052165 100644 --- a/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java +++ b/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java @@ -18,10 +18,11 @@ package fr.moribus.imageonmap.map; -import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.PluginConfiguration; import fr.moribus.imageonmap.map.MapManagerException.Reason; import fr.zcraft.zlib.tools.PluginLogger; +import fr.moribus.imageonmap.ImageOnMap; + import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.InvalidConfigurationException; diff --git a/src/main/resources/help/maptool.txt b/src/main/resources/help/maptool.txt index 8859d51..b211c1c 100644 --- a/src/main/resources/help/maptool.txt +++ b/src/main/resources/help/maptool.txt @@ -3,6 +3,7 @@ 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. +getother: Gets another player's map. getremaining: Gives you the remaining maps that could not fit in your inventory list: Lists all the map you currently have. explore: Opens a GUI to see and manage your maps. From aeceb0fb63be54e3bf56f4bee055e0779dd6b16e Mon Sep 17 00:00:00 2001 From: kirbykirby56 Date: Sat, 24 Mar 2018 21:09:03 -0400 Subject: [PATCH 05/25] Revert to 3d7d2fd again Because git is really hard for beginners and i keep including ImageMap.java --- .../fr/moribus/imageonmap/ImageOnMap.java | 21 +++++++------------ .../fr/moribus/imageonmap/Permissions.java | 7 ++----- .../fr/moribus/imageonmap/map/ImageMap.java | 8 +------ .../fr/moribus/imageonmap/map/MapManager.java | 3 +-- .../imageonmap/map/PlayerMapStore.java | 3 +-- src/main/resources/help/maptool.txt | 1 - 6 files changed, 12 insertions(+), 31 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java index 3341659..f16aa90 100644 --- a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java +++ b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java @@ -19,15 +19,12 @@ package fr.moribus.imageonmap; import fr.moribus.imageonmap.commands.maptool.DeleteCommand; -import fr.moribus.imageonmap.commands.maptool.DeleteOtherCommand; -import fr.moribus.imageonmap.commands.maptool.ListCommand; -import fr.moribus.imageonmap.commands.maptool.ListOtherCommand; -import fr.moribus.imageonmap.commands.maptool.MigrateCommand; -import fr.moribus.imageonmap.commands.maptool.NewCommand; +import fr.moribus.imageonmap.commands.maptool.ExploreCommand; import fr.moribus.imageonmap.commands.maptool.GetCommand; import fr.moribus.imageonmap.commands.maptool.GetRemainingCommand; -import fr.moribus.imageonmap.commands.maptool.GetOtherCommand; -import fr.moribus.imageonmap.commands.maptool.ExploreCommand; +import fr.moribus.imageonmap.commands.maptool.ListCommand; +import fr.moribus.imageonmap.commands.maptool.MigrateCommand; +import fr.moribus.imageonmap.commands.maptool.NewCommand; import fr.moribus.imageonmap.image.ImageIOExecutor; import fr.moribus.imageonmap.image.ImageRendererExecutor; import fr.moribus.imageonmap.image.MapInitEvent; @@ -49,6 +46,7 @@ public final class ImageOnMap extends ZPlugin static private final String IMAGES_DIRECTORY_NAME = "images"; static private final String MAPS_DIRECTORY_NAME = "maps"; static private ImageOnMap plugin; + private File imagesDirectory; private final File mapsDirectory; @@ -71,7 +69,6 @@ public final class ImageOnMap extends ZPlugin return new File(imagesDirectory, "map"+mapID+".png"); } - @SuppressWarnings ("unchecked") @Override public void onEnable() @@ -88,12 +85,11 @@ public final class ImageOnMap extends ZPlugin this.setEnabled(false); return; } - - + saveDefaultConfig(); loadComponents(I18n.class, Gui.class, Commands.class, PluginConfiguration.class, ImageIOExecutor.class, ImageRendererExecutor.class); - + //Init all the things ! MetricsLite.startMetrics(); I18n.setPrimaryLocale(PluginConfiguration.LANG.get()); @@ -107,9 +103,6 @@ public final class ImageOnMap extends ZPlugin NewCommand.class, ListCommand.class, GetCommand.class, - GetOtherCommand.class, - ListOtherCommand.class, - DeleteOtherCommand.class, DeleteCommand.class, GetRemainingCommand.class, ExploreCommand.class, diff --git a/src/main/java/fr/moribus/imageonmap/Permissions.java b/src/main/java/fr/moribus/imageonmap/Permissions.java index ba6c552..abaa110 100644 --- a/src/main/java/fr/moribus/imageonmap/Permissions.java +++ b/src/main/java/fr/moribus/imageonmap/Permissions.java @@ -1,5 +1,5 @@ /* - * Copyright or © or Copr. AmauryCarrade (2015) + * Copyright or © or Copr. AmauryCarrade (2015) * * http://amaury.carrade.eu * @@ -38,12 +38,9 @@ public enum Permissions { NEW("imageonmap.new", "imageonmap.userender"), LIST("imageonmap.list"), - LISTOTHER("imageonmap.listother"), GET("imageonmap.get"), - GETOTHER("imageonmap.getother"), RENAME("imageonmap.rename"), DELETE("imageonmap.delete"), - DELETEOTHER("imageonmap.deleteother"), ADMINISTRATIVE("imageonmap.administrative") ; @@ -75,4 +72,4 @@ public enum Permissions return false; } -} \ No newline at end of file +} diff --git a/src/main/java/fr/moribus/imageonmap/map/ImageMap.java b/src/main/java/fr/moribus/imageonmap/map/ImageMap.java index 4f12ca9..bd71fad 100644 --- a/src/main/java/fr/moribus/imageonmap/map/ImageMap.java +++ b/src/main/java/fr/moribus/imageonmap/map/ImageMap.java @@ -18,7 +18,6 @@ package fr.moribus.imageonmap.map; -import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.ui.MapItemManager; import fr.zcraft.zlib.components.i18n.I; import org.bukkit.Material; @@ -27,7 +26,6 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import java.io.File; import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -49,6 +47,7 @@ public abstract class ImageMap implements ConfigurationSerializable private final UUID userUUID; private final Type mapType; private String name; + protected ImageMap(UUID userUUID, Type mapType) { this(userUUID, mapType, null, null); @@ -85,11 +84,6 @@ public abstract class ImageMap implements ConfigurationSerializable return MapItemManager.give(player, this); } - public static File getFullImageFile(short mapIDstart, short mapIDend) - { - return new File(ImageOnMap.getPlugin().getImagesDirectory(), "_"+mapIDstart+"-"+mapIDend+".png"); - } - /* ====== Serialization methods ====== */ static public ImageMap fromConfig(Map map, UUID userUUID) throws InvalidConfigurationException diff --git a/src/main/java/fr/moribus/imageonmap/map/MapManager.java b/src/main/java/fr/moribus/imageonmap/map/MapManager.java index c4aa7bc..fa58f99 100644 --- a/src/main/java/fr/moribus/imageonmap/map/MapManager.java +++ b/src/main/java/fr/moribus/imageonmap/map/MapManager.java @@ -18,13 +18,12 @@ package fr.moribus.imageonmap.map; +import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.PluginConfiguration; import fr.moribus.imageonmap.image.ImageIOExecutor; import fr.moribus.imageonmap.image.PosterImage; import fr.moribus.imageonmap.map.MapManagerException.Reason; import fr.zcraft.zlib.tools.PluginLogger; -import fr.moribus.imageonmap.ImageOnMap; - import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.inventory.Inventory; diff --git a/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java b/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java index c052165..0c8d531 100644 --- a/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java +++ b/src/main/java/fr/moribus/imageonmap/map/PlayerMapStore.java @@ -18,11 +18,10 @@ package fr.moribus.imageonmap.map; +import fr.moribus.imageonmap.ImageOnMap; import fr.moribus.imageonmap.PluginConfiguration; import fr.moribus.imageonmap.map.MapManagerException.Reason; import fr.zcraft.zlib.tools.PluginLogger; -import fr.moribus.imageonmap.ImageOnMap; - import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.InvalidConfigurationException; diff --git a/src/main/resources/help/maptool.txt b/src/main/resources/help/maptool.txt index b211c1c..8859d51 100644 --- a/src/main/resources/help/maptool.txt +++ b/src/main/resources/help/maptool.txt @@ -3,7 +3,6 @@ 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. -getother: Gets another player's map. getremaining: Gives you the remaining maps that could not fit in your inventory list: Lists all the map you currently have. explore: Opens a GUI to see and manage your maps. From f0889b8cf1fc4122e5350ff3f403a89ae067d56a Mon Sep 17 00:00:00 2001 From: kirbykirby56 Date: Sat, 24 Mar 2018 21:17:44 -0400 Subject: [PATCH 06/25] Add administrative commands --- .../fr/moribus/imageonmap/ImageOnMap.java | 20 +++++++++++++------ .../fr/moribus/imageonmap/Permissions.java | 7 +++++-- src/main/resources/help/maptool.txt | 1 + 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java index f16aa90..d210ee3 100644 --- a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java +++ b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java @@ -19,12 +19,15 @@ package fr.moribus.imageonmap; import fr.moribus.imageonmap.commands.maptool.DeleteCommand; -import fr.moribus.imageonmap.commands.maptool.ExploreCommand; -import fr.moribus.imageonmap.commands.maptool.GetCommand; -import fr.moribus.imageonmap.commands.maptool.GetRemainingCommand; +import fr.moribus.imageonmap.commands.maptool.DeleteOtherCommand; import fr.moribus.imageonmap.commands.maptool.ListCommand; +import fr.moribus.imageonmap.commands.maptool.ListOtherCommand; import fr.moribus.imageonmap.commands.maptool.MigrateCommand; import fr.moribus.imageonmap.commands.maptool.NewCommand; +import fr.moribus.imageonmap.commands.maptool.GetCommand; +import fr.moribus.imageonmap.commands.maptool.GetRemainingCommand; +import fr.moribus.imageonmap.commands.maptool.GetOtherCommand; +import fr.moribus.imageonmap.commands.maptool.ExploreCommand; import fr.moribus.imageonmap.image.ImageIOExecutor; import fr.moribus.imageonmap.image.ImageRendererExecutor; import fr.moribus.imageonmap.image.MapInitEvent; @@ -41,12 +44,12 @@ import fr.zcraft.zlib.tools.PluginLogger; import java.io.File; import java.io.IOException; + public final class ImageOnMap extends ZPlugin { static private final String IMAGES_DIRECTORY_NAME = "images"; static private final String MAPS_DIRECTORY_NAME = "maps"; static private ImageOnMap plugin; - private File imagesDirectory; private final File mapsDirectory; @@ -69,6 +72,7 @@ public final class ImageOnMap extends ZPlugin return new File(imagesDirectory, "map"+mapID+".png"); } + @SuppressWarnings ("unchecked") @Override public void onEnable() @@ -85,11 +89,12 @@ public final class ImageOnMap extends ZPlugin this.setEnabled(false); return; } - + + saveDefaultConfig(); loadComponents(I18n.class, Gui.class, Commands.class, PluginConfiguration.class, ImageIOExecutor.class, ImageRendererExecutor.class); - + //Init all the things ! MetricsLite.startMetrics(); I18n.setPrimaryLocale(PluginConfiguration.LANG.get()); @@ -103,6 +108,9 @@ public final class ImageOnMap extends ZPlugin NewCommand.class, ListCommand.class, GetCommand.class, + GetOtherCommand.class, + ListOtherCommand.class, + DeleteOtherCommand.class, DeleteCommand.class, GetRemainingCommand.class, ExploreCommand.class, diff --git a/src/main/java/fr/moribus/imageonmap/Permissions.java b/src/main/java/fr/moribus/imageonmap/Permissions.java index abaa110..ba6c552 100644 --- a/src/main/java/fr/moribus/imageonmap/Permissions.java +++ b/src/main/java/fr/moribus/imageonmap/Permissions.java @@ -1,5 +1,5 @@ /* - * Copyright or © or Copr. AmauryCarrade (2015) + * Copyright or © or Copr. AmauryCarrade (2015) * * http://amaury.carrade.eu * @@ -38,9 +38,12 @@ public enum Permissions { NEW("imageonmap.new", "imageonmap.userender"), LIST("imageonmap.list"), + LISTOTHER("imageonmap.listother"), GET("imageonmap.get"), + GETOTHER("imageonmap.getother"), RENAME("imageonmap.rename"), DELETE("imageonmap.delete"), + DELETEOTHER("imageonmap.deleteother"), ADMINISTRATIVE("imageonmap.administrative") ; @@ -72,4 +75,4 @@ public enum Permissions return false; } -} +} \ No newline at end of file diff --git a/src/main/resources/help/maptool.txt b/src/main/resources/help/maptool.txt index 8859d51..b211c1c 100644 --- a/src/main/resources/help/maptool.txt +++ b/src/main/resources/help/maptool.txt @@ -3,6 +3,7 @@ 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. +getother: Gets another player's map. getremaining: Gives you the remaining maps that could not fit in your inventory list: Lists all the map you currently have. explore: Opens a GUI to see and manage your maps. From c8955f18828659c5b6362550f7f618ec77287e0c Mon Sep 17 00:00:00 2001 From: Vlammar <36545324+Vlammar@users.noreply.github.com> Date: Tue, 30 Jun 2020 00:59:37 +0200 Subject: [PATCH 07/25] Delete testforwebhook.test useless --- testforwebhook.test | 1 - 1 file changed, 1 deletion(-) delete mode 100644 testforwebhook.test diff --git a/testforwebhook.test b/testforwebhook.test deleted file mode 100644 index 9daeafb..0000000 --- a/testforwebhook.test +++ /dev/null @@ -1 +0,0 @@ -test From 0040beeabfa1c1c100325fa7234658db8ec5bf62 Mon Sep 17 00:00:00 2001 From: Vlammar Date: Thu, 2 Jul 2020 15:27:23 +0200 Subject: [PATCH 08/25] improvement for imgur links --- .../image/ImageRendererExecutor.java | 32 +++++++++++++------ testforwebhook.test | 1 - 2 files changed, 23 insertions(+), 10 deletions(-) delete mode 100644 testforwebhook.test diff --git a/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java b/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java index 3811c8f..7a2be0e 100644 --- a/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java +++ b/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java @@ -68,7 +68,19 @@ public class ImageRendererExecutor extends Worker @Override public ImageMap run() throws Throwable { - final URLConnection connection = url.openConnection(); + URL url2=null; + if(url.toString().contains("https://imgur.com/")){ + if(url.toString().contains("gallery/")){ + throw new IOException("We do not support imgur gallery yet, please use direct link to image instead (right click on the picture you want to use then select copy link:) "); + + } + String newLink="https://i.imgur.com/"+url.toString().split("https://imgur.com/")[1]+".jpg"; + url2=new URL(newLink); + } + + if(url2==null) + url2=url; + final URLConnection connection = url2.openConnection(); connection.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0"); connection.connect(); @@ -76,6 +88,7 @@ public class ImageRendererExecutor extends Worker { final HttpURLConnection httpConnection = (HttpURLConnection) connection; final int httpCode = httpConnection.getResponseCode(); + if ((httpCode / 100) != 2) { throw new IOException(I.t("HTTP error: {0} {1}", httpCode, httpConnection.getResponseMessage())); @@ -83,10 +96,10 @@ public class ImageRendererExecutor extends Worker } final InputStream stream = connection.getInputStream(); + final BufferedImage image = ImageIO.read(stream); if (image == null) throw new IOException(I.t("The given URL is not a valid image")); - // Limits are in place and the player does NOT have rights to avoid them. if ((PluginConfiguration.LIMIT_SIZE_X.get() > 0 || PluginConfiguration.LIMIT_SIZE_Y.get() > 0) && !Permissions.BYPASS_SIZE.grantedTo(Bukkit.getPlayer(playerUUID))) { @@ -102,12 +115,13 @@ public class ImageRendererExecutor extends Worker } } + if (scaling != ImageUtils.ScalingType.NONE && height <= 1 && width <= 1) { return renderSingle(scaling.resize(image, ImageMap.WIDTH, ImageMap.HEIGHT), playerUUID); } - final BufferedImage resizedImage = scaling.resize(image, ImageMap.WIDTH * width, ImageMap.HEIGHT * height); + //image.flush(); return renderPoster(resizedImage, playerUUID); } }, callback); @@ -126,7 +140,7 @@ public class ImageRendererExecutor extends Worker }); final int mapID = futureMapID.get(); - ImageIOExecutor.saveImage(mapID, image); + //ImageIOExecutor.saveImage(mapID, image); submitToMainThread(new Callable() { @@ -134,10 +148,11 @@ public class ImageRendererExecutor extends Worker public Void call() throws Exception { Renderer.installRenderer(image, mapID); + //image.flush(); return null; } }); - + //image.flush(); return MapManager.createMap(playerUUID, mapID); } @@ -145,7 +160,6 @@ public class ImageRendererExecutor extends Worker { final PosterImage poster = new PosterImage(image); final int mapCount = poster.getImagesCount(); - MapManager.checkMapLimit(mapCount, playerUUID); final Future futureMapsIds = submitToMainThread(new Callable() { @@ -155,12 +169,10 @@ public class ImageRendererExecutor extends Worker return MapManager.getNewMapsIds(mapCount); } }); - poster.splitImages(); - final int[] mapsIDs = futureMapsIds.get(); + // ImageIOExecutor.saveImage(mapsIDs, poster); - ImageIOExecutor.saveImage(mapsIDs, poster); if (PluginConfiguration.SAVE_FULL_IMAGE.get()) { @@ -178,6 +190,8 @@ public class ImageRendererExecutor extends Worker }); + // image.flush(); + return MapManager.createMap(poster, playerUUID, mapsIDs); } } diff --git a/testforwebhook.test b/testforwebhook.test deleted file mode 100644 index 9daeafb..0000000 --- a/testforwebhook.test +++ /dev/null @@ -1 +0,0 @@ -test From e894fb4f35807a42686460a9c02a2f53914bf557 Mon Sep 17 00:00:00 2001 From: Vlammar Date: Thu, 2 Jul 2020 16:04:41 +0200 Subject: [PATCH 09/25] Code cleanup, and adding more extensions --- .../image/ImageRendererExecutor.java | 99 ++++++++++++------- 1 file changed, 65 insertions(+), 34 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java b/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java index 7a2be0e..b49f57e 100644 --- a/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java +++ b/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java @@ -61,63 +61,93 @@ import java.util.concurrent.Future; @WorkerAttributes(name = "Image Renderer", queriesMainThread = true) public class ImageRendererExecutor extends Worker { + private static URLConnection connecting(URL url)throws IOException{ + final URLConnection connection = url.openConnection(); + connection.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0"); + connection.connect(); + + if (connection instanceof HttpURLConnection) + { + final HttpURLConnection httpConnection = (HttpURLConnection) connection; + final int httpCode = httpConnection.getResponseCode(); + + if ((httpCode / 100) != 2) + { + throw new IOException(I.t("HTTP error: {0} {1}", httpCode, httpConnection.getResponseMessage())); + } + } + return connection; + } + private enum extension{ + png, jpg, jpeg, gif + } + + static public void render(final URL url, final ImageUtils.ScalingType scaling, final UUID playerUUID, final int width, final int height, WorkerCallback callback) { submitQuery(new WorkerRunnable() { @Override - public ImageMap run() throws Throwable - { - URL url2=null; - if(url.toString().contains("https://imgur.com/")){ - if(url.toString().contains("gallery/")){ - throw new IOException("We do not support imgur gallery yet, please use direct link to image instead (right click on the picture you want to use then select copy link:) "); + public ImageMap run() throws Throwable { + + BufferedImage image=null; + //If the link is an imgur one + if (url.toString().contains("https://imgur.com/")) { + + //Not handled, can't with the hash only access the image in i.imgur.com/. + + + if (url.toString().contains("gallery/")) { + throw new IOException("We do not support imgur gallery yet, please use direct link to image instead. Right click on the picture you want to use then select copy picture link:) "); + } + + for (extension ext : extension.values()) { + String newLink = "https://i.imgur.com/" + url.toString().split("https://imgur.com/")[1] + "." + ext.toString(); + URL url2 = new URL(newLink); + + //Try connecting + URLConnection connection = connecting(url2); + + final InputStream stream = connection.getInputStream(); + + image = ImageIO.read(stream); + + //valid image + if (image != null) break; } - String newLink="https://i.imgur.com/"+url.toString().split("https://imgur.com/")[1]+".jpg"; - url2=new URL(newLink); + + } + //If not an Imgur link + else { + + + //Try connecting + URLConnection connection = connecting(url); + + final InputStream stream = connection.getInputStream(); + + image = ImageIO.read(stream); - if(url2==null) - url2=url; - final URLConnection connection = url2.openConnection(); - connection.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0"); - connection.connect(); - if (connection instanceof HttpURLConnection) - { - final HttpURLConnection httpConnection = (HttpURLConnection) connection; - final int httpCode = httpConnection.getResponseCode(); - if ((httpCode / 100) != 2) - { - throw new IOException(I.t("HTTP error: {0} {1}", httpCode, httpConnection.getResponseMessage())); - } } - - final InputStream stream = connection.getInputStream(); - - final BufferedImage image = ImageIO.read(stream); - if (image == null) throw new IOException(I.t("The given URL is not a valid image")); // Limits are in place and the player does NOT have rights to avoid them. - if ((PluginConfiguration.LIMIT_SIZE_X.get() > 0 || PluginConfiguration.LIMIT_SIZE_Y.get() > 0) && !Permissions.BYPASS_SIZE.grantedTo(Bukkit.getPlayer(playerUUID))) - { - if (PluginConfiguration.LIMIT_SIZE_X.get() > 0) - { + if ((PluginConfiguration.LIMIT_SIZE_X.get() > 0 || PluginConfiguration.LIMIT_SIZE_Y.get() > 0) && !Permissions.BYPASS_SIZE.grantedTo(Bukkit.getPlayer(playerUUID))) { + if (PluginConfiguration.LIMIT_SIZE_X.get() > 0) { if (image.getWidth() > PluginConfiguration.LIMIT_SIZE_X.get()) throw new IOException(I.t("The image is too wide!")); } - if (PluginConfiguration.LIMIT_SIZE_Y.get() > 0) - { + if (PluginConfiguration.LIMIT_SIZE_Y.get() > 0) { if (image.getHeight() > PluginConfiguration.LIMIT_SIZE_Y.get()) throw new IOException(I.t("The image is too tall!")); } } - if (scaling != ImageUtils.ScalingType.NONE && height <= 1 && width <= 1) - { + if (scaling != ImageUtils.ScalingType.NONE && height <= 1 && width <= 1) { return renderSingle(scaling.resize(image, ImageMap.WIDTH, ImageMap.HEIGHT), playerUUID); } final BufferedImage resizedImage = scaling.resize(image, ImageMap.WIDTH * width, ImageMap.HEIGHT * height); @@ -127,6 +157,7 @@ public class ImageRendererExecutor extends Worker }, callback); } + static private ImageMap renderSingle(final BufferedImage image, final UUID playerUUID) throws Throwable { MapManager.checkMapLimit(1, playerUUID); From 13881f751ee1811d3ac4be026975549573f51af9 Mon Sep 17 00:00:00 2001 From: Pugabyte Date: Fri, 3 Jul 2020 16:20:58 -0400 Subject: [PATCH 10/25] Add permission to remove splattermap off wall --- .../fr/moribus/imageonmap/Permissions.java | 1 + .../moribus/imageonmap/ui/MapItemManager.java | 18 +++++++++++------- src/main/resources/plugin.yml | 11 ++++++++--- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/Permissions.java b/src/main/java/fr/moribus/imageonmap/Permissions.java index 6667243..e561eb3 100644 --- a/src/main/java/fr/moribus/imageonmap/Permissions.java +++ b/src/main/java/fr/moribus/imageonmap/Permissions.java @@ -44,6 +44,7 @@ public enum Permissions LIST("imageonmap.list"), GET("imageonmap.get"), RENAME("imageonmap.rename"), + REMOVE_SPLATTER_MAP("imageonmap.removesplattermap"), DELETE("imageonmap.delete"), ADMINISTRATIVE("imageonmap.administrative"), BYPASS_SIZE("imageonmap.bypasssize") diff --git a/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java b/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java index e16aad7..b8e14c5 100644 --- a/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java +++ b/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java @@ -36,6 +36,7 @@ package fr.moribus.imageonmap.ui; +import fr.moribus.imageonmap.Permissions; import fr.moribus.imageonmap.map.ImageMap; import fr.moribus.imageonmap.map.MapManager; import fr.moribus.imageonmap.map.PosterMap; @@ -285,17 +286,20 @@ public class MapItemManager implements Listener ItemStack item = frame.getItem(); if (frame.getItem().getType() != Material.FILLED_MAP) return; - if (player.isSneaking()) + if (Permissions.REMOVE_SPLATTER_MAP.grantedTo(player)) { - PosterMap poster = SplatterMapManager.removeSplatterMap(frame,player); - if (poster != null) + if (player.isSneaking()) { - event.setCancelled(true); + PosterMap poster = SplatterMapManager.removeSplatterMap(frame,player); + if (poster != null) + { + event.setCancelled(true); - if (player.getGameMode() != GameMode.CREATIVE || !SplatterMapManager.hasSplatterMap(player, poster)) - poster.give(player); + if (player.getGameMode() != GameMode.CREATIVE || !SplatterMapManager.hasSplatterMap(player, poster)) + poster.give(player); - return; + return; + } } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index ef82c43..f92a42c 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -23,15 +23,16 @@ permissions: imageonmap.get: true imageonmap.explore: true imageonmap.rename: true + imageonmap.removesplattermap: true imageonmap.delete: true imageonmap.bypasssize: false imageonmap.userender: - description: "Allows you to use /tomap and related commands (/maptool getremaing). Alias of imageonmap.new." + description: "Allows you to use /tomap and related commands (/maptool getremaining). Alias of imageonmap.new." default: true imageonmap.new: - description: "Allows you to use /tomap and related commands (/maptool getremaing)." + description: "Allows you to use /tomap and related commands (/maptool getremaining)." default: true imageonmap.list: @@ -39,7 +40,7 @@ permissions: default: true imageonmap.get: - description: "Allows you to get a new map among the ones you already rendered, and related commands (/maptool getremaing)." + description: "Allows you to get a new map among the ones you already rendered, and related commands (/maptool getremaining)." default: true imageonmap.explore: @@ -54,6 +55,10 @@ permissions: description: "Allows you to delete a map you rendered in the past." default: true + imageonmap.removesplattermap: + description: "Allows you to remove a splatter map from a wall by sneaking and breaking a map." + default: true + imageonmap.administrative: description: "Allows you to perform administrative tasks (like /maptool migrate)." default: op From b8c1494f584340c0f226dcd03d53117298899db7 Mon Sep 17 00:00:00 2001 From: Griffin Kubesa Date: Wed, 8 Jul 2020 18:13:18 -0400 Subject: [PATCH 11/25] Fix saving images (#112) --- .../imageonmap/image/ImageRendererExecutor.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java b/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java index b49f57e..0ed4908 100644 --- a/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java +++ b/src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java @@ -151,7 +151,7 @@ public class ImageRendererExecutor extends Worker return renderSingle(scaling.resize(image, ImageMap.WIDTH, ImageMap.HEIGHT), playerUUID); } final BufferedImage resizedImage = scaling.resize(image, ImageMap.WIDTH * width, ImageMap.HEIGHT * height); - //image.flush(); + image.flush(); return renderPoster(resizedImage, playerUUID); } }, callback); @@ -171,7 +171,7 @@ public class ImageRendererExecutor extends Worker }); final int mapID = futureMapID.get(); - //ImageIOExecutor.saveImage(mapID, image); + ImageIOExecutor.saveImage(mapID, image); submitToMainThread(new Callable() { @@ -179,11 +179,11 @@ public class ImageRendererExecutor extends Worker public Void call() throws Exception { Renderer.installRenderer(image, mapID); - //image.flush(); + image.flush(); return null; } }); - //image.flush(); + image.flush(); return MapManager.createMap(playerUUID, mapID); } @@ -202,7 +202,7 @@ public class ImageRendererExecutor extends Worker }); poster.splitImages(); final int[] mapsIDs = futureMapsIds.get(); - // ImageIOExecutor.saveImage(mapsIDs, poster); + ImageIOExecutor.saveImage(mapsIDs, poster); if (PluginConfiguration.SAVE_FULL_IMAGE.get()) @@ -221,7 +221,7 @@ public class ImageRendererExecutor extends Worker }); - // image.flush(); + image.flush(); return MapManager.createMap(poster, playerUUID, mapsIDs); } From 71d620b83d9ac8e57110ffa19a35115ea4f6707d Mon Sep 17 00:00:00 2001 From: Vlammar Date: Thu, 23 Jul 2020 15:01:55 +0200 Subject: [PATCH 12/25] Added chinese, thanks to Souir_Tommer --- src/main/resources/config.yml | 2 +- src/main/resources/i18n/zh_CN.po | 595 +++++++++++++++++++++++++++++++ 2 files changed, 596 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/i18n/zh_CN.po diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 7d84e64..e938e6d 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -2,7 +2,7 @@ # Plugin language. Empty: system language. -# Available: en-US (default, fallback), fr-FR, ru-RU, de-DE. +# Available: en-US (default, fallback), fr-FR, ru-RU, de-DE, zh-CN. lang: diff --git a/src/main/resources/i18n/zh_CN.po b/src/main/resources/i18n/zh_CN.po new file mode 100644 index 0000000..0bf8933 --- /dev/null +++ b/src/main/resources/i18n/zh_CN.po @@ -0,0 +1,595 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-10 03:07+0200\n" +"PO-Revision-Date: 2016-07-10 03:08+0200\n" +"Last-Translator: Souir_Tommer\n" +"Language-Team: \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n < 1 || n > 1);\n" +"X-Generator: Poedit 1.8.7.1\n" + +#: src/main/java/fr/moribus/imageonmap/commands/IoMCommand.java:40 +msgid "You need to give a map name." +msgstr "你需è¦æä¾›å称" + +#: src/main/java/fr/moribus/imageonmap/commands/IoMCommand.java:57 +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteNoConfirmCommand.java:51 +msgid "This map does not exist." +msgstr "该地图ä¸å­˜åœ¨" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java:39 +msgid "You are going to delete" +msgstr "ä½ å°†è¦åˆ é™¤" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java:42 +msgid "Are you sure ? " +msgstr "你确定å—? " + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java:44 +msgid "[Confirm]" +msgstr "[确定]" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java:46 +msgid "{red}This map will be deleted {bold}forever{red}!" +msgstr "{red}这个地图将会永久 {bold}删除{red}!" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteNoConfirmCommand.java:46 +msgid "Map successfully deleted." +msgstr "地图已æˆåŠŸåˆ é™¤" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/GetCommand.java:38 +msgid "The requested map was too big to fit in your inventory." +msgstr "请求的地图太大,无法容纳到您的背包中" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/GetCommand.java:39 +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:71 +msgid "Use '/maptool getremaining' to get the remaining maps." +msgstr "Use '/maptool getremaining' to get the remaining maps." + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/GetRemainingCommand.java:38 +msgid "You have no remaining map." +msgstr "你没有剩余的地图" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/GetRemainingCommand.java:46 +msgid "" +"Your inventory is full! Make some space before requesting the remaining maps." +msgstr "" +"你的背包已满!" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/GetRemainingCommand.java:50 +#, java-format +msgid "There is {0} map remaining." +msgid_plural "There are {0} maps remaining." +msgstr[0] "剩余 {0} 张地图" +msgstr[1] "剩余 {0} 张地图" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/ListCommand.java:49 +msgid "No map found." +msgstr "找ä¸åˆ°åœ°å›¾" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/ListCommand.java:53 +msgid "{white}{bold}{0} map found." +msgid_plural "{white}{bold}{0} maps found." +msgstr[0] "{white}{bold}{0} 地图" +msgstr[1] "{white}{bold}{0} 地图" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/ListCommand.java:79 +msgid "{white}Click{gray} to get this map" +msgstr "{white}点击{gray} 得到这张地图" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/MigrateCommand.java:36 +msgid "A migration process is already running. Check console for details." +msgstr "进程已在è¿è¡Œ..请等待" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/MigrateCommand.java:40 +msgid "Migration started. See console for details." +msgstr "开始..." + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:44 +msgid "You must give an URL to take the image from." +msgstr "您必须æä¾›URLæ‰èƒ½ä»Žä¸­èŽ·å–图åƒ" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:52 +msgid "Invalid URL." +msgstr "无效的网å€" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:61 +msgid "Rendering..." +msgstr "渲染..." + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:67 +msgid "Rendering finished!" +msgstr "渲染完æˆï¼" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:70 +msgid "The rendered map was too big to fit in your inventory." +msgstr "渲染的地图太大" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:78 +msgid "{ce}Map rendering failed: {0}" +msgstr "{ce}地图渲染失败: {0}" + +#. The title of the map deletion GUI. {0}: map name. +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:102 +msgid "{0} » {black}Confirm deletion" +msgstr "{0} » {black}确认删除" + +#. The title of the map deletion item +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:110 +msgid "{red}You're about to destroy this map..." +msgstr "{red}您将è¦é”€æ¯è¿™å¼ åœ°å›¾..." + +#. The end, in the lore, of a title starting with “You're about to destroy this map...â€. +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:112 +msgid "{red}...{italic}forever{red}." +msgstr "{red}...{italic}永久{red}." + +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:114 +msgid "{gray}Name: {white}{0}" +msgstr "{gray}å称: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:115 +msgid "{gray}Map ID: {white}{0}" +msgstr "{gray}地图 ID: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:116 +msgid "{gray}Maps inside: {white}{0}" +msgstr "{gray}地图: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:178 +msgid "{gray}Map successfully deleted." +msgstr "{gray}地图已æˆåŠŸåˆ é™¤" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:54 +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:71 +msgid "{green}Map part" +msgstr "{green}地图部分" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:55 +msgid "{gray}Column: {white}{0}" +msgstr "{gray}高: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:56 +msgid "{gray}Row: {white}{0}" +msgstr "{gray}宽: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:58 +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:74 +msgid "{gray}» {white}Click{gray} to get only this part" +msgstr "{gray}» {white}点击{gray} 得到这部分" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:72 +msgid "{gray}Part: {white}{0}" +msgstr "{gray}部分: {white}{0}" + +#. Title of the map details GUI +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:114 +msgid "Your maps » {black}{0}" +msgstr "你的地图 » {black}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:136 +msgid "{blue}Rename this image" +msgstr "{blue}é‡å‘½å这张图片" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:137 +msgid "" +"{gray}Click here to rename this image; this is used for your own " +"organization." +msgstr "" +"{gray}点击此处é‡å‘½å该图åƒ; è¿™åªå¯¹è‡ªå·±ç”Ÿæ•ˆ" +"" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:141 +msgid "{red}Delete this image" +msgstr "{red}删除这张图片" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:142 +msgid "" +"{gray}Deletes this map {white}forever{gray}. This action cannot be undone!" +msgstr "" +"{white}永久{gray} {gray}删除这张地图,æ­¤æ“作无法撤消!" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:144 +msgid "{gray}You will be asked to confirm your choice if you click here." +msgstr "{gray}You will be asked to confirm your choice if you click here." + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:156 +msgid "{green}« Back" +msgstr "{green}« 返回" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:157 +msgid "{gray}Go back to the list." +msgstr "{gray}返回到列表" + +#. Displayed subtitle description of a single map on the list GUI +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:44 +msgid "{white}Single map" +msgstr "{white}å•å¼ åœ°å›¾" + +#. Displayed subtitle description of a poster map on the list GUI (columns × rows in english) +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:52 +msgid "{white}Poster map ({0} × {1})" +msgstr "{white}åœ°å›¾å¤§å° ({0} × {1})" + +#. Displayed subtitle description of a poster map without column data on the list GUI +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:57 +msgid "{white}Poster map ({0} parts)" +msgstr "{white}åœ°å›¾å¤§å° ({0} 部分)" + +#. Displayed title of a map on the list GUI +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:62 +msgid "{green}{bold}{0}" +msgstr "{green}{bold}{0}" + +#. Map ID displayed in the tooltip of a map on the list GUI +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:67 +msgid "{gray}Map ID: {0}" +msgstr "{gray}地图 ID: {0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:69 +msgid "{gray}» {white}Left-click{gray} to get this map" +msgstr "{gray}» {white}左击{gray} 获得地图" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:70 +msgid "{gray}» {white}Right-click{gray} for details and options" +msgstr "{gray}» {white}å³å‡»{gray} 打开更多设置" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:79 +msgid "{red}You don't have any map." +msgstr "{red}你还没有任何地图" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:80 +msgid "" +"{gray}Get started by creating a new one using {white}/tomap [resize]" +"{gray}!" +msgstr "" +"{gray}ä½¿ç”¨æŒ‡ä»¤åˆ›å»ºåœ°å›¾å§ {white}/tomap [resize]" +"{gray}!" + +#. The maps list GUI title +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:119 +msgid "{black}Your maps {reset}({0})" +msgstr "{black}你的地图 {reset}({0})" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:148 +msgid "{blue}Usage statistics" +msgstr "{blue}使用状æ€" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:150 +msgid "{white}{0}{gray} image rendered" +msgid_plural "{white}{0}{gray} images rendered" +msgstr[0] "{white}{0}{gray} 渲染地图" +msgstr[1] "{white}{0}{gray} 渲染地图" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:151 +msgid "{white}{0}{gray} Minecraft map used" +msgid_plural "{white}{0}{gray} Minecraft maps used" +msgstr[0] "{white}{0}{gray} 张地图用é‡" +msgstr[1] "{white}{0}{gray} 张地图用é‡" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:156 +msgid "{blue}Minecraft maps limits" +msgstr "{blue}minecraft地图é™åˆ¶" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:158 +msgid "{gray}Server-wide limit: {white}unlimited" +msgstr "{gray}Server-wide limit: {white}unlimited" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:159 +msgid "{gray}Server-wide limit: {white}{0}" +msgstr "{gray}Server-wide limit: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:161 +msgid "{gray}Per-player limit: {white}unlimited" +msgstr "{gray}Per-player limit: {white}unlimited" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:162 +msgid "{gray}Per-player limit: {white}{0}" +msgstr "{gray}Per-player limit: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:164 +msgid "{white}{0} %{gray} of your quota used" +msgstr "{white}{0} %{gray} of your quota used" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:165 +msgid "{white}{0}{gray} map left" +msgid_plural "{white}{0}{gray} maps left" +msgstr[0] "{white}{0}{gray} map left" +msgstr[1] "{white}{0}{gray} maps left" + +#: src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java:73 +#, java-format +msgid "HTTP error : {0} {1}" +msgstr "HTTP error : {0} {1}" + +#: src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java:79 +msgid "The given URL is not a valid image" +msgstr "指定的网å€ä¸æ˜¯æœ‰æ•ˆçš„图片" + +#. The default display name of a map +#: src/main/java/fr/moribus/imageonmap/map/ImageMap.java:44 +msgid "Map" +msgstr "地图" + +#: src/main/java/fr/moribus/imageonmap/map/MapManagerException.java:29 +#, java-format +msgid "You have too many maps (maximum : {0})." +msgstr "You have too many maps (maximum : {0})." + +#: src/main/java/fr/moribus/imageonmap/map/MapManagerException.java:30 +msgid "The server ImageOnMap limit has been reached." +msgstr "The server ImageOnMap limit has been reached." + +#: src/main/java/fr/moribus/imageonmap/map/MapManagerException.java:31 +msgid "The given map does not exist." +msgstr "地图ä¸å­˜åœ¨." + +#: src/main/java/fr/moribus/imageonmap/migration/MigratorExecutor.java:34 +msgid "Migration is already running." +msgstr "è¿ç§»å·²åœ¨è¿è¡Œ" + +#: src/main/java/fr/moribus/imageonmap/migration/MigratorExecutor.java:50 +msgid "Waiting for migration to finish..." +msgstr "等待è¿ç§»å®Œæˆ..." + +#: src/main/java/fr/moribus/imageonmap/migration/MigratorExecutor.java:58 +msgid "" +"Migration thread has been interrupted while waiting to finish. It may not " +"have ended correctly." +msgstr "" +"Migration thread has been interrupted while waiting to finish. It may not " +"have ended correctly." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:176 +msgid "Error while preparing migration" +msgstr "Error while preparing migration" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:177 +msgid "Aborting migration. No change has been made." +msgstr "Aborting migration. No change has been made." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:189 +msgid "Error while migrating" +msgstr "Error while migrating" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:190 +msgid "Aborting migration. Some changes may already have been made." +msgstr "Aborting migration. Some changes may already have been made." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:191 +msgid "" +"Before trying to migrate again, you must recover player files from the " +"backups, and then move the backups away from the plugin directory to avoid " +"overwriting them." +msgstr "" +"Before trying to migrate again, you must recover player files from the " +"backups, and then move the backups away from the plugin directory to avoid " +"overwriting them." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:203 +msgid "Looking for configuration files to migrate..." +msgstr "Looking for configuration files to migrate..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:206 +#, java-format +msgid "Detected former posters file {0}" +msgstr "Detected former posters file {0}" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:209 +#, java-format +msgid "Detected former maps file {0}" +msgstr "Detected former maps file {0}" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:213 +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:416 +msgid "There is nothing to migrate. Stopping." +msgstr "There is nothing to migrate. Stopping." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:218 +msgid "Done." +msgstr "Done." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:232 +msgid "Backup directories already exists." +msgstr "Backup directories already exists." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:233 +msgid "" +"This means that a migration has already been done, or may not have ended " +"well." +msgstr "" +"This means that a migration has already been done, or may not have ended " +"well." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:234 +msgid "" +"To start a new migration, you must move away the backup directories so they " +"are not overwritten." +msgstr "" +"To start a new migration, you must move away the backup directories so they " +"are not overwritten." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:247 +msgid "Backing up map data before migrating..." +msgstr "Backing up map data before migrating..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:271 +msgid "Backup complete." +msgstr "Backup complete." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:352 +msgid "Fetching UUIDs from Mojang..." +msgstr "Fetching UUIDs from Mojang..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:359 +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:387 +msgid "An error occurred while fetching the UUIDs from Mojang" +msgstr "An error occurred while fetching the UUIDs from Mojang" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:364 +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:392 +msgid "The migration worker has been interrupted" +msgstr "The migration worker has been interrupted" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:367 +#, java-format +msgid "Fetching done. {0} UUID have been retrieved." +msgid_plural "Fetching done. {0} UUIDs have been retrieved." +msgstr[0] "Fetching done. {0} UUID have been retrieved." +msgstr[1] "Fetching done. {0} UUIDs have been retrieved." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:378 +#, java-format +msgid "Mojang did not find UUIDs for {0} player at the current time." +msgid_plural "Mojang did not find UUIDs for {0} players at the current time." +msgstr[0] "Mojang did not find UUIDs for {0} player at the current time." +msgstr[1] "Mojang did not find UUIDs for {0} players at the current time." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:379 +msgid "" +"The Mojang servers limit requests rate at one per second, this may take some " +"time..." +msgstr "" +"The Mojang servers limit requests rate at one per second, this may take some " +"time..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:398 +#, java-format +msgid "Mojang did not find player data for {0} player" +msgid_plural "Mojang did not find player data for {0} players" +msgstr[0] "Mojang did not find player data for {0} player" +msgstr[1] "Mojang did not find player data for {0} players" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:400 +msgid "The following players do not exist or do not have paid accounts :" +msgstr "The following players do not exist or do not have paid accounts :" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:415 +msgid "Mojang could not find any of the registered players." +msgstr "Mojang could not find any of the registered players." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:425 +msgid "Merging map data..." +msgstr "Merging map data..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:475 +#, java-format +msgid "{0} registered minecraft map is missing from the save." +msgid_plural "{0} registered minecraft maps are missing from the save." +msgstr[0] "{0} registered minecraft map is missing from the save." +msgstr[1] "{0} registered minecraft maps are missing from the save." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:476 +msgid "" +"These maps will not be migrated, but this could mean the save has been " +"altered or corrupted." +msgstr "" +"These maps will not be migrated, but this could mean the save has been " +"altered or corrupted." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:477 +#, java-format +msgid "The following maps are missing : {0} " +msgstr "The following maps are missing : {0} " + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:483 +msgid "Saving changes..." +msgstr "Saving changes..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:489 +msgid "Cleaning up old data files..." +msgstr "Cleaning up old data files..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:496 +msgid "Deleting old map data file..." +msgstr "Deleting old map data file..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:501 +#, java-format +msgid "{0} map could not be migrated." +msgid_plural "{0} maps could not be migrated." +msgstr[0] "{0} map could not be migrated." +msgstr[1] "{0} maps could not be migrated." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:519 +msgid "Deleting old poster data file..." +msgstr "Deleting old poster data file..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:524 +#, java-format +msgid "{0} poster could not be migrated." +msgid_plural "{0} posters could not be migrated." +msgstr[0] "{0} poster could not be migrated." +msgstr[1] "{0} posters could not be migrated." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:537 +msgid "Data that has not been migrated will be kept in the old data files." +msgstr "Data that has not been migrated will be kept in the old data files." + +#. The name of a map item given to a player, if splatter maps are not used. 0 = map name; 1 = index. +#: src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java:139 +#: src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java:215 +#, java-format +msgid "{0} (part {1})" +msgstr "{0} (部分 {1})" + +#. The name of a map item given to a player, if splatter maps are not used. 0 = map name; 1 = row; 2 = column. +#: src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java:145 +#: src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java:213 +#, java-format +msgid "{0} (row {1}, column {2})" +msgstr "{0} (宽 {1}, 高 {2})" + +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:44 +msgid "Splatter Map" +msgstr "扩散地图" + +#. Title in a splatter map tooltip +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:48 +msgid "Item frames needed" +msgstr "展示框空间所需" + +#. Size of a map stored in a splatter map +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:56 +#, java-format +msgid "{0} × {1}" +msgstr "宽: {0} × 高: {1}" + +#. Size of a map stored in a splatter map, including the total frames count +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:62 +#, java-format +msgid "{0} × {1} (total {2} frames)" +msgstr "宽: {0} × 高: {1} (å…±éœ€è¦ {2} 展示框)" + +#. Title in a splatter map tooltip +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:53 +msgid "How to use this?" +msgstr "如何使用?" + +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:54 +msgid "" +"Place empty item frames on a wall, enough to host the whole map. Then, right-" +"click on the bottom-left frame with this map." +msgstr "" +"把一样宽高的展示框全部放在墙上,然åŽæ‰‹æŒæ­¤åœ°å›¾å³é”®å·¦ä¸‹è§’çš„" +"展示框å³å¯" + +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:56 +msgid "" +"Shift-click one of the placed maps to remove the whole poster in one shot." +msgstr "" +"潜行攻击放置的地图,å³å¯æ”¶å›žæ•´å¼ åœ°å›¾" + +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:101 +msgid "{ce}There is not enough space to place this map ({0} × {1})." +msgstr "{ce}这里没有足够的空间 (宽: {0} × 高: {1})" From 5be7aa2b11b49183117ca6d7d10a0436b6d5d674 Mon Sep 17 00:00:00 2001 From: Kotlia Date: Tue, 28 Jul 2020 10:02:14 -0400 Subject: [PATCH 13/25] Add Japanese --- src/main/resources/i18n/jp_JP.po | 594 +++++++++++++++++++++++++++++++ 1 file changed, 594 insertions(+) create mode 100644 src/main/resources/i18n/jp_JP.po diff --git a/src/main/resources/i18n/jp_JP.po b/src/main/resources/i18n/jp_JP.po new file mode 100644 index 0000000..0d3291d --- /dev/null +++ b/src/main/resources/i18n/jp_JP.po @@ -0,0 +1,594 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-07-27 03:07+0200\n" +"PO-Revision-Date: 2016-07-27 03:08+0200\n" +"Last-Translator: Kotlia\n" +"Language-Team: \n" +"Language: ja_JA\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n < 1 || n > 1);\n" +"X-Generator: Poedit 1.8.7.1\n" + +#: src/main/java/fr/moribus/imageonmap/commands/IoMCommand.java:40 +msgid "You need to give a map name." +msgstr "マップåãŒå¿…è¦ã§ã™ï¼" + +#: src/main/java/fr/moribus/imageonmap/commands/IoMCommand.java:57 +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteNoConfirmCommand.java:51 +msgid "This map does not exist." +msgstr "ã“ã®ãƒžãƒƒãƒ—ã¯å­˜åœ¨ã—ã¾ã›ã‚“" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java:39 +msgid "You are going to delete" +msgstr "ã“れを削除ã—ã¾ã™" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java:42 +msgid "Are you sure ? " +msgstr "大丈夫ã§ã™ã‹ï¼Ÿ" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java:44 +msgid "[Confirm]" +msgstr "[確定]" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteConfirmCommand.java:46 +msgid "{red}This map will be deleted {bold}forever{red}!" +msgstr "{red}ã“ã®ãƒžãƒƒãƒ—㯠{bold}復元ä¸å¯èƒ½ã«ãªã‚Šã¾ã™{red}!" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteNoConfirmCommand.java:46 +msgid "Map successfully deleted." +msgstr "削除ã«æˆåŠŸã—ã¾ã—ãŸ" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/GetCommand.java:38 +msgid "The requested map was too big to fit in your inventory." +msgstr "マップã®ã‚µã‚¤ã‚ºãŒã‚¤ãƒ³ãƒ™ãƒ³ãƒˆãƒªã«å¯¾ã—ã¦å¤§ãã™ãŽã¾ã™" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/GetCommand.java:39 +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:71 +msgid "Use '/maptool getremaining' to get the remaining maps." +msgstr "残りã®ãƒžãƒƒãƒ—ã‚’å–å¾—ã™ã‚‹ã«ã¯ '/maptool getremaining' を実行ã—ã¦ä¸‹ã•ã„。" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/GetRemainingCommand.java:38 +msgid "You have no remaining map." +msgstr "残りã®ãƒžãƒƒãƒ—ã¯å­˜åœ¨ã—ã¾ã›ã‚“" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/GetRemainingCommand.java:46 +msgid "" +"Your inventory is full! Make some space before requesting the remaining maps." +msgstr "" +"インベントリãŒä¸€æ¯ã§ã™ï¼" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/GetRemainingCommand.java:50 +#, java-format +msgid "There is {0} map remaining." +msgid_plural "There are {0} maps remaining." +msgstr[0] "残り {0} æžšã®ãƒžãƒƒãƒ—ãŒæ®‹ã£ã¦ã„ã¾ã™" +msgstr[1] "残り {0} æžšã®ãƒžãƒƒãƒ—ãŒæ®‹ã£ã¦ã„ã¾ã™" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/ListCommand.java:49 +msgid "No map found." +msgstr "マップãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸ" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/ListCommand.java:53 +msgid "{white}{bold}{0} map found." +msgid_plural "{white}{bold}{0} maps found." +msgstr[0] "{white}{bold}{0} æžšã®ãƒžãƒƒãƒ—を発見ã—ã¾ã—ãŸ" +msgstr[1] "{white}{bold}{0} æžšã®ãƒžãƒƒãƒ—を発見ã—ã¾ã—ãŸ" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/ListCommand.java:79 +msgid "{white}Click{gray} to get this map" +msgstr "{gray}マップをå–å¾—ã™ã‚‹ã«ã¯{white}ã“ã“をクリック" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/MigrateCommand.java:36 +msgid "A migration process is already running. Check console for details." +msgstr "移行中...コンソールã§è©³ç´°ã‚’確èªã§ãã¾ã™" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/MigrateCommand.java:40 +msgid "Migration started. See console for details." +msgstr "移行開始...コンソールã§è©³ç´°ã‚’確èªã§ãã¾ã™" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:44 +msgid "You must give an URL to take the image from." +msgstr "ç”»åƒURLãŒå¿…è¦ã§ã™ï¼" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:52 +msgid "Invalid URL." +msgstr "無効ãªURLã§ã™" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:61 +msgid "Rendering..." +msgstr "レンダリング中..." + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:67 +msgid "Rendering finished!" +msgstr "レンダリング完了ï¼" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:70 +msgid "The rendered map was too big to fit in your inventory." +msgstr "レンダリングã•ã‚ŒãŸãƒžãƒƒãƒ—ã¯ã‚¤ãƒ³ãƒ™ãƒ³ãƒˆãƒªã«å¯¾ã—ã¦å¤§ãã™ãŽã¾ã™ï¼" + +#: src/main/java/fr/moribus/imageonmap/commands/maptool/NewCommand.java:78 +msgid "{ce}Map rendering failed: {0}" +msgstr "{ce}レンダリング失敗: {0}" + +#. The title of the map deletion GUI. {0}: map name. +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:102 +msgid "{0} » {black}Confirm deletion" +msgstr "{0} » {black}削除確èª" + +#. The title of the map deletion item +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:110 +msgid "{red}You're about to destroy this map..." +msgstr "{red}ã“ã®ãƒžãƒƒãƒ—を破壊ã—よã†ã¨ã—ã¦ã„ã¾ã™..." + +#. The end, in the lore, of a title starting with “You're about to destroy this map...â€. +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:112 +msgid "{red}...{italic}forever{red}." +msgstr "{red}...{italic}æ°¸é {red}." + +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:114 +msgid "{gray}Name: {white}{0}" +msgstr "{gray}åå‰: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:115 +msgid "{gray}Map ID: {white}{0}" +msgstr "{gray}マップ ID: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:116 +msgid "{gray}Maps inside: {white}{0}" +msgstr "{gray}マップ: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java:178 +msgid "{gray}Map successfully deleted." +msgstr "{gray}マップã®å‰Šé™¤ã«æˆåŠŸã—ã¾ã—ãŸ" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:54 +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:71 +msgid "{green}Map part" +msgstr "{green}マップ部分" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:55 +msgid "{gray}Column: {white}{0}" +msgstr "{gray}縦: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:56 +msgid "{gray}Row: {white}{0}" +msgstr "{gray}横: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:58 +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:74 +msgid "{gray}» {white}Click{gray} to get only this part" +msgstr "{gray}» {gray} ã“ã“ã ã‘を入手ã™ã‚‹ã«ã¯ {white}クリック" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:72 +msgid "{gray}Part: {white}{0}" +msgstr "{gray}部分: {white}{0}" + +#. Title of the map details GUI +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:114 +msgid "Your maps » {black}{0}" +msgstr "ã‚ãªãŸã®ãƒžãƒƒãƒ— » {black}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:136 +msgid "{blue}Rename this image" +msgstr "{blue}ã“ã®ã‚¤ãƒ¡ãƒ¼ã‚¸ã®åå‰ã‚’変更" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:137 +msgid "" +"{gray}Click here to rename this image; this is used for your own " +"organization." +msgstr "" +"{gray}ã“ã®ã‚¤ãƒ¡ãƒ¼ã‚¸ã®åå‰ã‚’変更...自分ã®ã¿ã«å映ã•ã‚Œã¾ã™" +"" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:141 +msgid "{red}Delete this image" +msgstr "{red}ã“ã®å†™çœŸã‚’削除" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:142 +msgid "" +"{gray}Deletes this map {white}forever{gray}. This action cannot be undone!" +msgstr "" +"{white}削除・永久{gray} {gray}ã«å¾©æ—§å‡ºæ¥ã¾ã›ã‚“。" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:144 +msgid "{gray}You will be asked to confirm your choice if you click here." +msgstr "{gray}You will be asked to confirm your choice if you click here." + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:156 +msgid "{green}« Back" +msgstr "{green}« 戻る" + +#: src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java:157 +msgid "{gray}Go back to the list." +msgstr "{gray}表ã«æˆ»ã‚‹" + +#. Displayed subtitle description of a single map on the list GUI +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:44 +msgid "{white}Single map" +msgstr "{white}一ã¤ã®ãƒžãƒƒãƒ—" + +#. Displayed subtitle description of a poster map on the list GUI (columns × rows in english) +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:52 +msgid "{white}Poster map ({0} × {1})" +msgstr "{white}ãƒã‚¹ã‚¿ãƒ¼ãƒžãƒƒãƒ— ({0} × {1})" + +#. Displayed subtitle description of a poster map without column data on the list GUI +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:57 +msgid "{white}Poster map ({0} parts)" +msgstr "{white}ãƒã‚¹ã‚¿ãƒ¼ãƒžãƒƒãƒ— ({0} 部分)" + +#. Displayed title of a map on the list GUI +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:62 +msgid "{green}{bold}{0}" +msgstr "{green}{bold}{0}" + +#. Map ID displayed in the tooltip of a map on the list GUI +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:67 +msgid "{gray}Map ID: {0}" +msgstr "{gray}マップ ID: {0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:69 +msgid "{gray}» {white}Left-click{gray} to get this map" +msgstr "{gray}» {white}左クリック{gray} ã§ã“ã®ãƒžãƒƒãƒ—を入手" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:70 +msgid "{gray}» {white}Right-click{gray} for details and options" +msgstr "{gray}» {white}å³ã‚¯ãƒªãƒƒã‚¯{gray} ã§è©³ç´°ã‚’表示" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:79 +msgid "{red}You don't have any map." +msgstr "{red}ã‚ãªãŸã¯ãƒžãƒƒãƒ—ã‚’æŒã£ã¦ã„ã¾ã›ã‚“ï¼" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:80 +msgid "" +"{gray}Get started by creating a new one using {white}/tomap [resize]" +"{gray}!" +msgstr "" +"{gray}ã¾ãšã¯ä½œã£ã¦ã¿ã¾ã—ょã†ï¼ã‚³ãƒžãƒ³ãƒ‰ï¼š {white}/tomap [resize]" +"{gray}!" + +#. The maps list GUI title +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:119 +msgid "{black}Your maps {reset}({0})" +msgstr "{black}ã‚ãªãŸã®ãƒžãƒƒãƒ— {reset}({0})" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:148 +msgid "{blue}Usage statistics" +msgstr "{blue}ã‚ãªãŸã®çµ±è¨ˆæƒ…å ±" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:150 +msgid "{white}{0}{gray} image rendered" +msgid_plural "{white}{0}{gray} images rendered" +msgstr[0] "{white}{0}{gray} ç”»åƒãƒ¬ãƒ³ãƒ€ãƒªãƒ³ã‚°å®Œäº†" +msgstr[1] "{white}{0}{gray} ç”»åƒãƒ¬ãƒ³ãƒ€ãƒªãƒ³ã‚°å®Œäº†" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:151 +msgid "{white}{0}{gray} Minecraft map used" +msgid_plural "{white}{0}{gray} Minecraft maps used" +msgstr[0] "{white}{0}{gray} 使用ã—ãŸãƒžãƒƒãƒ—" +msgstr[1] "{white}{0}{gray} 使用ã—ãŸãƒžãƒƒãƒ—" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:156 +msgid "{blue}Minecraft maps limits" +msgstr "{blue}minecraftマップリミット" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:158 +msgid "{gray}Server-wide limit: {white}unlimited" +msgstr "{gray}Server-wide limit: {white}unlimited" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:159 +msgid "{gray}Server-wide limit: {white}{0}" +msgstr "{gray}Server-wide limit: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:161 +msgid "{gray}Per-player limit: {white}unlimited" +msgstr "{gray}Per-player limit: {white}unlimited" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:162 +msgid "{gray}Per-player limit: {white}{0}" +msgstr "{gray}Per-player limit: {white}{0}" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:164 +msgid "{white}{0} %{gray} of your quota used" +msgstr "{white}{0} %{gray} of your quota used" + +#: src/main/java/fr/moribus/imageonmap/gui/MapListGui.java:165 +msgid "{white}{0}{gray} map left" +msgid_plural "{white}{0}{gray} maps left" +msgstr[0] "{white}{0}{gray} map left" +msgstr[1] "{white}{0}{gray} maps left" + +#: src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java:73 +#, java-format +msgid "HTTP error : {0} {1}" +msgstr "HTTP error : {0} {1}" + +#: src/main/java/fr/moribus/imageonmap/image/ImageRendererExecutor.java:79 +msgid "The given URL is not a valid image" +msgstr "ã“ã‚Œã¯æœ‰åŠ¹ãªç”»åƒURLã§ã¯ã‚ã‚Šã¾ã›ã‚“ï¼" + +#. The default display name of a map +#: src/main/java/fr/moribus/imageonmap/map/ImageMap.java:44 +msgid "Map" +msgstr "マップ" + +#: src/main/java/fr/moribus/imageonmap/map/MapManagerException.java:29 +#, java-format +msgid "You have too many maps (maximum : {0})." +msgstr "ä¿æœ‰ã™ã‚‹ãƒžãƒƒãƒ—ãŒå¤šã™ãŽã¾ã™ï¼ (maximum : {0})." + +#: src/main/java/fr/moribus/imageonmap/map/MapManagerException.java:30 +msgid "The server ImageOnMap limit has been reached." +msgstr "The server ImageOnMap limit has been reached." + +#: src/main/java/fr/moribus/imageonmap/map/MapManagerException.java:31 +msgid "The given map does not exist." +msgstr "マップãŒå­˜åœ¨ã—ã¾ã›ã‚“." + +#: src/main/java/fr/moribus/imageonmap/migration/MigratorExecutor.java:34 +msgid "Migration is already running." +msgstr "移行ã¯å®Ÿè¡Œä¸­ã§ã™" + +#: src/main/java/fr/moribus/imageonmap/migration/MigratorExecutor.java:50 +msgid "Waiting for migration to finish..." +msgstr "移行終了待ã¡..." + +#: src/main/java/fr/moribus/imageonmap/migration/MigratorExecutor.java:58 +msgid "" +"Migration thread has been interrupted while waiting to finish. It may not " +"have ended correctly." +msgstr "" +"Migration thread has been interrupted while waiting to finish. It may not " +"have ended correctly." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:176 +msgid "Error while preparing migration" +msgstr "Error while preparing migration" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:177 +msgid "Aborting migration. No change has been made." +msgstr "Aborting migration. No change has been made." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:189 +msgid "Error while migrating" +msgstr "Error while migrating" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:190 +msgid "Aborting migration. Some changes may already have been made." +msgstr "Aborting migration. Some changes may already have been made." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:191 +msgid "" +"Before trying to migrate again, you must recover player files from the " +"backups, and then move the backups away from the plugin directory to avoid " +"overwriting them." +msgstr "" +"Before trying to migrate again, you must recover player files from the " +"backups, and then move the backups away from the plugin directory to avoid " +"overwriting them." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:203 +msgid "Looking for configuration files to migrate..." +msgstr "Looking for configuration files to migrate..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:206 +#, java-format +msgid "Detected former posters file {0}" +msgstr "Detected former posters file {0}" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:209 +#, java-format +msgid "Detected former maps file {0}" +msgstr "Detected former maps file {0}" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:213 +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:416 +msgid "There is nothing to migrate. Stopping." +msgstr "There is nothing to migrate. Stopping." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:218 +msgid "Done." +msgstr "Done." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:232 +msgid "Backup directories already exists." +msgstr "Backup directories already exists." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:233 +msgid "" +"This means that a migration has already been done, or may not have ended " +"well." +msgstr "" +"This means that a migration has already been done, or may not have ended " +"well." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:234 +msgid "" +"To start a new migration, you must move away the backup directories so they " +"are not overwritten." +msgstr "" +"To start a new migration, you must move away the backup directories so they " +"are not overwritten." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:247 +msgid "Backing up map data before migrating..." +msgstr "Backing up map data before migrating..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:271 +msgid "Backup complete." +msgstr "Backup complete." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:352 +msgid "Fetching UUIDs from Mojang..." +msgstr "Fetching UUIDs from Mojang..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:359 +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:387 +msgid "An error occurred while fetching the UUIDs from Mojang" +msgstr "An error occurred while fetching the UUIDs from Mojang" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:364 +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:392 +msgid "The migration worker has been interrupted" +msgstr "The migration worker has been interrupted" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:367 +#, java-format +msgid "Fetching done. {0} UUID have been retrieved." +msgid_plural "Fetching done. {0} UUIDs have been retrieved." +msgstr[0] "Fetching done. {0} UUID have been retrieved." +msgstr[1] "Fetching done. {0} UUIDs have been retrieved." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:378 +#, java-format +msgid "Mojang did not find UUIDs for {0} player at the current time." +msgid_plural "Mojang did not find UUIDs for {0} players at the current time." +msgstr[0] "Mojang did not find UUIDs for {0} player at the current time." +msgstr[1] "Mojang did not find UUIDs for {0} players at the current time." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:379 +msgid "" +"The Mojang servers limit requests rate at one per second, this may take some " +"time..." +msgstr "" +"The Mojang servers limit requests rate at one per second, this may take some " +"time..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:398 +#, java-format +msgid "Mojang did not find player data for {0} player" +msgid_plural "Mojang did not find player data for {0} players" +msgstr[0] "Mojang did not find player data for {0} player" +msgstr[1] "Mojang did not find player data for {0} players" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:400 +msgid "The following players do not exist or do not have paid accounts :" +msgstr "The following players do not exist or do not have paid accounts :" + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:415 +msgid "Mojang could not find any of the registered players." +msgstr "Mojang could not find any of the registered players." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:425 +msgid "Merging map data..." +msgstr "Merging map data..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:475 +#, java-format +msgid "{0} registered minecraft map is missing from the save." +msgid_plural "{0} registered minecraft maps are missing from the save." +msgstr[0] "{0} registered minecraft map is missing from the save." +msgstr[1] "{0} registered minecraft maps are missing from the save." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:476 +msgid "" +"These maps will not be migrated, but this could mean the save has been " +"altered or corrupted." +msgstr "" +"These maps will not be migrated, but this could mean the save has been " +"altered or corrupted." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:477 +#, java-format +msgid "The following maps are missing : {0} " +msgstr "The following maps are missing : {0} " + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:483 +msgid "Saving changes..." +msgstr "Saving changes..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:489 +msgid "Cleaning up old data files..." +msgstr "Cleaning up old data files..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:496 +msgid "Deleting old map data file..." +msgstr "Deleting old map data file..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:501 +#, java-format +msgid "{0} map could not be migrated." +msgid_plural "{0} maps could not be migrated." +msgstr[0] "{0} map could not be migrated." +msgstr[1] "{0} maps could not be migrated." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:519 +msgid "Deleting old poster data file..." +msgstr "Deleting old poster data file..." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:524 +#, java-format +msgid "{0} poster could not be migrated." +msgid_plural "{0} posters could not be migrated." +msgstr[0] "{0} poster could not be migrated." +msgstr[1] "{0} posters could not be migrated." + +#: src/main/java/fr/moribus/imageonmap/migration/V3Migrator.java:537 +msgid "Data that has not been migrated will be kept in the old data files." +msgstr "Data that has not been migrated will be kept in the old data files." + +#. The name of a map item given to a player, if splatter maps are not used. 0 = map name; 1 = index. +#: src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java:139 +#: src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java:215 +#, java-format +msgid "{0} (part {1})" +msgstr "{0} (部分 {1})" + +#. The name of a map item given to a player, if splatter maps are not used. 0 = map name; 1 = row; 2 = column. +#: src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java:145 +#: src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java:213 +#, java-format +msgid "{0} (row {1}, column {2})" +msgstr "{0} (横 {1}, 縦 {2})" + +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:44 +msgid "Splatter Map" +msgstr "拡散マップ" + +#. Title in a splatter map tooltip +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:48 +msgid "Item frames needed" +msgstr "アイテムフレームãŒå¿…è¦ã§ã™" + +#. Size of a map stored in a splatter map +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:56 +#, java-format +msgid "{0} × {1}" +msgstr "横: {0} × 縦: {1}" + +#. Size of a map stored in a splatter map, including the total frames count +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:62 +#, java-format +msgid "{0} × {1} (total {2} frames)" +msgstr "横: {0} × 縦: {1} (åˆè¨ˆ {2} フレーム)" + +#. Title in a splatter map tooltip +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:53 +msgid "How to use this?" +msgstr "ã“れをã©ã†ã‚„ã£ã¦ä½¿ã„ã¾ã™ã‹ï¼Ÿ" + +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:54 +msgid "" +"Place empty item frames on a wall, enough to host the whole map. Then, right-" +"click on the bottom-left frame with this map." +msgstr "" +"アイテムフレームを空ã«ã—ã¦ã‹ã‚‰ã€ãƒžãƒƒãƒ—ãŒå¿…è¦ãªåˆ†ã®ãƒ•ãƒ¬ãƒ¼ãƒ ã‚’設置ã—ã¦ã‹ã‚‰ã€å·¦ä¸‹ã®ãƒ•ãƒ¬ãƒ¼ãƒ ã‚’å³ã‚¯ãƒªãƒƒã‚¯ã—ã¦ä¸‹ã•ã„。" + +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:56 +msgid "" +"Shift-click one of the placed maps to remove the whole poster in one shot." +msgstr "" +"シフトクリックã§ãƒžãƒƒãƒ—を一括削除ã§ãã¾ã™" + +#: src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java:101 +msgid "{ce}There is not enough space to place this map ({0} × {1})." +msgstr "{ce}ã“ã®ãƒžãƒƒãƒ—を設置ã™ã‚‹ã®ã«å分ãªã‚¹ãƒšãƒ¼ã‚¹ãŒã‚ã‚Šã¾ã›ã‚“ï¼ (横: {0} × 縦: {1})" From 8fb4ac550c2d22dc7834672d9d2aabf99bf75de4 Mon Sep 17 00:00:00 2001 From: Kotlia Date: Tue, 28 Jul 2020 10:25:17 -0400 Subject: [PATCH 14/25] Add Japanese --- src/main/resources/i18n/jp_JP.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/i18n/jp_JP.po b/src/main/resources/i18n/jp_JP.po index 0d3291d..433c332 100644 --- a/src/main/resources/i18n/jp_JP.po +++ b/src/main/resources/i18n/jp_JP.po @@ -7,11 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-07-27 03:07+0200\n" -"PO-Revision-Date: 2016-07-27 03:08+0200\n" +"POT-Creation-Date: 2020-07-27 21:02+0200\n" +"PO-Revision-Date: 2020-07-27 21:38+0200\n" "Last-Translator: Kotlia\n" "Language-Team: \n" -"Language: ja_JA\n" +"Language: ja_JP\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" From 1f16740d804a88b06bb249d2b5bb9265c97a42e0 Mon Sep 17 00:00:00 2001 From: Kotlia Date: Tue, 28 Jul 2020 11:27:30 -0400 Subject: [PATCH 15/25] Add Japanese --- src/main/resources/config.yml | 2 +- src/main/resources/i18n/{jp_JP.po => ja_JP.po} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/main/resources/i18n/{jp_JP.po => ja_JP.po} (100%) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 3f51a2e..d34b848 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -2,7 +2,7 @@ # Plugin language. Empty: system language. -# Available: en-US (default, fallback), fr-FR, ru-RU, de-DE, zh-CN. +# Available: en-US (default, fallback), fr-FR, ru-RU, de-DE, zh-CN, ja_JP. lang: diff --git a/src/main/resources/i18n/jp_JP.po b/src/main/resources/i18n/ja_JP.po similarity index 100% rename from src/main/resources/i18n/jp_JP.po rename to src/main/resources/i18n/ja_JP.po From 2c734d1cb566254884b1b097ac96a954aa94a6fd Mon Sep 17 00:00:00 2001 From: Vlammar Date: Thu, 30 Jul 2020 11:57:19 +0200 Subject: [PATCH 16/25] fixed bugs of #121 --- .../moribus/imageonmap/ui/MapItemManager.java | 43 +++++++++++++------ .../imageonmap/ui/SplatterMapManager.java | 5 +-- src/main/resources/config.yml | 2 +- 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java b/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java index b8e14c5..7c60c76 100644 --- a/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java +++ b/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java @@ -43,6 +43,7 @@ import fr.moribus.imageonmap.map.PosterMap; import fr.moribus.imageonmap.map.SingleMap; import fr.zcraft.zlib.components.i18n.I; import fr.zcraft.zlib.core.ZLib; +import fr.zcraft.zlib.tools.PluginLogger; import fr.zcraft.zlib.tools.items.ItemStackBuilder; import fr.zcraft.zlib.tools.items.ItemUtils; import org.bukkit.*; @@ -88,7 +89,7 @@ public class MapItemManager implements Listener static public boolean give(Player player, SingleMap map) { - return give(player, createMapItem(map)); + return give(player, createMapItem(map,true)); } static public boolean give(Player player, PosterMap map) @@ -138,12 +139,16 @@ public class MapItemManager implements Listener return !given; } - static public ItemStack createMapItem(SingleMap map) { return createMapItem(map.getMapsIDs()[0], map.getName(), false); } + static public ItemStack createMapItem(SingleMap map, boolean goldTitle) + { + return createMapItem(map.getMapsIDs()[0], map.getName(), false, goldTitle); + } + static public ItemStack createMapItem(PosterMap map, int index) { return createMapItem(map.getMapIdAt(index), getMapTitle(map, index), true); @@ -166,20 +171,32 @@ public class MapItemManager implements Listener return I.t("{0} (part {1})", map.getName(), index + 1); } - static public ItemStack createMapItem(int mapID, String text, boolean isMapPart) + static public ItemStack createMapItem(int mapID, String text, boolean isMapPart, boolean goldTitle) { - final ItemStack mapItem = new ItemStackBuilder(Material.FILLED_MAP) - .title(text) - .hideAttributes() - .item(); - + ItemStack mapItem; + if(goldTitle) { + mapItem = new ItemStackBuilder(Material.FILLED_MAP) + .title( ChatColor.GOLD, text) + .hideAttributes() + .item(); + } + else{ + mapItem= new ItemStackBuilder(Material.FILLED_MAP) + .title(text) + .hideAttributes() + .item(); + } final MapMeta meta = (MapMeta) mapItem.getItemMeta(); meta.setMapId(mapID); meta.setColor(isMapPart ? Color.LIME : Color.GREEN); mapItem.setItemMeta(meta); - + PluginLogger.info("color "+meta.getColor()); return mapItem; } + static public ItemStack createMapItem(int mapID, String text, boolean isMapPart) + { + return createMapItem( mapID, text, isMapPart,false); + } /** * Returns the item to place to display the (col;row) part of the given poster. @@ -248,18 +265,20 @@ public class MapItemManager implements Listener if (frame.getItem().getType() != Material.AIR) return; if (!MapManager.managesMap(mapItem)) return; - if (SplatterMapManager.hasSplatterAttributes(mapItem)) { if (!SplatterMapManager.placeSplatterMap(frame, player,event)){ event.setCancelled(true); //In case of an error allow to cancel map placement - return;} + return; + } + frame.setRotation(Rotation.NONE.rotateCounterClockwise()); } else { + frame.setRotation(Rotation.NONE.rotateCounterClockwise()); // If the item has a display name, bot not one from an anvil by the player, we remove it // If it is not displayed on hover on the wall. - if (mapItem.hasItemMeta() && mapItem.getItemMeta().hasDisplayName() && mapItem.getItemMeta().getDisplayName().startsWith("§r")) + if (mapItem.hasItemMeta() && mapItem.getItemMeta().hasDisplayName() && mapItem.getItemMeta().getDisplayName().startsWith("§6")) { final ItemStack frameItem = mapItem.clone(); diff --git a/src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java b/src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java index e0858ab..762c8ca 100644 --- a/src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java +++ b/src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java @@ -298,10 +298,7 @@ abstract public class SplatterMapManager { frame.setItem(new ItemStackBuilder(Material.FILLED_MAP).nbt(ImmutableMap.of("map", id)).craftItem()); //Force reset of rotation - if(i==0){//First map need to be rotate one time Clockwise - frame.setRotation(Rotation.NONE.rotateCounterClockwise()); - } - else{frame.setRotation(Rotation.NONE);} + frame.setRotation(Rotation.NONE); MapInitEvent.initMap(id); ++i; } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index d34b848..07e54e2 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -2,7 +2,7 @@ # Plugin language. Empty: system language. -# Available: en-US (default, fallback), fr-FR, ru-RU, de-DE, zh-CN, ja_JP. +# Available: en-US (default, fallback), fr-FR, ru-RU, de-DE, zh-CN, ja-JP. lang: From a41ffaedee2a3459bc5c4cc4d70216c1837ae4ce Mon Sep 17 00:00:00 2001 From: Vlammar Date: Thu, 30 Jul 2020 13:37:06 +0200 Subject: [PATCH 17/25] fixed other bugs linked to #121 --- .../java/fr/moribus/imageonmap/gui/MapDetailGui.java | 2 +- src/main/java/fr/moribus/imageonmap/gui/MapListGui.java | 2 +- .../java/fr/moribus/imageonmap/ui/MapItemManager.java | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java b/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java index 465508e..9717771 100644 --- a/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java +++ b/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java @@ -102,7 +102,7 @@ public class MapDetailGui extends ExplorerGui if (map instanceof SingleMap) { - return MapItemManager.createMapItem((SingleMap)map); + return MapItemManager.createMapItem((SingleMap)map,true); } else if (map instanceof PosterMap) { diff --git a/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java b/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java index 8d8053d..40f38d9 100644 --- a/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java +++ b/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java @@ -131,7 +131,7 @@ public class MapListGui extends ExplorerGui if (map instanceof SingleMap) { - return MapItemManager.createMapItem(map.getMapsIDs()[0], map.getName(), false); + return MapItemManager.createMapItem(map.getMapsIDs()[0], map.getName(), false,true); } else if (map instanceof PosterMap) { diff --git a/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java b/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java index 7c60c76..3ce3bf5 100644 --- a/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java +++ b/src/main/java/fr/moribus/imageonmap/ui/MapItemManager.java @@ -43,10 +43,10 @@ import fr.moribus.imageonmap.map.PosterMap; import fr.moribus.imageonmap.map.SingleMap; import fr.zcraft.zlib.components.i18n.I; import fr.zcraft.zlib.core.ZLib; -import fr.zcraft.zlib.tools.PluginLogger; import fr.zcraft.zlib.tools.items.ItemStackBuilder; import fr.zcraft.zlib.tools.items.ItemUtils; import org.bukkit.*; +import org.bukkit.block.BlockFace; import org.bukkit.entity.ItemFrame; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -190,7 +190,6 @@ public class MapItemManager implements Listener meta.setMapId(mapID); meta.setColor(isMapPart ? Color.LIME : Color.GREEN); mapItem.setItemMeta(meta); - PluginLogger.info("color "+meta.getColor()); return mapItem; } static public ItemStack createMapItem(int mapID, String text, boolean isMapPart) @@ -271,11 +270,13 @@ public class MapItemManager implements Listener event.setCancelled(true); //In case of an error allow to cancel map placement return; } - frame.setRotation(Rotation.NONE.rotateCounterClockwise()); + if(frame.getFacing()!= BlockFace.UP&&frame.getFacing()!= BlockFace.DOWN) + frame.setRotation(Rotation.NONE.rotateCounterClockwise()); } else { - frame.setRotation(Rotation.NONE.rotateCounterClockwise()); + if(frame.getFacing()!= BlockFace.UP&&frame.getFacing()!= BlockFace.DOWN) + frame.setRotation(Rotation.NONE.rotateCounterClockwise()); // If the item has a display name, bot not one from an anvil by the player, we remove it // If it is not displayed on hover on the wall. if (mapItem.hasItemMeta() && mapItem.getItemMeta().hasDisplayName() && mapItem.getItemMeta().getDisplayName().startsWith("§6")) From edc6f51e2e32665492a282b76649f0a93a024ccf Mon Sep 17 00:00:00 2001 From: Vlammar <36545324+Vlammar@users.noreply.github.com> Date: Tue, 25 Aug 2020 22:50:24 +0200 Subject: [PATCH 18/25] Update DeleteOtherCommand.java Removed commented code and inverted permission check with arg length check. Changed success and error messages --- .../commands/maptool/DeleteOtherCommand.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java index 7f95328..91d7680 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java @@ -44,12 +44,12 @@ public class DeleteOtherCommand extends IoMCommand @Override protected void run() throws CommandException { - if(args.length < 2) warning(I.t("Not enough parameters! Usage: /maptool deleteother ")); if(!playerSender().hasPermission("imageonmap.delete.other")) { warning(I.t("You do not have permission for this command. (imageonmap.delete.other)")); return; } - + if(args.length < 2) warning(I.t("Not enough parameters! Usage: /maptool deleteother ")); + Player player = null; UUID uuid = null; OfflinePlayer op = null; @@ -67,17 +67,16 @@ public class DeleteOtherCommand extends IoMCommand ImageMap map = MapManager.getMap(uuid, mapName); if(player != null) MapManager.clear(player.getInventory(), map); - //if(player == null) MapManager.clear(op.getPlayer().getInventory(), map); try { MapManager.deleteMap(map); - info(I.t("Map successfully deleted.")); + getPlayer().sendMessage(I.t("{gray}Map successfully deleted.")); } catch (MapManagerException ex) { - PluginLogger.warning("A non-existent map was requested to be deleted", ex); - warning(I.t("This map does not exist.")); + PluginLogger.warning(I.t("A non-existent map was requested to be deleted", ex)); + getPlayer().sendMessage(ChatColor.RED+(I.t("This map does not exist."))); } } From 2a2da88f72d2e13f79b80ff926cc2786cf87ce9c Mon Sep 17 00:00:00 2001 From: Vlammar <36545324+Vlammar@users.noreply.github.com> Date: Tue, 25 Aug 2020 23:59:18 +0200 Subject: [PATCH 19/25] Update maptool.txt --- src/main/resources/help/maptool.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/help/maptool.txt b/src/main/resources/help/maptool.txt index b211c1c..846eb9b 100644 --- a/src/main/resources/help/maptool.txt +++ b/src/main/resources/help/maptool.txt @@ -2,10 +2,11 @@ This command manages and creates ImagesOnMaps. new: Creates a new ImageOnMap delete: Deletes a map. delete-noconfirm: Deletes a map. Deletion is permanent and made without confirmation +deleteother: Deletes another map. get: Gives you a map. getother: Gets another player's map. getremaining: Gives you the remaining maps that could not fit in your inventory list: Lists all the map you currently have. explore: Opens a GUI to see and manage your maps. migrate: Lauches the migration process from V2.7 to V3.x. -help : Use help for more information about a command. \ No newline at end of file +help : Use help for more information about a command. From f524c8ee957224514ae08667a8916d7f2f08d93e Mon Sep 17 00:00:00 2001 From: Vlammar <36545324+Vlammar@users.noreply.github.com> Date: Wed, 26 Aug 2020 00:00:47 +0200 Subject: [PATCH 20/25] Update maptool.txt --- src/main/resources/help/maptool.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/help/maptool.txt b/src/main/resources/help/maptool.txt index 846eb9b..5110868 100644 --- a/src/main/resources/help/maptool.txt +++ b/src/main/resources/help/maptool.txt @@ -7,6 +7,7 @@ get: Gives you a map. getother: Gets another player's map. getremaining: Gives you the remaining maps that could not fit in your inventory list: Lists all the map you currently have. +listother: list all the map of another player. explore: Opens a GUI to see and manage your maps. migrate: Lauches the migration process from V2.7 to V3.x. help : Use help for more information about a command. From 7b3814cd7fbb9dbc73de989a36bd5baf9b162fb3 Mon Sep 17 00:00:00 2001 From: Vlammar <36545324+Vlammar@users.noreply.github.com> Date: Wed, 26 Aug 2020 00:02:53 +0200 Subject: [PATCH 21/25] Update listother.txt --- src/main/resources/help/maptool/listother.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/help/maptool/listother.txt b/src/main/resources/help/maptool/listother.txt index a24cb0a..7364938 100644 --- a/src/main/resources/help/maptool/listother.txt +++ b/src/main/resources/help/maptool/listother.txt @@ -1 +1,3 @@ -Lists another player's maps. \ No newline at end of file +Lists another player's maps. + +§6: §rThe name of the player you want to list map from. From 16248a9e3b905ba7317d961454d8c1dc9baa56dc Mon Sep 17 00:00:00 2001 From: Vlammar <36545324+Vlammar@users.noreply.github.com> Date: Wed, 26 Aug 2020 00:08:05 +0200 Subject: [PATCH 22/25] Update ListOtherCommand.java --- .../commands/maptool/ListOtherCommand.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java index 292c1ea..89540e4 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java @@ -107,13 +107,11 @@ public class ListOtherCommand extends IoMCommand .then(map.getId()) .color(ChatColor.WHITE) .command(GetCommand.class, map.getId()) - .hover(new ItemStackBuilder(Material.MAP) - .title(ChatColor.GREEN + "" + ChatColor.BOLD + map.getName()) - .lore(ChatColor.GRAY + map.getId() + ", " + size) - .lore("") - .lore(I.t("{white}Click{gray} to get this map")) - .hideAttributes() - .item() + .hover(new RawText() + .then(map.getName()).style(ChatColor.BOLD, ChatColor.GREEN).then("\n") + .then(map.getId() + ", " + size).color(ChatColor.GRAY).then("\n\n") + .then(I.t("{white}Click{gray} to get this map")) + ); } @Override From fcc48cb4024625c11c507982bb20cbbbd2fe53d9 Mon Sep 17 00:00:00 2001 From: Vlammar Date: Thu, 27 Aug 2020 01:32:04 +0200 Subject: [PATCH 23/25] fixed various issues with the admin command, refactored some of the code and added an exploredother command --- .../fr/moribus/imageonmap/ImageOnMap.java | 5 +- .../commands/maptool/DeleteCommand.java | 28 ++++--- .../commands/maptool/DeleteOtherCommand.java | 72 ++++++++++------ .../commands/maptool/ExploreCommand.java | 2 +- .../commands/maptool/ExploreOtherCommand.java | 83 +++++++++++++++++++ .../commands/maptool/GetOtherCommand.java | 74 +++++++++++------ .../commands/maptool/ListOtherCommand.java | 74 ++++++++++------- .../imageonmap/gui/ConfirmDeleteMapGui.java | 3 +- .../moribus/imageonmap/gui/MapDetailGui.java | 21 +++-- .../fr/moribus/imageonmap/gui/MapListGui.java | 46 +++++++--- src/main/resources/help/maptool.txt | 1 + src/main/resources/plugin.yml | 32 +++++-- 12 files changed, 322 insertions(+), 119 deletions(-) create mode 100644 src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java diff --git a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java index 38cf7c7..608e980 100644 --- a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java +++ b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java @@ -118,13 +118,14 @@ public final class ImageOnMap extends ZPlugin "maptool", NewCommand.class, ListCommand.class, + ListOtherCommand.class, GetCommand.class, GetOtherCommand.class, - ListOtherCommand.class, - DeleteOtherCommand.class, DeleteCommand.class, + DeleteOtherCommand.class, GetRemainingCommand.class, ExploreCommand.class, + ExploreOtherCommand.class, MigrateCommand.class ); diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteCommand.java index a2516f1..2041d60 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteCommand.java @@ -57,6 +57,20 @@ import java.util.List; @WithFlags ({"confirm"}) public class DeleteCommand extends IoMCommand { + + private static RawText deleteMsg(Class klass,ImageMap map){ + return new RawText(I.t("You are going to delete") + " ") + .then(map.getId()) + .color(ChatColor.GOLD) + .then(". " + I.t("Are you sure ? ")) + .color(ChatColor.WHITE) + .then(I.t("[Confirm]")) + .color(ChatColor.GREEN) + .hover(new RawText(I.t("{red}This map will be deleted {bold}forever{red}!"))) + .command(klass, map.getId(), "--confirm") + .build(); + } + @Override protected void run() throws CommandException { @@ -64,17 +78,7 @@ public class DeleteCommand extends IoMCommand if (!hasFlag("confirm")) { - RawText msg = new RawText(I.t("You are going to delete") + " ") - .then(map.getId()) - .color(ChatColor.GOLD) - .then(". " + I.t("Are you sure ? ")) - .color(ChatColor.WHITE) - .then(I.t("[Confirm]")) - .color(ChatColor.GREEN) - .hover(new RawText(I.t("{red}This map will be deleted {bold}forever{red}!"))) - .command(getClass(), map.getId(), "--confirm") - .build(); - + RawText msg = deleteMsg(getClass(),map); send(msg); } else @@ -89,7 +93,7 @@ public class DeleteCommand extends IoMCommand } catch (MapManagerException ex) { - PluginLogger.warning("A non-existent map was requested to be deleted", ex); + PluginLogger.warning(I.t("A non-existent map was requested to be deleted", ex)); warning(I.t("This map does not exist.")); } } diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java index 91d7680..dfcf537 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java @@ -1,19 +1,37 @@ /* - * Copyright (C) 2013 Moribus - * Copyright (C) 2015 ProkopyL + * Copyright or © or Copr. Moribus (2013) + * Copyright or © or Copr. ProkopyL (2015) + * Copyright or © or Copr. Amaury Carrade (2016 – 2020) + * Copyright or © or Copr. Vlammar (2019 – 2020) * - * 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 software is a computer program whose purpose is to allow insertion of + * custom images in a Minecraft world. * - * 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. + * This software is governed by the CeCILL-B license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL-B + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL-B license and that you accept its terms. */ package fr.moribus.imageonmap.commands.maptool; @@ -28,8 +46,8 @@ import fr.zcraft.zlib.components.commands.CommandInfo; import fr.zcraft.zlib.components.commands.WithFlags; import fr.zcraft.zlib.components.i18n.I; import fr.zcraft.zlib.tools.PluginLogger; - import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -44,12 +62,16 @@ public class DeleteOtherCommand extends IoMCommand @Override protected void run() throws CommandException { - if(!playerSender().hasPermission("imageonmap.delete.other")) { + /*if(!playerSender().hasPermission("imageonmap.delete.other")) { warning(I.t("You do not have permission for this command. (imageonmap.delete.other)")); return; - } - if(args.length < 2) warning(I.t("Not enough parameters! Usage: /maptool deleteother ")); - + }*/ + if(args.length < 2) { + warning(I.t("Not enough parameters! Usage: /maptool deleteother ")); + return; + } + + Player player = null; UUID uuid = null; OfflinePlayer op = null; @@ -60,23 +82,24 @@ public class DeleteOtherCommand extends IoMCommand else warning(I.t("We've never seen that player before!")); } else uuid = player.getUniqueId(); - String mapName = ""; - mapName = args[1]; - if(args.length > 2) for(int i = 2; i < args.length; i++) mapName += (" " + args[i - 1]); - - ImageMap map = MapManager.getMap(uuid, mapName); + if(player==null){ + warning(I.t("Player not found")); + return; + } + ImageMap map = getMapFromArgs(player, 1, true); + //ImageMap map = MapManager.getMap(uuid, mapName); if(player != null) MapManager.clear(player.getInventory(), map); try { MapManager.deleteMap(map); - getPlayer().sendMessage(I.t("{gray}Map successfully deleted.")); + info(I.t("{gray}Map successfully deleted.")); } catch (MapManagerException ex) { PluginLogger.warning(I.t("A non-existent map was requested to be deleted", ex)); - getPlayer().sendMessage(ChatColor.RED+(I.t("This map does not exist."))); + warning(ChatColor.RED+(I.t("This map does not exist."))); } } @@ -89,6 +112,7 @@ public class DeleteOtherCommand extends IoMCommand return null; } + @Override public boolean canExecute(CommandSender sender) { diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreCommand.java index d4bac06..cd3f96f 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreCommand.java @@ -52,7 +52,7 @@ public class ExploreCommand extends IoMCommand @Override protected void run() throws CommandException { - Gui.open(playerSender(), new MapListGui()); + Gui.open(playerSender(), new MapListGui(playerSender())); } @Override diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java new file mode 100644 index 0000000..8e8af95 --- /dev/null +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java @@ -0,0 +1,83 @@ +/* + * Copyright or © or Copr. Moribus (2013) + * Copyright or © or Copr. ProkopyL (2015) + * Copyright or © or Copr. Amaury Carrade (2016 – 2020) + * Copyright or © or Copr. Vlammar (2019 – 2020) + * + * This software is a computer program whose purpose is to allow insertion of + * custom images in a Minecraft world. + * + * This software is governed by the CeCILL-B license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL-B + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL-B license and that you accept its terms. + */ + +package fr.moribus.imageonmap.commands.maptool; + + +import fr.moribus.imageonmap.Permissions; +import fr.moribus.imageonmap.commands.IoMCommand; +import fr.moribus.imageonmap.gui.MapListGui; +import fr.zcraft.zlib.components.commands.CommandException; +import fr.zcraft.zlib.components.commands.CommandInfo; +import fr.zcraft.zlib.components.gui.Gui; +import fr.zcraft.zlib.components.i18n.I; +import org.bukkit.OfflinePlayer; +import org.bukkit.command.CommandSender; + +import java.io.IOException; + + +@CommandInfo (name = "exploreother") +public class ExploreOtherCommand extends IoMCommand +{ + @Override + protected void run() throws CommandException + { + if(args.length < 1) { + warning(I.t("Not enough parameters! Usage: /maptool exploreother ")); + return; + } + + try{ + OfflinePlayer player=getOfflinePlayerParameter(0); + String name=args[0]; + if(player!=null) + Gui.open(playerSender(), new MapListGui(player,name)); + } + catch (InterruptedException | IOException e){ + warning(I.t("Can't find player")); + return; + } + + + } + + @Override + public boolean canExecute(CommandSender sender) + { + return Permissions.LISTOTHER.grantedTo(sender); + } +} diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java index d8529d5..ba18870 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java @@ -1,31 +1,42 @@ /* - * Copyright (C) 2013 Moribus - * Copyright (C) 2015 ProkopyL + * Copyright or © or Copr. Moribus (2013) + * Copyright or © or Copr. ProkopyL (2015) + * Copyright or © or Copr. Amaury Carrade (2016 – 2020) + * Copyright or © or Copr. Vlammar (2019 – 2020) * - * 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 software is a computer program whose purpose is to allow insertion of + * custom images in a Minecraft world. * - * 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. + * This software is governed by the CeCILL-B license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL-B + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL-B license and that you accept its terms. */ package fr.moribus.imageonmap.commands.maptool; -import java.util.UUID; - -import org.bukkit.Bukkit; -import org.bukkit.OfflinePlayer; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - import fr.moribus.imageonmap.Permissions; import fr.moribus.imageonmap.commands.IoMCommand; import fr.moribus.imageonmap.map.ImageMap; @@ -33,29 +44,36 @@ import fr.moribus.imageonmap.map.MapManager; import fr.zcraft.zlib.components.commands.CommandException; import fr.zcraft.zlib.components.commands.CommandInfo; import fr.zcraft.zlib.components.i18n.I; +import org.bukkit.Bukkit; +import org.bukkit.OfflinePlayer; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import java.util.UUID; @CommandInfo (name = "getother", usageParameters = " ") public class GetOtherCommand extends IoMCommand { - @SuppressWarnings("deprecation") + @Override protected void run() throws CommandException { - if(args.length < 2) warning(I.t("Not enough parameters! Usage: /maptool getother ")); - //Deny those who do not have permission. - if(!playerSender().hasPermission("imageonmap.get.other")) { - warning(I.t("You do not have permission for this command. (imageonmap.get.other)")); + + if(args.length < 2) { + warning(I.t("Not enough parameters! Usage: /maptool getother ")); return; } - + Player player = null; UUID uuid = null; player = Bukkit.getPlayer(args[0]); + if(player == null){ OfflinePlayer op = Bukkit.getOfflinePlayer(args[0]); if(op.hasPlayedBefore()) uuid = op.getUniqueId(); else warning(I.t("We've never seen that player before!")); + return; } else { uuid = player.getUniqueId(); @@ -69,7 +87,11 @@ public class GetOtherCommand extends IoMCommand } } map = MapManager.getMap(uuid, mapName); - map.give(playerSender()); + if(map!=null) + map.give(playerSender()); + else{ + warning(I.t("Unknown map {0}",mapName)); + } return; } @Override diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java index 89540e4..52f0091 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java @@ -1,34 +1,42 @@ /* - * Copyright (C) 2013 Moribus - * Copyright (C) 2015 ProkopyL + * Copyright or © or Copr. Moribus (2013) + * Copyright or © or Copr. ProkopyL (2015) + * Copyright or © or Copr. Amaury Carrade (2016 – 2020) + * Copyright or © or Copr. Vlammar (2019 – 2020) * - * 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 software is a computer program whose purpose is to allow insertion of + * custom images in a Minecraft world. * - * 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. + * This software is governed by the CeCILL-B license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL-B + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL-B license and that you accept its terms. */ package fr.moribus.imageonmap.commands.maptool; -import java.util.List; -import java.util.UUID; - -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.OfflinePlayer; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - import fr.moribus.imageonmap.Permissions; import fr.moribus.imageonmap.commands.IoMCommand; import fr.moribus.imageonmap.map.ImageMap; @@ -39,8 +47,15 @@ import fr.zcraft.zlib.components.commands.CommandInfo; import fr.zcraft.zlib.components.i18n.I; import fr.zcraft.zlib.components.rawtext.RawText; import fr.zcraft.zlib.components.rawtext.RawTextPart; -import fr.zcraft.zlib.tools.items.ItemStackBuilder; import fr.zcraft.zlib.tools.text.RawMessage; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.OfflinePlayer; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import java.util.List; +import java.util.UUID; @CommandInfo (name = "listother", usageParameters = "") @@ -49,11 +64,12 @@ public class ListOtherCommand extends IoMCommand @Override protected void run() throws CommandException { - if(args.length < 1) warning(I.t("Not enough parameters! Usage: /maptool listother ")); - if(!playerSender().hasPermission("imageonmap.list.other")) { - warning(I.t("You do not have permission for this command. (imageonmap.list.other)")); - return; + + if(args.length < 1){ + warning(I.t("Not enough parameters! Usage: /maptool listother ")); + return; } + Player player = null; UUID uuid = null; @@ -65,7 +81,6 @@ public class ListOtherCommand extends IoMCommand } else { warning(I.t("We've never seen that player before!")); - } } else{ @@ -77,8 +92,9 @@ public class ListOtherCommand extends IoMCommand mapList = MapManager.getMapList(uuid); } catch(Exception e){ - + return; } + if(mapList.isEmpty()) { info(I.t("No map found.")); diff --git a/src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java b/src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java index b60768d..1f81604 100644 --- a/src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java +++ b/src/main/java/fr/moribus/imageonmap/gui/ConfirmDeleteMapGui.java @@ -168,12 +168,13 @@ public class ConfirmDeleteMapGui extends ActionGui @GuiAction ("cancel") protected void cancel() { - close(); + close(); } @GuiAction ("delete") protected void delete() { + // Does the player still have the permission to delete a map? if (!Permissions.DELETE.grantedTo(getPlayer())) { diff --git a/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java b/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java index 9717771..f08395a 100644 --- a/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java +++ b/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java @@ -47,21 +47,25 @@ import fr.zcraft.zlib.components.gui.GuiAction; import fr.zcraft.zlib.components.gui.PromptGui; import fr.zcraft.zlib.components.i18n.I; import fr.zcraft.zlib.tools.Callback; +import fr.zcraft.zlib.tools.PluginLogger; import fr.zcraft.zlib.tools.items.ItemStackBuilder; import org.apache.commons.lang.ArrayUtils; import org.bukkit.Material; +import org.bukkit.OfflinePlayer; import org.bukkit.inventory.ItemStack; public class MapDetailGui extends ExplorerGui { private final ImageMap map; + private OfflinePlayer p; + private String name; - public MapDetailGui(ImageMap map) - { - this.map = map; + public MapDetailGui(ImageMap map, OfflinePlayer p, String name){ + this.map=map; + this.p=p; + this.name=name; } - @Override protected ItemStack getViewItem(int x, int y) { @@ -136,7 +140,12 @@ public class MapDetailGui extends ExplorerGui protected void onUpdate() { /// Title of the map details GUI - setTitle(I.t(getPlayerLocale(), "Your maps » {black}{0}", map.getName())); + if(p.getUniqueId().equals(getPlayer().getUniqueId())) { + setTitle(I.t(getPlayerLocale(), "Your maps » {black}{0}", map.getName())); + } + else{ + setTitle(I.t(getPlayerLocale(), "{1}'s maps » {black}{0}", map.getName(),name)); + } setKeepHorizontalScrollingSpace(true); if (map instanceof PosterMap) @@ -236,13 +245,13 @@ public class MapDetailGui extends ExplorerGui @GuiAction ("delete") public void delete() { + PluginLogger.info("delete"); if (!Permissions.DELETE.grantedTo(getPlayer())) { I.sendT(getPlayer(), "{ce}You are no longer allowed to do that."); update(); return; } - Gui.open(getPlayer(), new ConfirmDeleteMapGui(map), this); } diff --git a/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java b/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java index 40f38d9..4bf7644 100644 --- a/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java +++ b/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java @@ -49,12 +49,25 @@ import fr.zcraft.zlib.components.i18n.I; import fr.zcraft.zlib.tools.items.ItemStackBuilder; import org.bukkit.Color; import org.bukkit.Material; +import org.bukkit.OfflinePlayer; +import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.MapMeta; public class MapListGui extends ExplorerGui { + private OfflinePlayer p; + private String name; + public MapListGui(Player sender){ + this.p=sender; + this.name=sender.getName(); + } + public MapListGui( OfflinePlayer p,String name){ + this.p=p; + this.name=name; + } + @Override protected ItemStack getViewItem(ImageMap map) { @@ -106,23 +119,29 @@ public class MapListGui extends ExplorerGui @Override protected ItemStack getEmptyViewItem() { - ItemStackBuilder builder = new ItemStackBuilder(Material.BARRIER) - .title(I.tl(getPlayerLocale(), "{red}You don't have any map.")); + ItemStackBuilder builder = new ItemStackBuilder(Material.BARRIER); + if(p.getUniqueId().equals(getPlayer().getUniqueId())) { - if (Permissions.NEW.grantedTo(getPlayer())) - builder.longLore(I.tl(getPlayerLocale(), "{gray}Get started by creating a new one using {white}/tomap [resize]{gray}!")); - else - builder.longLore(I.tl(getPlayerLocale(), "{gray}Unfortunately, you are not allowed to create one.")); + builder.title(I.tl(getPlayerLocale(), "{red}You don't have any map.")); + if (Permissions.NEW.grantedTo(getPlayer())) + builder.longLore(I.tl(getPlayerLocale(), "{gray}Get started by creating a new one using {white}/tomap [resize]{gray}!")); + else + builder.longLore(I.tl(getPlayerLocale(), "{gray}Unfortunately, you are not allowed to create one.")); + } + else{ + builder.title(I.tl(getPlayerLocale(), "{red}{0} doesn't have any map.",name)); + } return builder.item(); } @Override protected void onRightClick(ImageMap data) { - Gui.open(getPlayer(), new MapDetailGui(data), this); + Gui.open(getPlayer(), new MapDetailGui(data,getPlayer(),name), this); } + @Override protected ItemStack getPickedUpItem(ImageMap map) { @@ -151,19 +170,22 @@ public class MapListGui extends ExplorerGui @Override protected void onUpdate() { - ImageMap[] maps = MapManager.getMaps(getPlayer().getUniqueId()); + ImageMap[] maps = MapManager.getMaps(p.getUniqueId()); setData(maps); /// The maps list GUI title - setTitle(I.tl(getPlayerLocale(), "{black}Your maps {reset}({0})", maps.length)); + //Equal if the person who send the command is the owner of the mapList + if(p.getUniqueId().equals(getPlayer().getUniqueId())) + setTitle(I.tl(getPlayerLocale(), "{black}Your maps {reset}({0})", maps.length)); + else + setTitle(I.tl(getPlayerLocale(), "{black}{1}'s maps {reset}({0})", maps.length, name )); setKeepHorizontalScrollingSpace(true); /* ** Statistics ** */ - - int imagesCount = MapManager.getMapList(getPlayer().getUniqueId()).size(); - int mapPartCount = MapManager.getMapPartCount(getPlayer().getUniqueId()); + int imagesCount = MapManager.getMapList(p.getUniqueId()).size(); + int mapPartCount = MapManager.getMapPartCount(p.getUniqueId()); int mapGlobalLimit = PluginConfiguration.MAP_GLOBAL_LIMIT.get(); int mapPersonalLimit = PluginConfiguration.MAP_PLAYER_LIMIT.get(); diff --git a/src/main/resources/help/maptool.txt b/src/main/resources/help/maptool.txt index 5110868..9b83e58 100644 --- a/src/main/resources/help/maptool.txt +++ b/src/main/resources/help/maptool.txt @@ -9,5 +9,6 @@ getremaining: Gives you the remaining maps that could not fit in your inventory list: Lists all the map you currently have. listother: list all the map of another player. explore: Opens a GUI to see and manage your maps. +exploreother: Opens a GUI to see and manage another player maps. migrate: Lauches the migration process from V2.7 to V3.x. help : Use help for more information about a command. diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index f92a42c..490e06d 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -20,11 +20,15 @@ permissions: imageonmap.userender: true imageonmap.new: true imageonmap.list: true + imageonmap.listother: true imageonmap.get: true + imageonmap.getother: true imageonmap.explore: true + imageonmap.exploreother: true imageonmap.rename: true imageonmap.removesplattermap: true imageonmap.delete: true + imageonmap.deleteother: false imageonmap.bypasssize: false imageonmap.userender: @@ -36,16 +40,28 @@ permissions: default: true imageonmap.list: - description: "Allows you to list the images you rendered." - default: true + description: "Allows you to list the images you rendered." + default: true + + imageonmap.listother: + description: "Allows you to list the images a player have rendered." + default: false imageonmap.get: - description: "Allows you to get a new map among the ones you already rendered, and related commands (/maptool getremaining)." - default: true + description: "Allows you to get a new map among the ones you already rendered, and related commands (/maptool getremaining)." + default: true + + imageonmap.getother: + description: "Allows you to get a new map among the ones a player have already rendered." + default: false imageonmap.explore: - description: "Allows you to open a GUI with all your maps." - default: true + description: "Allows you to open a GUI with all your maps." + default: true + + imageonmap.exploreother: + description: "Allows you to open a GUI with all of the player maps." + default: false imageonmap.rename: description: "Allows you to rename a map you rendered in the past." @@ -55,6 +71,10 @@ permissions: description: "Allows you to delete a map you rendered in the past." default: true + imageonmap.deleteother: + description: "Allows you to delete a map a player rendered in the past." + default: false + imageonmap.removesplattermap: description: "Allows you to remove a splatter map from a wall by sneaking and breaking a map." default: true From 166da8dca893362252d607582824c16361b050c1 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 19 Sep 2020 10:53:21 +0200 Subject: [PATCH 24/25] typo --- src/main/java/fr/moribus/imageonmap/ImageOnMap.java | 1 - .../imageonmap/commands/maptool/DeleteOtherCommand.java | 8 +------- .../imageonmap/commands/maptool/ExploreOtherCommand.java | 4 ---- .../imageonmap/commands/maptool/GetOtherCommand.java | 1 - .../imageonmap/commands/maptool/ListOtherCommand.java | 2 -- src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java | 1 - src/main/java/fr/moribus/imageonmap/gui/MapListGui.java | 2 +- 7 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java index 608e980..7ad7669 100644 --- a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java +++ b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java @@ -56,7 +56,6 @@ import org.bstats.bukkit.Metrics; import java.io.File; import java.io.IOException; - public final class ImageOnMap extends ZPlugin { static private final String IMAGES_DIRECTORY_NAME = "images"; diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java index dfcf537..697584d 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java @@ -62,16 +62,11 @@ public class DeleteOtherCommand extends IoMCommand @Override protected void run() throws CommandException { - /*if(!playerSender().hasPermission("imageonmap.delete.other")) { - warning(I.t("You do not have permission for this command. (imageonmap.delete.other)")); - return; - }*/ if(args.length < 2) { warning(I.t("Not enough parameters! Usage: /maptool deleteother ")); return; } - Player player = null; UUID uuid = null; OfflinePlayer op = null; @@ -102,8 +97,7 @@ public class DeleteOtherCommand extends IoMCommand warning(ChatColor.RED+(I.t("This map does not exist."))); } } - - + @Override protected List complete() throws CommandException { diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java index 8e8af95..8df83dc 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java @@ -36,7 +36,6 @@ package fr.moribus.imageonmap.commands.maptool; - import fr.moribus.imageonmap.Permissions; import fr.moribus.imageonmap.commands.IoMCommand; import fr.moribus.imageonmap.gui.MapListGui; @@ -60,7 +59,6 @@ public class ExploreOtherCommand extends IoMCommand warning(I.t("Not enough parameters! Usage: /maptool exploreother ")); return; } - try{ OfflinePlayer player=getOfflinePlayerParameter(0); String name=args[0]; @@ -71,8 +69,6 @@ public class ExploreOtherCommand extends IoMCommand warning(I.t("Can't find player")); return; } - - } @Override diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java index ba18870..a0fd1e0 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/GetOtherCommand.java @@ -59,7 +59,6 @@ public class GetOtherCommand extends IoMCommand @Override protected void run() throws CommandException { - if(args.length < 2) { warning(I.t("Not enough parameters! Usage: /maptool getother ")); return; diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java index 52f0091..6e6b5a4 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/ListOtherCommand.java @@ -64,7 +64,6 @@ public class ListOtherCommand extends IoMCommand @Override protected void run() throws CommandException { - if(args.length < 1){ warning(I.t("Not enough parameters! Usage: /maptool listother ")); return; @@ -127,7 +126,6 @@ public class ListOtherCommand extends IoMCommand .then(map.getName()).style(ChatColor.BOLD, ChatColor.GREEN).then("\n") .then(map.getId() + ", " + size).color(ChatColor.GRAY).then("\n\n") .then(I.t("{white}Click{gray} to get this map")) - ); } @Override diff --git a/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java b/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java index f08395a..71adf75 100644 --- a/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java +++ b/src/main/java/fr/moribus/imageonmap/gui/MapDetailGui.java @@ -245,7 +245,6 @@ public class MapDetailGui extends ExplorerGui @GuiAction ("delete") public void delete() { - PluginLogger.info("delete"); if (!Permissions.DELETE.grantedTo(getPlayer())) { I.sendT(getPlayer(), "{ce}You are no longer allowed to do that."); diff --git a/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java b/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java index 4bf7644..25a914a 100644 --- a/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java +++ b/src/main/java/fr/moribus/imageonmap/gui/MapListGui.java @@ -63,7 +63,7 @@ public class MapListGui extends ExplorerGui this.p=sender; this.name=sender.getName(); } - public MapListGui( OfflinePlayer p,String name){ + public MapListGui(OfflinePlayer p,String name){ this.p=p; this.name=name; } From 6b332d60b6f30d2659bfa12af98a900203cc1c2d Mon Sep 17 00:00:00 2001 From: Vlammar Date: Wed, 4 Nov 2020 17:28:20 +0100 Subject: [PATCH 25/25] code cleanup and fixing issues --- src/main/java/fr/moribus/imageonmap/ImageOnMap.java | 4 +++- .../imageonmap/commands/maptool/DeleteOtherCommand.java | 6 +----- .../imageonmap/commands/maptool/ExploreOtherCommand.java | 7 +++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java index 608e980..0836ad6 100644 --- a/src/main/java/fr/moribus/imageonmap/ImageOnMap.java +++ b/src/main/java/fr/moribus/imageonmap/ImageOnMap.java @@ -45,6 +45,7 @@ import fr.moribus.imageonmap.map.MapManager; import fr.moribus.imageonmap.migration.MigratorExecutor; import fr.moribus.imageonmap.migration.V3Migrator; import fr.moribus.imageonmap.ui.MapItemManager; +import fr.zcraft.zlib.components.commands.CommandWorkers; import fr.zcraft.zlib.components.commands.Commands; import fr.zcraft.zlib.components.gui.Gui; import fr.zcraft.zlib.components.i18n.I18n; @@ -105,7 +106,7 @@ public final class ImageOnMap extends ZPlugin saveDefaultConfig(); - loadComponents(I18n.class, Gui.class, Commands.class, PluginConfiguration.class, ImageIOExecutor.class, ImageRendererExecutor.class); + loadComponents(I18n.class, Gui.class, Commands.class, PluginConfiguration.class, ImageIOExecutor.class, ImageRendererExecutor.class, CommandWorkers.class); //Init all the things ! I18n.setPrimaryLocale(PluginConfiguration.LANG.get()); @@ -114,6 +115,7 @@ public final class ImageOnMap extends ZPlugin MapInitEvent.init(); MapItemManager.init(); + Commands.register( "maptool", NewCommand.class, diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java index dfcf537..87f1712 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/DeleteOtherCommand.java @@ -62,10 +62,7 @@ public class DeleteOtherCommand extends IoMCommand @Override protected void run() throws CommandException { - /*if(!playerSender().hasPermission("imageonmap.delete.other")) { - warning(I.t("You do not have permission for this command. (imageonmap.delete.other)")); - return; - }*/ + if(args.length < 2) { warning(I.t("Not enough parameters! Usage: /maptool deleteother ")); return; @@ -87,7 +84,6 @@ public class DeleteOtherCommand extends IoMCommand return; } ImageMap map = getMapFromArgs(player, 1, true); - //ImageMap map = MapManager.getMap(uuid, mapName); if(player != null) MapManager.clear(player.getInventory(), map); diff --git a/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java b/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java index 8e8af95..5e4896d 100644 --- a/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java +++ b/src/main/java/fr/moribus/imageonmap/commands/maptool/ExploreOtherCommand.java @@ -47,7 +47,7 @@ import fr.zcraft.zlib.components.i18n.I; import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; -import java.io.IOException; +import java.util.concurrent.ExecutionException; @CommandInfo (name = "exploreother") @@ -67,17 +67,16 @@ public class ExploreOtherCommand extends IoMCommand if(player!=null) Gui.open(playerSender(), new MapListGui(player,name)); } - catch (InterruptedException | IOException e){ + catch (InterruptedException | ExecutionException e){ warning(I.t("Can't find player")); return; } - } @Override public boolean canExecute(CommandSender sender) { - return Permissions.LISTOTHER.grantedTo(sender); + return Permissions.LISTOTHER.grantedTo(sender); } }