diff --git a/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/BlockIdWrapper14.java b/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/BlockIdWrapper14.java
index f2330e12..5030cb04 100644
--- a/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/BlockIdWrapper14.java
+++ b/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/BlockIdWrapper14.java
@@ -26,6 +26,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
+import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import java.util.Map;
@@ -72,16 +73,16 @@ public class BlockIdWrapper14 implements BlockIdWrapper {
private static final Class> entityTracker = Reflection.getClass("{nms.server.level}.PlayerChunkMap$EntityTracker");
private static final Reflection.MethodInvoker updatePlayer = Reflection.getMethod(entityTracker, Core.getVersion() > 15 ? "b" : "updatePlayer", entityPlayer);
@Override
- public void trackEntity(Player player, int entity) {
- Object tracker = trackers.get(entity);
+ public void trackEntity(Player player, Entity entity) {
+ Object tracker = trackers.get(entity.getEntityId());
if(tracker != null)
updatePlayer.invoke(tracker, getPlayer.invoke(player));
}
private static final Reflection.MethodInvoker clearPlayer = Reflection.getMethod(entityTracker, Core.getVersion() > 15 ? "a" : "clear", entityPlayer);
@Override
- public void untrackEntity(Player player, int entity) {
- Object tracker = trackers.get(entity);
+ public void untrackEntity(Player player, Entity entity) {
+ Object tracker = trackers.get(entity.getEntityId());
if(tracker != null)
clearPlayer.invoke(tracker, getPlayer.invoke(player));
}
diff --git a/FightSystem/FightSystem_18/build.gradle.kts b/FightSystem/FightSystem_18/build.gradle.kts
index fa12144d..b140d148 100644
--- a/FightSystem/FightSystem_18/build.gradle.kts
+++ b/FightSystem/FightSystem_18/build.gradle.kts
@@ -24,6 +24,7 @@ plugins {
dependencies {
compileOnly(project(":SpigotCore", "default"))
compileOnly(project(":FightSystem:FightSystem_Core", "default"))
+ compileOnly(project(":FightSystem:FightSystem_14", "default"))
compileOnly(libs.spigotapi)
diff --git a/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java
new file mode 100644
index 00000000..d1ad4197
--- /dev/null
+++ b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java
@@ -0,0 +1,45 @@
+/*
+ * 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 com.comphenix.tinyprotocol.Reflection;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Player;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+public class BlockIdWrapper18 extends BlockIdWrapper14 {
+
+ private static final Reflection.FieldAccessor