From f01cb668740afae24caaed5556884e468b19f520 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 1 Dec 2024 17:20:24 +0100 Subject: [PATCH] Add CraftbukkitWrapper21 for FightSystem --- FightSystem/FightSystem_21/build.gradle.kts | 43 +++++++++++++++++++ .../utils/CraftbukkitWrapper21.java | 30 +++++++++++++ FightSystem/build.gradle.kts | 1 + settings.gradle.kts | 1 + 4 files changed, 75 insertions(+) create mode 100644 FightSystem/FightSystem_21/build.gradle.kts create mode 100644 FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper21.java diff --git a/FightSystem/FightSystem_21/build.gradle.kts b/FightSystem/FightSystem_21/build.gradle.kts new file mode 100644 index 00000000..a05590d1 --- /dev/null +++ b/FightSystem/FightSystem_21/build.gradle.kts @@ -0,0 +1,43 @@ +/* + * 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 . + */ + +plugins { + steamwar.java +} + +dependencies { + compileOnly(project(":FightSystem:FightSystem_Core", "default")) + compileOnly(project(":FightSystem:FightSystem_18", "default")) + + compileOnly(libs.paperapi21) { + attributes { + // Very Hacky, but it works + attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 21) + } + } + + compileOnly(libs.nms21) { + attributes { + // Very Hacky, but it works + attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 21) + } + } + + compileOnly(libs.fastutil) +} diff --git a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper21.java b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper21.java new file mode 100644 index 00000000..9e52bb36 --- /dev/null +++ b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper21.java @@ -0,0 +1,30 @@ +/* + * 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.fightsystem.utils; + +import org.bukkit.entity.Entity; + +public class CraftbukkitWrapper21 extends CraftbukkitWrapper18 { + + @Override + public float headRotation(Entity e) { + return getEntity(e).bS(); + } +} diff --git a/FightSystem/build.gradle.kts b/FightSystem/build.gradle.kts index 3f367461..0cd412bc 100644 --- a/FightSystem/build.gradle.kts +++ b/FightSystem/build.gradle.kts @@ -37,4 +37,5 @@ dependencies { implementation(project(":FightSystem:FightSystem_18")) implementation(project(":FightSystem:FightSystem_19")) implementation(project(":FightSystem:FightSystem_20")) + implementation(project(":FightSystem:FightSystem_21")) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 29574740..69d5c67b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -198,6 +198,7 @@ include( "FightSystem:FightSystem_18", "FightSystem:FightSystem_19", "FightSystem:FightSystem_20", + "FightSystem:FightSystem_21", "FightSystem:FightSystem_Core", "FightSystem:FightSystem_Standalone" )