From e6167eef8807d4f4ca67c31619bab787fb74df56 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 18 May 2024 15:20:17 +0200 Subject: [PATCH] Add BockReplaceCommand Add DebugStickCommand Add DragonEggCommand Add DebugstickBauGuiItem --- .../src/BauSystem.properties | 9 ++- .../src/BauSystem_de.properties | 6 ++ .../itemutilities}/BookReplaceCommand.java | 21 ++++++- .../itemutilities/DebugStickCommand.java | 40 +++++++++++++ .../itemutilities/DragonEggCommand.java | 40 +++++++++++++ .../gui/DebugStickBauGuiItem.java | 57 +++++++++++++++++++ .../features/util/DebugStickCommand.java | 40 ------------- .../features/util/DragonEggCommand.java | 40 ------------- .../util/items/DebugstickBauGuiItem.java | 55 ------------------ 9 files changed, 171 insertions(+), 137 deletions(-) rename {BauSystem_Main/src/de/steamwar/bausystem/features/util => BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities}/BookReplaceCommand.java (65%) create mode 100644 BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/DebugStickCommand.java create mode 100644 BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/DragonEggCommand.java create mode 100644 BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/gui/DebugStickBauGuiItem.java delete mode 100644 BauSystem_Main/src/de/steamwar/bausystem/features/util/DebugStickCommand.java delete mode 100644 BauSystem_Main/src/de/steamwar/bausystem/features/util/DragonEggCommand.java delete mode 100644 BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java diff --git a/BauSystem_ItemUtilities/src/BauSystem.properties b/BauSystem_ItemUtilities/src/BauSystem.properties index 50a1e654..eac8b70a 100644 --- a/BauSystem_ItemUtilities/src/BauSystem.properties +++ b/BauSystem_ItemUtilities/src/BauSystem.properties @@ -25,10 +25,17 @@ COMMAND_HELP_HEAD = §7---=== (§e{0}§7) ===--- # Permissions (always needed!) NO_PERMISSION = You are not allowed to use that here -# BIND +# Bind BIND_COMMAND_HELP = §8/§ebind §8[§7Command§8] §8-§e Bind a command to item interaction BIND_COMMAND_ERROR = §cInvalid or unknown command BIND_MESSAGE_UNBINDABLE = §cCould not bind command to item BIND_MESSAGE_BIND = §7Bound command §e{0} §7to item BIND_MESSAGE_UNBIND = §7Unbound command BIND_ITEM_LORE = §eCommand§8:§7 {0} + +# Debug Stick +DEBUGSTICK_COMMAND_HELP = §8/§edebugstick §8-§7 receive a debugstick +DEBUGSTICK_ITEM_NAME = §eDebugstick + +# Dragon Egg +DRAGONEGG_COMMAND_HELP = §8/§edragonegg §8-§7 Receive a Dragon Egg diff --git a/BauSystem_ItemUtilities/src/BauSystem_de.properties b/BauSystem_ItemUtilities/src/BauSystem_de.properties index ebd93ceb..79401b5d 100644 --- a/BauSystem_ItemUtilities/src/BauSystem_de.properties +++ b/BauSystem_ItemUtilities/src/BauSystem_de.properties @@ -31,3 +31,9 @@ BIND_COMMAND_ERROR = §cFalscher oder unbekannter Befehl BIND_MESSAGE_UNBINDABLE = §cBefehl konnte nicht ans Item gebunden werden BIND_MESSAGE_BIND = §7Befehl §e{0} §7ans Item gebunden BIND_MESSAGE_UNBIND = §7Befehl vom Item entfernt + +# Debug Stick +DEBUGSTICK_COMMAND_HELP = §8/§edebugstick §8-§7 Erhalte einen DebugStick + +# Dragon Egg +DRAGONEGG_COMMAND_HELP = §8/§edragonegg §8-§7 Erhalte ein Drachenei diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/BookReplaceCommand.java b/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/BookReplaceCommand.java similarity index 65% rename from BauSystem_Main/src/de/steamwar/bausystem/features/util/BookReplaceCommand.java rename to BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/BookReplaceCommand.java index c534e38d..b79a2618 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/BookReplaceCommand.java +++ b/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/BookReplaceCommand.java @@ -1,4 +1,23 @@ -package de.steamwar.bausystem.features.util; +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.itemutilities; import de.steamwar.command.SWCommand; import de.steamwar.linkage.Linked; diff --git a/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/DebugStickCommand.java b/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/DebugStickCommand.java new file mode 100644 index 00000000..a87bffbb --- /dev/null +++ b/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/DebugStickCommand.java @@ -0,0 +1,40 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.itemutilities; + +import de.steamwar.bausystem.SWUtils; +import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +@Linked +public class DebugStickCommand extends SWCommand { + + public DebugStickCommand() { + super("debugstick"); + } + + @Register(description = "DEBUGSTICK_COMMAND_HELP") + public void genericCommand(@Validator Player p) { + SWUtils.giveItemToPlayer(p, new ItemStack(Material.DEBUG_STICK)); + } +} diff --git a/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/DragonEggCommand.java b/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/DragonEggCommand.java new file mode 100644 index 00000000..963887cf --- /dev/null +++ b/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/DragonEggCommand.java @@ -0,0 +1,40 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.itemutilities; + +import de.steamwar.bausystem.SWUtils; +import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +@Linked +public class DragonEggCommand extends SWCommand { + + public DragonEggCommand() { + super("dragonegg", "enderdragon", "dragon", "egg", "enderei", "ender"); + } + + @Register(description = "DRAGONEGG_COMMAND_HELP") + public void genericCommand(Player p) { + SWUtils.giveItemToPlayer(p, new ItemStack(Material.DRAGON_EGG, 1)); + } +} diff --git a/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/gui/DebugStickBauGuiItem.java b/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/gui/DebugStickBauGuiItem.java new file mode 100644 index 00000000..91ec1d39 --- /dev/null +++ b/BauSystem_ItemUtilities/src/de/steamwar/bausystem/itemutilities/gui/DebugStickBauGuiItem.java @@ -0,0 +1,57 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2024 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.itemutilities.gui; + +import de.steamwar.bausystem.BauSystemPlugin; +import de.steamwar.bausystem.Permission; +import de.steamwar.bausystem.linkage.specific.BauGuiItem; +import de.steamwar.inventory.SWItem; +import de.steamwar.linkage.Linked; +import de.steamwar.linkage.PluginCheck; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.inventory.ItemStack; + +@Linked +@PluginCheck("BauSystem_GUI") +public class DebugStickBauGuiItem extends BauGuiItem { + + public DebugStickBauGuiItem() { + super(12); + } + + @Override + public ItemStack getItem(Player player) { + return new SWItem(Material.DEBUG_STICK, BauSystemPlugin.MESSAGE.parse("DEBUGSTICK_ITEM_NAME", player)).getItemStack(); + } + + @Override + public boolean click(ClickType click, Player p) { + p.closeInventory(); + p.performCommand("debugstick"); + return false; + } + + @Override + public Permission permission() { + return Permission.BUILD; + } +} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/DebugStickCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/DebugStickCommand.java deleted file mode 100644 index 5b87464c..00000000 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/DebugStickCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is a part of the SteamWar software. - * - * Copyright (C) 2021 SteamWar.de-Serverteam - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package de.steamwar.bausystem.features.util; - -import de.steamwar.bausystem.SWUtils; -import de.steamwar.command.SWCommand; -import de.steamwar.linkage.Linked; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - -@Linked -public class DebugStickCommand extends SWCommand { - - public DebugStickCommand() { - super("debugstick"); - } - - @Register(description = "DEBUG_STICK_COMMAND_HELP") - public void genericCommand(@Validator Player p) { - SWUtils.giveItemToPlayer(p, new ItemStack(Material.DEBUG_STICK)); - } -} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/DragonEggCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/DragonEggCommand.java deleted file mode 100644 index b9cc7442..00000000 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/DragonEggCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is a part of the SteamWar software. - * - * Copyright (C) 2023 SteamWar.de-Serverteam - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package de.steamwar.bausystem.features.util; - -import de.steamwar.bausystem.SWUtils; -import de.steamwar.command.SWCommand; -import de.steamwar.linkage.Linked; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - -@Linked -public class DragonEggCommand extends SWCommand { - - public DragonEggCommand() { - super("dragonegg", "enderdragon", "dragon", "egg", "enderei", "ender"); - } - - @Register(description = "DRAGON_EGG_COMMAND_HELP") - public void genericCommand(Player p) { - SWUtils.giveItemToPlayer(p, new ItemStack(Material.DRAGON_EGG, 1)); - } -} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java deleted file mode 100644 index c6341818..00000000 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/DebugstickBauGuiItem.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * This file is a part of the SteamWar software. - * - * Copyright (C) 2021 SteamWar.de-Serverteam - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package de.steamwar.bausystem.features.util.items; - -import de.steamwar.bausystem.BauSystem; -import de.steamwar.bausystem.Permission; -import de.steamwar.bausystem.linkage.specific.BauGuiItem; -import de.steamwar.inventory.SWItem; -import de.steamwar.linkage.Linked; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.inventory.ItemStack; - -@Linked -public class DebugstickBauGuiItem extends BauGuiItem { - - public DebugstickBauGuiItem() { - super(12); - } - - @Override - public ItemStack getItem(Player player) { - return new SWItem(Material.DEBUG_STICK, BauSystem.MESSAGE.parse("DEBUG_STICK_NAME", player)).getItemStack(); - } - - @Override - public boolean click(ClickType click, Player p) { - p.closeInventory(); - p.performCommand("debugstick"); - return false; - } - - @Override - public Permission permission() { - return Permission.BUILD; - } -}