diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 7402a2f6..f06eb7bc 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -498,6 +498,7 @@ SIMULATOR_CREATE_HELP = §8/§esimulator create §8[§7name§8] §8-§7 Create a SIMULATOR_CHANGE_HELP = §8/§esimulator change §8-§7 Change your simulator wand selection SIMULATOR_DELETE_HELP = §8/§esimulator delete §8[§7name§8] §8-§7 Deletes the simulator SIMULATOR_START_HELP = §8/§esimulator start §8[§7name§8] §8-§7 Starts the simulator +SIMULATOR_COPY_HELP = §8/§esimulator copy §8[§7to-copy§8] §8[§7name§8] §8-§7 Copy the simulator SIMULATOR_NO_PERMS = §cYou are not allowed to use the simulator here SIMULATOR_GUI_ITEM_NAME = §eTNT Simulator diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index 9ccfa729..e38dfbf0 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -499,6 +499,7 @@ SIMULATOR_CREATE_HELP = §8/§esimulator create §8[§7name§8] §8-§7 Erstelle SIMULATOR_CHANGE_HELP = §8/§esimulator change §8-§7 Wechsel zu einem anderen Simulator SIMULATOR_DELETE_HELP = §8/§esimulator delete §8[§7name§8] §8-§7 Löscht den Simulator SIMULATOR_START_HELP = §8/§esimulator start §8[§7name§8] §8-§7 Startet die Simulation +SIMULATOR_COPY_HELP = §8/§esimulator copy §8[§7to-copy§8] §8[§7name§8] §8-§7 Kopiert einen Simulator SIMULATOR_NO_PERMS = §cDu darfst hier nicht den Simulator nutzen SIMULATOR_GUI_ITEM_NAME = §eTNT Simulator diff --git a/BauSystem_Main/src/BauSystem_nl.properties b/BauSystem_Main/src/BauSystem_nl.properties index 4a56c78b..571f8873 100644 --- a/BauSystem_Main/src/BauSystem_nl.properties +++ b/BauSystem_Main/src/BauSystem_nl.properties @@ -497,6 +497,7 @@ SIMULATOR_CREATE_HELP = §8/§esimulator create §8[§7name§8] §8-§7 Create a SIMULATOR_CHANGE_HELP = §8/§esimulator change §8-§7 Change your simulator wand selection SIMULATOR_DELETE_HELP = §8/§esimulator delete §8[§7name§8] §8-§7 Deletes the simulator SIMULATOR_START_HELP = §8/§esimulator start §8[§7name§8] §8-§7 Starts the simulator +SIMULATOR_COPY_HELP = §8/§esimulator copy §8[§7to-copy§8] §8[§7name§8] §8-§7 Copy the simulator SIMULATOR_NO_PERMS = §cYou are not allowed to use the simulator here SIMULATOR_GUI_ITEM_NAME = §eTNT Simulator diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java index e97f9046..db38aabe 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java @@ -97,6 +97,20 @@ public class SimulatorCommand extends SWCommand { tntSimulator.start(p); } + @Register(value = "copy", description = "SIMULATOR_COPY_HELP") + public void copy(@Validator Player p, @Mapper("simulators") String toCopy, String name) { + TNTSimulator tntSimulator = SimulatorStorage.getSimulator(toCopy); + if (tntSimulator == null) { + BauSystem.MESSAGE.send("SIMULATOR_NOT_EXISTS", p); + return; + } + if (SimulatorStorage.getSimulator(name) != null) { + BauSystem.MESSAGE.send("SIMULATOR_NAME_ALREADY_EXISTS", p); + return; + } + SimulatorStorage.copySimulator(tntSimulator, name); + } + @Mapper("simulators") public TypeMapper allSimulators() { return new TypeMapper() { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorStorage.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorStorage.java index a75196c1..074298d8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorStorage.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorStorage.java @@ -115,6 +115,10 @@ public class SimulatorStorage implements Enable, Disable { new File(simulatorsDir, name + ".simulator").delete(); } + public static void copySimulator(TNTSimulator tntSimulator, String name) { + tntSimulators.put(name, new TNTSimulator(tntSimulator.toYAPION())); + } + public static void removeSimulator(ItemStack itemStack) { if (!ItemUtils.isItem(itemStack, "simulator")) { return;