From f0a9c5c3147d1ecff1ebca2d5b09add0446f5aaa Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 19 Dec 2021 16:58:52 +0100 Subject: [PATCH] Configuration Signed-off-by: Lixfel --- FightSystem_18/pom.xml | 60 +++++++++++++++++++ FightSystem_Core/pom.xml | 21 +++++-- .../steamwar/fightsystem/utils/TechHider.java | 26 ++++---- FightSystem_Main/pom.xml | 6 ++ pom.xml | 13 ++++ 5 files changed, 109 insertions(+), 17 deletions(-) create mode 100644 FightSystem_18/pom.xml diff --git a/FightSystem_18/pom.xml b/FightSystem_18/pom.xml new file mode 100644 index 0000000..d854f64 --- /dev/null +++ b/FightSystem_18/pom.xml @@ -0,0 +1,60 @@ + + + + + 4.0.0 + + + steamwar + FightSystem + 1.0 + + + + ${project.basedir}/.. + + + FightSystem_18 + 1.0 + + + + steamwar + Spigot + 1.18 + system + ${main.basedir}/lib/Spigot-1.18.jar + + + steamwar + WorldEdit + 1.0 + system + ${main.basedir}/lib/WorldEdit-1.15.jar + + + steamwar + FightSystem_Core + 1.0 + + + \ No newline at end of file diff --git a/FightSystem_Core/pom.xml b/FightSystem_Core/pom.xml index a9f81ed..f427dfc 100644 --- a/FightSystem_Core/pom.xml +++ b/FightSystem_Core/pom.xml @@ -19,11 +19,22 @@ - steamwar - Spigot - 1.15 - system - ${main.basedir}/lib/Spigot-1.15.jar + org.spigotmc + spigot-api + 1.18-R0.1-SNAPSHOT + provided + + + io.netty + netty-all + 4.1.68.Final + provided + + + com.mojang + authlib + 1.5.25 + provided steamwar diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/utils/TechHider.java b/FightSystem_Core/src/de/steamwar/fightsystem/utils/TechHider.java index 61d9085..1c27435 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/utils/TechHider.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/utils/TechHider.java @@ -43,15 +43,15 @@ import java.util.stream.Collectors; public class TechHider extends StateDependent { - private static final Class blockPosition = Reflection.getClass("{nms}.BlockPosition"); - private static final Class baseBlockPosition = Reflection.getClass("{nms}.BaseBlockPosition"); + private static final Class blockPosition = Reflection.getClass("{nms.core}.BlockPosition"); + private static final Class baseBlockPosition = Reflection.getClass("{nms.core}.BaseBlockPosition"); private static final Reflection.FieldAccessor blockPositionX = Reflection.getField(baseBlockPosition, int.class, 0); private static final Reflection.FieldAccessor blockPositionZ = Reflection.getField(baseBlockPosition, int.class, 2); - private static final Class iBlockData = Reflection.getClass("{nms}.IBlockData"); - private static final Class block = Reflection.getClass("{nms}.Block"); - private static final Reflection.MethodInvoker getBlockByBlockData = Reflection.getTypedMethod(iBlockData, "getBlock", block); - private static final Reflection.MethodInvoker getBlockDataByBlock = Reflection.getTypedMethod(block, "getBlockData", iBlockData); + private static final Class iBlockData = Reflection.getClass("{nms.world.level.block.state}.IBlockData"); + private static final Class block = Reflection.getClass("{nms.world.level.block}.Block"); + private static final Reflection.MethodInvoker getBlockByBlockData = Reflection.getTypedMethod(iBlockData, null, block); + private static final Reflection.MethodInvoker getBlockDataByBlock = Reflection.getTypedMethod(block, null, iBlockData); private static final Class craftMagicNumbers = Reflection.getClass("{obc}.util.CraftMagicNumbers"); private static final Reflection.MethodInvoker getMaterialByBlock = Reflection.getTypedMethod(craftMagicNumbers, "getMaterial", Material.class, block); @@ -76,14 +76,14 @@ public class TechHider extends StateDependent { techhiders.put(mapChunkPacket, this::mapChunkHider); } if(Core.getVersion() > 12) { - Class blockBreakClass = Reflection.getClass("{nms}.PacketPlayOutBlockBreak"); + Class blockBreakClass = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutBlockBreak"); techhiders.put(blockBreakClass, blockBreakHiderGenerator(blockBreakClass)); } if(Core.getVersion() > 8){ - ProtocolAPI.setIncomingHandler(Reflection.getClass("{nms}.PacketPlayInUseItem"), (p, packet) -> p.getGameMode() == GameMode.SPECTATOR ? null : packet); + ProtocolAPI.setIncomingHandler(Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseItem"), (p, packet) -> p.getGameMode() == GameMode.SPECTATOR ? null : packet); } - ProtocolAPI.setIncomingHandler(Reflection.getClass("{nms}.PacketPlayInUseEntity"), (p, packet) -> p.getGameMode() == GameMode.SPECTATOR ? null : packet); + ProtocolAPI.setIncomingHandler(Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseEntity"), (p, packet) -> p.getGameMode() == GameMode.SPECTATOR ? null : packet); register(); } @@ -98,9 +98,10 @@ public class TechHider extends StateDependent { techhiders.keySet().forEach(ProtocolAPI::removeOutgoingHandler); } - private static final Class nbtTagCompound = Reflection.getClass("{nms}.NBTTagCompound"); - private static final Reflection.MethodInvoker nbtTagGetString = Reflection.getTypedMethod(nbtTagCompound, "getString", String.class, String.class); + private static final Class nbtTagCompound = Reflection.getClass("{nms.nbt}.NBTTagCompound"); + private static final Reflection.MethodInvoker nbtTagGetString = Reflection.getTypedMethod(nbtTagCompound, null, String.class, String.class); + //TODO private static final Class mapChunkPacket = Reflection.getClass("{nms}.PacketPlayOutMapChunk"); private static final UnaryOperator mapChunkCloner = ProtocolAPI.shallowCloneGenerator(mapChunkPacket); private static final Reflection.FieldAccessor mapChunkX = Reflection.getField(mapChunkPacket, int.class, 0); @@ -134,7 +135,8 @@ public class TechHider extends StateDependent { return packet; } - private static final Class multiBlockChangePacket = Reflection.getClass("{nms}.PacketPlayOutMultiBlockChange"); + private static final Class multiBlockChangePacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutMultiBlockChange"); + //TODO private static final UnaryOperator multiBlockChangeCloner = ProtocolAPI.shallowCloneGenerator(multiBlockChangePacket); private static final Class chunkCoordinateIntPair = Reflection.getClass("{nms}.ChunkCoordIntPair"); private static final Reflection.FieldAccessor multiBlockChangeChunk = Reflection.getField(multiBlockChangePacket, chunkCoordinateIntPair, 0); diff --git a/FightSystem_Main/pom.xml b/FightSystem_Main/pom.xml index 2cd94da..a42f01d 100644 --- a/FightSystem_Main/pom.xml +++ b/FightSystem_Main/pom.xml @@ -92,6 +92,12 @@ 1.0 compile + + steamwar + FightSystem_18 + 1.0 + compile + steamwar FightSystem_Core diff --git a/pom.xml b/pom.xml index 35a72ae..aeee40f 100644 --- a/pom.xml +++ b/pom.xml @@ -57,10 +57,23 @@ FightSystem_12 FightSystem_14 FightSystem_15 + FightSystem_18 FightSystem_Core FightSystem_Main + + + minecraft-libraries + Minecraft Libraries + https://libraries.minecraft.net + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + steamwar