diff --git a/FightSystem/FightSystem_10/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper10.java b/FightSystem/FightSystem_10/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper10.java
index 78dd79a5..d5f654ae 100644
--- a/FightSystem/FightSystem_10/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper10.java
+++ b/FightSystem/FightSystem_10/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper10.java
@@ -55,4 +55,7 @@ public class CraftbukkitWrapper10 implements CraftbukkitWrapper {
public Stream> entityIterator() {
return ((CraftWorld) Config.world).getHandle().entityList.stream();
}
+
+ @Override
+ public void setupGamerule() { }
}
diff --git a/FightSystem/FightSystem_12/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper12.java b/FightSystem/FightSystem_12/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper12.java
index f8e843bc..a134b9fe 100644
--- a/FightSystem/FightSystem_12/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper12.java
+++ b/FightSystem/FightSystem_12/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper12.java
@@ -55,4 +55,7 @@ public class CraftbukkitWrapper12 implements CraftbukkitWrapper {
public Stream> entityIterator() {
return ((CraftWorld) Config.world).getHandle().entityList.stream();
}
+
+ @Override
+ public void setupGamerule() { }
}
diff --git a/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper14.java b/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper14.java
index 07c525d4..8e2f96ab 100644
--- a/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper14.java
+++ b/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper14.java
@@ -56,4 +56,7 @@ public class CraftbukkitWrapper14 implements CraftbukkitWrapper {
public Stream> entityIterator() {
return ((CraftWorld) Config.world).getHandle().entitiesById.values().stream();
}
+
+ @Override
+ public void setupGamerule() { }
}
diff --git a/FightSystem/FightSystem_15/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper15.java b/FightSystem/FightSystem_15/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper15.java
index 70d9e8c5..64a0f9e1 100644
--- a/FightSystem/FightSystem_15/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper15.java
+++ b/FightSystem/FightSystem_15/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper15.java
@@ -56,4 +56,7 @@ public class CraftbukkitWrapper15 implements CraftbukkitWrapper {
public Stream> entityIterator() {
return ((CraftWorld) Config.world).getHandle().entitiesById.values().stream();
}
+
+ @Override
+ public void setupGamerule() { }
}
diff --git a/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper18.java b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper18.java
index 8fa8e7de..aafd5c08 100644
--- a/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper18.java
+++ b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper18.java
@@ -62,4 +62,7 @@ public class CraftbukkitWrapper18 implements CraftbukkitWrapper {
public Stream> entityIterator() {
return StreamSupport.stream(((Iterable>) getIterable.invoke(getWorldEntities.invoke(getWorld.invoke(Config.world)))).spliterator(), false);
}
+
+ @Override
+ public void setupGamerule() { }
}
diff --git a/FightSystem/FightSystem_21/build.gradle.kts b/FightSystem/FightSystem_21/build.gradle.kts
index a05590d1..2da59fce 100644
--- a/FightSystem/FightSystem_21/build.gradle.kts
+++ b/FightSystem/FightSystem_21/build.gradle.kts
@@ -24,6 +24,7 @@ plugins {
dependencies {
compileOnly(project(":FightSystem:FightSystem_Core", "default"))
compileOnly(project(":FightSystem:FightSystem_18", "default"))
+ compileOnly(project(":SpigotCore", "default"))
compileOnly(libs.paperapi21) {
attributes {
@@ -40,4 +41,5 @@ dependencies {
}
compileOnly(libs.fastutil)
+ compileOnly(libs.authlib)
}
diff --git a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/BlockIdWrapper21.java b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/BlockIdWrapper21.java
new file mode 100644
index 00000000..105bbe36
--- /dev/null
+++ b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/BlockIdWrapper21.java
@@ -0,0 +1,77 @@
+/*
+ * This file is a part of the SteamWar software.
+ *
+ * Copyright (C) 2025 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.TinyProtocol;
+import com.mojang.authlib.GameProfile;
+import de.steamwar.core.ProtocolWrapper;
+import de.steamwar.fightsystem.FightSystem;
+import net.minecraft.core.BlockPos;
+import net.minecraft.server.level.ServerLevel;
+import net.minecraft.world.level.block.state.BlockState;
+import org.bukkit.GameMode;
+import org.bukkit.Material;
+import org.bukkit.World;
+import org.bukkit.block.Block;
+import org.bukkit.craftbukkit.CraftWorld;
+import org.bukkit.craftbukkit.block.CraftBlockState;
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Player;
+
+public class BlockIdWrapper21 implements BlockIdWrapper {
+
+ @Override
+ public Material idToMaterial(int blockState) {
+ return CraftMagicNumbers.getMaterial(net.minecraft.world.level.block.Block.stateById(blockState)).getItemType();
+ }
+
+ @Override
+ public int blockToId(Block block) {
+ return net.minecraft.world.level.block.Block.getId(((CraftBlockState) block.getState()).getHandle());
+ }
+
+ @Override
+ public void setBlock(World world, int x, int y, int z, int blockState) {
+ BlockState blockData = net.minecraft.world.level.block.Block.stateById(blockState);
+ ServerLevel level = ((CraftWorld) world).getHandle();
+ BlockPos pos = new BlockPos(x, y, z);
+
+ level.removeBlockEntity(pos);
+ level.setBlock(pos, blockData, blockState);
+ level.getChunkSource().blockChanged(pos);
+ }
+
+ @Override
+ public void trackEntity(Player player, Entity entity) {
+ if(entity instanceof Player)
+ TinyProtocol.instance.sendPacket(player, ProtocolWrapper.impl.playerInfoPacketConstructor(ProtocolWrapper.PlayerInfoAction.REMOVE, new GameProfile(entity.getUniqueId(), entity.getName()), GameMode.CREATIVE));
+
+ player.showEntity(FightSystem.getPlugin(), entity);
+ }
+
+ @Override
+ public void untrackEntity(Player player, Entity entity) {
+ player.hideEntity(FightSystem.getPlugin(), entity);
+
+ if(entity instanceof Player)
+ TinyProtocol.instance.sendPacket(player, ProtocolWrapper.impl.playerInfoPacketConstructor(ProtocolWrapper.PlayerInfoAction.ADD, new GameProfile(entity.getUniqueId(), entity.getName()), GameMode.CREATIVE));
+ }
+}
diff --git a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper21.java b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper21.java
index b5c920a7..312dce88 100644
--- a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper21.java
+++ b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper21.java
@@ -19,12 +19,43 @@
package de.steamwar.fightsystem.utils;
+import de.steamwar.fightsystem.Config;
+import net.minecraft.core.BlockPos;
+import net.minecraft.world.level.chunk.LevelChunk;
+import net.minecraft.world.level.chunk.LevelChunkSection;
+import org.bukkit.GameRule;
+import org.bukkit.World;
+import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.entity.Entity;
+import java.util.HashSet;
+import java.util.Set;
+
public class CraftbukkitWrapper21 extends CraftbukkitWrapper18 {
@Override
public float headRotation(Entity e) {
return getEntity(e).getYHeadRot();
}
+
+ @Override
+ public void setupGamerule() {
+ Config.world.setGameRule(GameRule.LOCATOR_BAR, false);
+ }
+
+ private LevelChunk getChunk(World world, int x, int z) {
+ return ((CraftWorld) world).getHandle().getChunk(x, z);
+ }
+
+ @Override
+ public void resetChunk(World world, World backup, int x, int z) {
+ LevelChunk worldChunk = getChunk(world, x, z);
+ LevelChunk backupChunk = getChunk(backup, x, z);
+ LevelChunkSection[] sections = worldChunk.getSections();
+ System.arraycopy(backupChunk.getSections(), 0, sections, 0, sections.length);
+ Set blocks = new HashSet<>(worldChunk.blockEntities.keySet());
+ blocks.stream().filter(key -> !backupChunk.blockEntities.containsKey(key)).forEach(worldChunk::removeBlockEntity);
+ worldChunk.heightmaps.clear();
+ worldChunk.heightmaps.putAll(backupChunk.heightmaps);
+ }
}
diff --git a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java
new file mode 100644
index 00000000..118bfba1
--- /dev/null
+++ b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java
@@ -0,0 +1,36 @@
+/*
+ * This file is a part of the SteamWar software.
+ *
+ * Copyright (C) 2025 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 io.papermc.paper.datacomponent.DataComponentTypes;
+import org.bukkit.entity.Player;
+import org.bukkit.inventory.ItemStack;
+
+public class ReflectionWrapper21 implements ReflectionWrapper {
+ @Override
+ public Object explosionHider(Player player, Object packet, PacketHiderFunction packetHiderFunction) {
+ return packet;
+ }
+
+ @Override
+ public boolean hasItems(ItemStack stack) {
+ return stack.getDataTypes().stream().anyMatch(dataComponentType -> dataComponentType != DataComponentTypes.ENCHANTMENTS || dataComponentType != DataComponentTypes.DAMAGE);
+ }
+}
diff --git a/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper8.java b/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper8.java
index 8d743ae7..e7597dd7 100644
--- a/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper8.java
+++ b/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper8.java
@@ -52,4 +52,7 @@ public class CraftbukkitWrapper8 implements CraftbukkitWrapper {
public Stream> entityIterator() {
return ((CraftWorld) Config.world).getHandle().entityList.stream();
}
+
+ @Override
+ public void setupGamerule() { }
}
diff --git a/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/ReflectionWrapper8.java b/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/ReflectionWrapper8.java
new file mode 100644
index 00000000..6da5308a
--- /dev/null
+++ b/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/ReflectionWrapper8.java
@@ -0,0 +1,59 @@
+/*
+ * This file is a part of the SteamWar software.
+ *
+ * Copyright (C) 2025 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 de.steamwar.Reflection;
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.bukkit.inventory.ItemStack;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Function;
+
+public class ReflectionWrapper8 implements ReflectionWrapper {
+
+ private static final Class> packetPlayOutExplosion = Reflection.getClass("net.minecraft.network.protocol.game.ClientboundExplodePacket");
+ private static final Reflection.Field explosionBlocks = Reflection.getField(packetPlayOutExplosion, List.class, 0);
+ private static final Function