From 818a437ee0c0660455a1b19a3a39c963c3473047 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 28 Aug 2026 20:17:59 +0200 Subject: [PATCH] Update DynamicRegionEditor --- .../bausystem/region/DynamicRegionEditor.java | 12 +++------ BauSystem/build.gradle.kts | 3 ++- .../steamwar/entity/RInteractionCallback.java | 26 ------------------- 3 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RInteractionCallback.java diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/DynamicRegionEditor.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/DynamicRegionEditor.java index cd63af52..719c694d 100644 --- a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/DynamicRegionEditor.java +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/DynamicRegionEditor.java @@ -20,7 +20,6 @@ package de.steamwar.bausystem.region; import com.comphenix.tinyprotocol.TinyProtocol; -import de.steamwar.Reflection; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.region.dynamic.DynamicRegion; @@ -39,6 +38,7 @@ import de.steamwar.inventory.SWListInv; import lombok.NonNull; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.chat.TextComponent; +import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -61,18 +61,14 @@ import java.util.function.BiFunction; public class DynamicRegionEditor implements SWPlayer.Component, Listener { - private static final Class position = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Pos"); - private static final Class look = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Rot"); - private static final Class positionLook = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot"); - static { BiFunction function = (player, object) -> { SWPlayer.of(player).getComponent(DynamicRegionEditor.class).ifPresent(DynamicRegionEditor::calcCursor); return object; }; - TinyProtocol.instance.addFilter(position, function); - TinyProtocol.instance.addFilter(look, function); - TinyProtocol.instance.addFilter(positionLook, function); + TinyProtocol.instance.addFilter(ServerboundMovePlayerPacket.Pos.class, function); + TinyProtocol.instance.addFilter(ServerboundMovePlayerPacket.Rot.class, function); + TinyProtocol.instance.addFilter(ServerboundMovePlayerPacket.PosRot.class, function); } private final REntityServer entityServer = new REntityServer(); diff --git a/BauSystem/build.gradle.kts b/BauSystem/build.gradle.kts index 8f2b0c60..6b992481 100644 --- a/BauSystem/build.gradle.kts +++ b/BauSystem/build.gradle.kts @@ -48,6 +48,7 @@ tasks.register("DevBau21Dynamic") { dependsOn(":SpigotCore:shadowJar") dependsOn(":BauSystem:shadowJar") dependsOn(":SchematicSystem:shadowJar") - template = "Bau21-Dynamic" + dependsOn(":KotlinCore:shadowJar") + template = "BauDynamic21" jar = "/jars/paper-1.21.6.jar" } diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RInteractionCallback.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RInteractionCallback.java deleted file mode 100644 index 938cbfa3..00000000 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RInteractionCallback.java +++ /dev/null @@ -1,26 +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.entity; - -import org.bukkit.entity.Player; - -public interface RInteractionCallback { - void call(Player player, RInteraction interaction, REntityServer.EntityAction entityAction); -}