From 8050f514241f2e7d33e1dc1cf092affa5e7ac59a Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Wed, 10 Jun 2026 21:43:02 +0200 Subject: [PATCH] Cleanup for Merge Signed-off-by: Chaoscaot --- .../bausystem/features/TestCommand.java | 38 -------------- BauSystem/build.gradle.kts | 1 - .../src/de/steamwar/kotlin/ui/TestInv.kt | 50 ------------------- .../src/de/steamwar/kotlin/ui/UIWindow.kt | 10 ++-- .../src/de/steamwar/kotlin/util/ItemUtils.kt | 2 - 5 files changed, 4 insertions(+), 97 deletions(-) delete mode 100644 BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/TestCommand.java delete mode 100644 KotlinCore/src/de/steamwar/kotlin/ui/TestInv.kt diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/TestCommand.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/TestCommand.java deleted file mode 100644 index 2aa35725..00000000 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/TestCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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; - -import de.steamwar.command.SWCommand; -import de.steamwar.kotlin.ui.TestInv; -import de.steamwar.linkage.Linked; -import org.bukkit.entity.Player; - -@Linked -public class TestCommand extends SWCommand { - public TestCommand() { - super("supertestcommand"); - } - - @Register - public void test(Player player) { - TestInv inv = new TestInv(player); - inv.open(); - } -} diff --git a/BauSystem/build.gradle.kts b/BauSystem/build.gradle.kts index f2843bcf..6a6bfac5 100644 --- a/BauSystem/build.gradle.kts +++ b/BauSystem/build.gradle.kts @@ -39,5 +39,4 @@ tasks.register("DevBau21") { dependsOn(":SchematicSystem:shadowJar") dependsOn(":KotlinCore:shadowJar") template = "Bau21" - worldName = "73" } diff --git a/KotlinCore/src/de/steamwar/kotlin/ui/TestInv.kt b/KotlinCore/src/de/steamwar/kotlin/ui/TestInv.kt deleted file mode 100644 index f4e12f26..00000000 --- a/KotlinCore/src/de/steamwar/kotlin/ui/TestInv.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.kotlin.ui - -import de.steamwar.kotlin.ui.components.item -import org.bukkit.Material -import org.bukkit.entity.Player -import org.bukkit.inventory.ItemStack - -class TestInv(player: Player): UIInventory(player) { - - override fun view() { - inventory(3, title = "TEST_TITLE") { - group { - item { - var test by Test.test.listen() - - x = test % 9 - y = 1 - item = ItemStack.of(Material.STONE, test) - - onClick { - test++ - } - } - } - } - } -} - -object Test { - val test = Observer(1) -} diff --git a/KotlinCore/src/de/steamwar/kotlin/ui/UIWindow.kt b/KotlinCore/src/de/steamwar/kotlin/ui/UIWindow.kt index e9398689..87eead32 100644 --- a/KotlinCore/src/de/steamwar/kotlin/ui/UIWindow.kt +++ b/KotlinCore/src/de/steamwar/kotlin/ui/UIWindow.kt @@ -70,9 +70,8 @@ class UIWindow(val player: Player, val render: WindowContext.() -> Unit): Invent @EventHandler fun onInventoryClick(event: InventoryClickEvent) { - if (event.inventory.holder is UIWindow) { - val window = event.inventory.holder as UIWindow - + val window = event.inventory.holder + if (window is UIWindow) { event.isCancelled = true if (window.context.skipDoubleClick && event.click == ClickType.DOUBLE_CLICK) return @@ -82,9 +81,8 @@ class UIWindow(val player: Player, val render: WindowContext.() -> Unit): Invent @EventHandler fun onInventoryClose(event: InventoryCloseEvent) { - if (event.inventory.holder is UIWindow) { - val window = event.inventory.holder as UIWindow - + val window = event.inventory.holder + if (window is UIWindow) { window.onClose() } } diff --git a/KotlinCore/src/de/steamwar/kotlin/util/ItemUtils.kt b/KotlinCore/src/de/steamwar/kotlin/util/ItemUtils.kt index d504c679..7f709c64 100644 --- a/KotlinCore/src/de/steamwar/kotlin/util/ItemUtils.kt +++ b/KotlinCore/src/de/steamwar/kotlin/util/ItemUtils.kt @@ -48,5 +48,3 @@ fun ItemStack.hideAttributes() = apply { itemMeta = itemMeta.also { it.addItemFl fun ItemStack.enchanted() = apply { itemMeta = itemMeta.also { it.addEnchant(Enchantment.UNBREAKING, 10, true) } } fun ItemStack.customModelData(model: CustomModelDataComponent) = apply { itemMeta = itemMeta.also { it.setCustomModelDataComponent(model) } } - -