From 25116c3865f9fe9a36102162338bb479796a4370 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 3 Jan 2026 02:30:36 +0100 Subject: [PATCH 1/2] Add CreateKitCommand Signed-off-by: Chaoscaot --- .../features/dev/CreateKitCommand.java | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/dev/CreateKitCommand.java diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/dev/CreateKitCommand.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/dev/CreateKitCommand.java new file mode 100644 index 00000000..2f0fc185 --- /dev/null +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/dev/CreateKitCommand.java @@ -0,0 +1,63 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2026 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.dev; + +import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Player; + +import java.io.File; +import java.io.IOException; + +@Linked +public class CreateKitCommand extends SWCommand { + public CreateKitCommand() { + super("createkit"); + if (System.getProperty("user.name").equals("minecraft")) { + unregister(); + } + } + + @Register + public void onCommand(Player player, String name) { + YamlConfiguration yaml = new YamlConfiguration(); + + yaml.set("Items", player.getInventory().getContents()); + yaml.set("Armor", player.getInventory().getArmorContents()); + yaml.set("Effects", player.getActivePotionEffects()); + yaml.set("LeaderAllowed", true); + yaml.set("MemberAllowed", true); + yaml.set("EnterStage", 0); + yaml.set("TNT", true); + + YamlConfiguration kits = new YamlConfiguration(); + + kits.set("Kits." + name, yaml); + + try { + kits.save(new File("new.kits.yaml")); + + player.sendMessage("Kit created!"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} From 703639537dc4d1c1e95f2cbdb9352c7344555c5e Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Thu, 23 Apr 2026 11:59:28 +0200 Subject: [PATCH 2/2] Fix CreateKitCommand --- .../steamwar/bausystem/features/dev/CreateKitCommand.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/dev/CreateKitCommand.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/dev/CreateKitCommand.java index 2f0fc185..8008dc25 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/dev/CreateKitCommand.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/dev/CreateKitCommand.java @@ -19,6 +19,7 @@ package de.steamwar.bausystem.features.dev; +import de.steamwar.bausystem.BauSystem; import de.steamwar.command.SWCommand; import de.steamwar.linkage.Linked; import org.bukkit.configuration.file.YamlConfiguration; @@ -29,11 +30,10 @@ import java.io.IOException; @Linked public class CreateKitCommand extends SWCommand { + public CreateKitCommand() { super("createkit"); - if (System.getProperty("user.name").equals("minecraft")) { - unregister(); - } + if (!BauSystem.DEV_SERVER) unregister(); } @Register