From 4feb36c52dc2ee1bfc79ec0dfa4dfd70ba48ac25 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 1 Nov 2021 15:50:09 +0100 Subject: [PATCH] Add StructureVoidCommand Signed-off-by: yoyosource --- BauSystem_Main/src/BauSystem.properties | 2 + .../features/util/StructureVoidCommand.java | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 BauSystem_Main/src/de/steamwar/bausystem/features/util/StructureVoidCommand.java diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 0dbd88aa..54d8cc81 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -387,6 +387,8 @@ OTHER_TIME_RESULT=§7§oWhooosh OTHER_WORLDSPAWN_HELP_1=§8/§eworldspawn §8-§e Teleportiere dich zum Spawn # DebugStick DEBUG-STICK_COMMAND_HELP=§8/§edebugstick §8-§7 Erhalte einen DebugStick +# StructureVoid +STRUCTURE-VOID_COMMAND_HELP=§8/§estructureVoid §8-§7 Erhalte ein StructureVoid # NightVision NIGHT-VISION_COMMAND_HELP=§8/§enightvision §8-§7 Schalte Nightvision an oder aus. NIGHT-VISION_OFF=§eNightvision deaktiviert diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/StructureVoidCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/StructureVoidCommand.java new file mode 100644 index 00000000..a2f435c2 --- /dev/null +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/StructureVoidCommand.java @@ -0,0 +1,48 @@ +/* + * 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.BauSystem; +import de.steamwar.bausystem.SWUtils; +import de.steamwar.bausystem.linkage.LinkageType; +import de.steamwar.bausystem.linkage.Linked; +import de.steamwar.command.SWCommand; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +@Linked(LinkageType.COMMAND) +public class StructureVoidCommand extends SWCommand { + + public StructureVoidCommand() { + super("structureVoid", "structure", "void", "structurevoid"); + } + + @Register(help = true) + public void genericHelp(Player p, String... args) { + BauSystem.MESSAGE.send("COMMAND_HELP_HEAD", p, "structureVoid"); + BauSystem.MESSAGE.send("STRUCTURE-VOID_COMMAND_HELP", p); + } + + @Register + public void genericCommand(Player p) { + SWUtils.giveItemToPlayer(p, new ItemStack(Material.STRUCTURE_VOID, 1)); + } +}