diff --git a/BauSystem/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java b/BauSystem/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java index f279980d..37ec1c93 100644 --- a/BauSystem/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java +++ b/BauSystem/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java @@ -114,7 +114,7 @@ public class NMSWrapper15 implements NMSWrapper { return invalid; } - private final Class explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion"); + private final Class explosionPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutExplosion"); private final Reflection.Field a = Reflection.getField(explosionPacket, double.class, 0); private final Reflection.Field b = Reflection.getField(explosionPacket, double.class, 1); private final Reflection.Field c = Reflection.getField(explosionPacket, double.class, 2); diff --git a/BauSystem/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java b/BauSystem/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java index 22438d02..d3abe191 100644 --- a/BauSystem/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java +++ b/BauSystem/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java @@ -120,7 +120,7 @@ public class NMSWrapper18 implements NMSWrapper { return invalid; } - private final Class explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion"); + private final Class explosionPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutExplosion"); private final Reflection.Field a = Reflection.getField(explosionPacket, double.class, 0); private final Reflection.Field b = Reflection.getField(explosionPacket, double.class, 1); private final Reflection.Field c = Reflection.getField(explosionPacket, double.class, 2); diff --git a/BauSystem/BauSystem_19/src/de/steamwar/bausystem/utils/NMSWrapper19.java b/BauSystem/BauSystem_19/src/de/steamwar/bausystem/utils/NMSWrapper19.java index 2c5b2415..476f1921 100644 --- a/BauSystem/BauSystem_19/src/de/steamwar/bausystem/utils/NMSWrapper19.java +++ b/BauSystem/BauSystem_19/src/de/steamwar/bausystem/utils/NMSWrapper19.java @@ -119,7 +119,7 @@ public class NMSWrapper19 implements NMSWrapper { return invalid; } - private final Class explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion"); + private final Class explosionPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutExplosion"); private final Reflection.Field a = Reflection.getField(explosionPacket, double.class, 0); private final Reflection.Field b = Reflection.getField(explosionPacket, double.class, 1); private final Reflection.Field c = Reflection.getField(explosionPacket, double.class, 2); diff --git a/BauSystem/BauSystem_20/src/de/steamwar/bausystem/utils/NMSWrapper20.java b/BauSystem/BauSystem_20/src/de/steamwar/bausystem/utils/NMSWrapper20.java index a6d0a8e5..3a8cb1bd 100644 --- a/BauSystem/BauSystem_20/src/de/steamwar/bausystem/utils/NMSWrapper20.java +++ b/BauSystem/BauSystem_20/src/de/steamwar/bausystem/utils/NMSWrapper20.java @@ -121,7 +121,7 @@ public class NMSWrapper20 implements NMSWrapper { return invalid; } - private final Class explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion"); + private final Class explosionPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutExplosion"); private final Reflection.Field a = Reflection.getField(explosionPacket, double.class, 0); private final Reflection.Field b = Reflection.getField(explosionPacket, double.class, 1); private final Reflection.Field c = Reflection.getField(explosionPacket, double.class, 2); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracer.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracer.java index 75cecff5..c1e08fcf 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracer.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracer.java @@ -170,7 +170,7 @@ public class ObserverTracer { } } - private static final Class craftPoweredRail = Reflection.getClass("{obc}.block.impl.CraftPoweredRail"); + private static final Class craftPoweredRail = Reflection.getClass("org.bukkit.craftbukkit.block.impl.CraftPoweredRail"); private boolean checkAllowed(Block block, BlockData blockData) { if (checkMaterial(block)) return true; if (block.getType() == Material.BELL) { diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java index 23261b62..6d47f7fe 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java @@ -72,9 +72,9 @@ import java.util.stream.Collectors; public class SimulatorCursor implements Listener { private final World WORLD = Bukkit.getWorlds().get(0); - private Class position = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPosition"); - private Class look = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInLook"); - private Class positionLook = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPositionLook"); + private Class position = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPosition"); + private Class look = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInLook"); + private Class positionLook = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPositionLook"); private Map cursorType = Collections.synchronizedMap(new HashMap<>()); private Map cursors = Collections.synchronizedMap(new HashMap<>()); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java index 36cb3847..764501bc 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java @@ -81,7 +81,7 @@ public class SmartPlaceListener implements Listener { IGNORED.remove(Material.BARRIER); } - private static final Class useItem = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseItem"); + private static final Class useItem = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUseItem"); private static final Set SMART_PLACING = new HashSet<>(); private static final Set WAS_EXECUTED = new HashSet<>(); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/PacketCache.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/PacketCache.java index fd8eb66b..a7ebbfd1 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/PacketCache.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/PacketCache.java @@ -45,17 +45,17 @@ class PacketCache { private static Set entities = new HashSet<>(); private static BukkitTask task = null; - private static Class vec3dClass = Reflection.getClass("{nms.world.phys}.Vec3D"); + private static Class vec3dClass = Reflection.getClass("net.minecraft.world.phys.Vec3D"); private static Reflection.Field zeroVec3d = (Reflection.Field) Reflection.getField(vec3dClass, vec3dClass, 0); private static Object ZERO_VEC3D = zeroVec3d.get(null); - private static Class velocityPacketClass = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityVelocity"); + private static Class velocityPacketClass = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityVelocity"); private static Reflection.Constructor velocityPacketConstructor = Reflection.getConstructor(velocityPacketClass, int.class, vec3dClass); - private static Class teleportPacketClass = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityTeleport"); - private static Class entityClass = Reflection.getClass("{nms.world.entity}.Entity"); + private static Class teleportPacketClass = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport"); + private static Class entityClass = Reflection.getClass("net.minecraft.world.entity.Entity"); private static Reflection.Constructor teleportPacketConstructor = Reflection.getConstructor(teleportPacketClass, entityClass); - private static Class craftEntityClass = Reflection.getClass("{obc}.entity.CraftEntity"); + private static Class craftEntityClass = Reflection.getClass("org.bukkit.craftbukkit.entity.CraftEntity"); private static Reflection.Method getHandle = Reflection.getMethod(craftEntityClass, "getHandle"); private static Object noGravityDataWatcher = BountifulWrapper.impl.getDataWatcherObject(5, Boolean.class); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSFreezeUtils.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSFreezeUtils.java index 45b6154f..a1ae36a2 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSFreezeUtils.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSFreezeUtils.java @@ -32,7 +32,7 @@ public class TPSFreezeUtils { @Getter private static final boolean canFreeze; - private static final Reflection.Method getWorldHandle = Reflection.getTypedMethod(Reflection.getClass("{obc}.CraftWorld"), "getHandle", null); + private static final Reflection.Method getWorldHandle = Reflection.getTypedMethod(Reflection.getClass("org.bukkit.craftbukkit.CraftWorld"), "getHandle", null); @Getter private static boolean frozen = false; @@ -42,7 +42,7 @@ public class TPSFreezeUtils { static { Reflection.Field fieldAccessor; try { - fieldAccessor = Reflection.getField(Reflection.getClass("{nms.server.level}.WorldServer"), "freezed", boolean.class); + fieldAccessor = Reflection.getField(Reflection.getClass("net.minecraft.server.level.WorldServer"), "freezed", boolean.class); } catch (IllegalArgumentException e) { fieldAccessor = null; } diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitUtils.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitUtils.java index 83b8e104..62ae1b5c 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitUtils.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitUtils.java @@ -101,8 +101,8 @@ public class TPSLimitUtils { } */ - private static final Class position = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPosition"); - private static final Class positionLook = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPositionLook"); + private static final Class position = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPosition"); + private static final Class positionLook = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPositionLook"); static { BiFunction positionSetter = (player, o) -> { if (tpsLimiter != null) { diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/NoClipCommand.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/NoClipCommand.java index 565286a1..5e7a1b1f 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/NoClipCommand.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/NoClipCommand.java @@ -49,15 +49,15 @@ import java.util.function.BiFunction; @Linked public class NoClipCommand extends SWCommand implements Listener { - public static final Class gameStateChange = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutGameStateChange"); + public static final Class gameStateChange = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutGameStateChange"); private static final Reflection.Field floatFieldAccessor = Reflection.getField(gameStateChange, float.class, 0); - private static final Class position = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPosition"); - private static final Class positionLook = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPositionLook"); - private static final Class useItem = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseItem"); - private static final Class blockDig = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInBlockDig"); - private static final Class windowClick = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInWindowClick"); - private static final Class setSlotStack = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInSetCreativeSlot"); + private static final Class position = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPosition"); + private static final Class positionLook = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPositionLook"); + private static final Class useItem = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUseItem"); + private static final Class blockDig = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInBlockDig"); + private static final Class windowClick = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInWindowClick"); + private static final Class setSlotStack = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInSetCreativeSlot"); @Getter private static final List NOCLIPS = new ArrayList<>(); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/AntiCursorReCentering.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/AntiCursorReCentering.java index 646120d3..acb95394 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/AntiCursorReCentering.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/AntiCursorReCentering.java @@ -32,7 +32,7 @@ public class AntiCursorReCentering implements Enable { @Override public void enable() { - Class closeWindow = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutCloseWindow"); + Class closeWindow = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutCloseWindow"); TinyProtocol.instance.addFilter(closeWindow, (player, object) -> { if (player.getOpenInventory().getTopInventory().getType() == InventoryType.CRAFTING) { return object; diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/NoCreativeKnockback.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/NoCreativeKnockback.java index 72146f9d..2a102972 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/NoCreativeKnockback.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/NoCreativeKnockback.java @@ -29,7 +29,7 @@ import org.bukkit.GameMode; public class NoCreativeKnockback { public NoCreativeKnockback() { - TinyProtocol.instance.addFilter(Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion"), (player, o) -> { + TinyProtocol.instance.addFilter(Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutExplosion"), (player, o) -> { if (player.getGameMode() != GameMode.CREATIVE) return o; return NMSWrapper.impl.resetExplosionKnockback(o); }); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditFrom20.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditFrom20.java index 4fc0cb31..4618010d 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditFrom20.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditFrom20.java @@ -48,19 +48,19 @@ import org.bukkit.util.Vector; @MinVersion(20) public class SignEditFrom20 implements Listener { - private static final Class blockPosition = Reflection.getClass("{nms.core}.BlockPosition"); - private static final Class craftBlock = Reflection.getClass("{obc}.block.CraftBlock"); - private static final Class craftWorld = Reflection.getClass("{obc}.CraftWorld"); - private static final Class generatorAccess = Reflection.getClass("{nms.world.level}.GeneratorAccess"); + private static final Class blockPosition = Reflection.getClass("net.minecraft.core.BlockPosition"); + private static final Class craftBlock = Reflection.getClass("org.bukkit.craftbukkit.block.CraftBlock"); + private static final Class craftWorld = Reflection.getClass("org.bukkit.craftbukkit.CraftWorld"); + private static final Class generatorAccess = Reflection.getClass("net.minecraft.world.level.GeneratorAccess"); private static final Reflection.Method getPosition = Reflection.getTypedMethod(craftBlock, "getPosition", blockPosition); private static final Reflection.Method getWorldHandle = Reflection.getTypedMethod(craftWorld, "getHandle", null); private static final Reflection.Method at = Reflection.getTypedMethod(craftBlock, "at", craftBlock, generatorAccess, blockPosition); - private static final Class openSign = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutOpenSignEditor"); + private static final Class openSign = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutOpenSignEditor"); private static final Reflection.Field blockPositionFieldAccessor = Reflection.getField(openSign, blockPosition, 0); private static final Reflection.Field sideFieldAccessor = Reflection.getField(openSign, boolean.class, 0); - private static final Class updateSign = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUpdateSign"); + private static final Class updateSign = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUpdateSign"); private static final Reflection.Field getBlockPositionFieldAccessor = Reflection.getField(updateSign, blockPosition, 0); private static final Reflection.Field stringFieldAccessor = Reflection.getField(updateSign, String[].class, 0); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditUntil19.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditUntil19.java index 81cf2786..edf38e68 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditUntil19.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/world/SignEditUntil19.java @@ -40,18 +40,18 @@ import org.bukkit.event.player.PlayerInteractEvent; @MaxVersion(19) public class SignEditUntil19 implements Listener { - private static final Class blockPosition = Reflection.getClass("{nms.core}.BlockPosition"); - private static final Class craftBlock = Reflection.getClass("{obc}.block.CraftBlock"); - private static final Class craftWorld = Reflection.getClass("{obc}.CraftWorld"); - private static final Class generatorAccess = Reflection.getClass("{nms.world.level}.GeneratorAccess"); + private static final Class blockPosition = Reflection.getClass("net.minecraft.core.BlockPosition"); + private static final Class craftBlock = Reflection.getClass("org.bukkit.craftbukkit.block.CraftBlock"); + private static final Class craftWorld = Reflection.getClass("org.bukkit.craftbukkit.CraftWorld"); + private static final Class generatorAccess = Reflection.getClass("net.minecraft.world.level.GeneratorAccess"); private static final Reflection.Method getPosition = Reflection.getTypedMethod(craftBlock, "getPosition", blockPosition); private static final Reflection.Method getWorldHandle = Reflection.getTypedMethod(craftWorld, "getHandle", null); private static final Reflection.Method at = Reflection.getTypedMethod(craftBlock, "at", craftBlock, generatorAccess, blockPosition); - private static final Class openSign = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutOpenSignEditor"); + private static final Class openSign = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutOpenSignEditor"); private static final Reflection.Field blockPositionFieldAccessor = Reflection.getField(openSign, blockPosition, 0); - private static final Class updateSign = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUpdateSign"); + private static final Class updateSign = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUpdateSign"); private static final Reflection.Field getBlockPositionFieldAccessor = Reflection.getField(updateSign, blockPosition, 0); private static final Reflection.Field stringFieldAccessor = Reflection.getField(updateSign, String[].class, 0); diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java index da7981ae..e12a3f76 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java @@ -108,8 +108,8 @@ public class XrayCommand extends SWCommand implements Listener, ScoreboardElemen }); } - private static final Class position = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPosition"); - private static final Class positionLook = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPositionLook"); + private static final Class position = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPosition"); + private static final Class positionLook = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPositionLook"); { BiFunction positionSetter = (player, o) -> { diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/PlaceItemUtils.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/PlaceItemUtils.java index e235cae4..1ede0f63 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/PlaceItemUtils.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/utils/PlaceItemUtils.java @@ -81,10 +81,10 @@ public class PlaceItemUtils { .collect(Collectors.toSet()); } - private static final Class blockPosition = Reflection.getClass("{nms.core}.BlockPosition"); + private static final Class blockPosition = Reflection.getClass("net.minecraft.core.BlockPosition"); private static final Reflection.Constructor blockPositionConstructor = Reflection.getConstructor(blockPosition, int.class, int.class, int.class); - private static final Class craftBlock = Reflection.getClass("{obc}.block.CraftBlockState"); - private static final Class craftWorld = Reflection.getClass("{obc}.CraftWorld"); + private static final Class craftBlock = Reflection.getClass("org.bukkit.craftbukkit.block.CraftBlockState"); + private static final Class craftWorld = Reflection.getClass("org.bukkit.craftbukkit.CraftWorld"); private static final Reflection.Field positionAccessor = Reflection.getField(craftBlock, blockPosition, 0); private static final Reflection.Field worldAccessor = Reflection.getField(craftBlock, craftWorld, 0); 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 84eba7c4..5d3dfbd0 100644 --- a/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/BlockIdWrapper14.java +++ b/FightSystem/FightSystem_14/src/de/steamwar/fightsystem/utils/BlockIdWrapper14.java @@ -33,14 +33,14 @@ import java.util.Map; public class BlockIdWrapper14 implements BlockIdWrapper { - private static final Class chunkProviderServer = Reflection.getClass("{nms.server.level}.ChunkProviderServer"); + private static final Class chunkProviderServer = Reflection.getClass("net.minecraft.server.level.ChunkProviderServer"); private static final Reflection.Method getChunkProvider = Reflection.getTypedMethod(worldServer, null, chunkProviderServer); - private static final Class playerChunkMap = Reflection.getClass("{nms.server.level}.PlayerChunkMap"); + private static final Class playerChunkMap = Reflection.getClass("net.minecraft.server.level.PlayerChunkMap"); private static final Reflection.Field getPlayerChunkMap = Reflection.getField(chunkProviderServer, playerChunkMap, 0); private static final Reflection.Field entityTrackers = Core.getVersion() > 15 ? Reflection.getField(playerChunkMap, Int2ObjectMap.class, 0) : Reflection.getField(playerChunkMap, org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.ints.Int2ObjectMap.class, 0); - private static final Class block = Reflection.getClass("{nms.world.level.block}.Block"); - private static final Class iBlockData = Reflection.getClass("{nms.world.level.block.state}.IBlockData"); - private static final Class blockPosition = Reflection.getClass("{nms.core}.BlockPosition"); + private static final Class block = Reflection.getClass("net.minecraft.world.level.block.Block"); + private static final Class iBlockData = Reflection.getClass("net.minecraft.world.level.block.state.IBlockData"); + private static final Class blockPosition = Reflection.getClass("net.minecraft.core.BlockPosition"); private final Map trackers; public BlockIdWrapper14() { @@ -48,7 +48,7 @@ public class BlockIdWrapper14 implements BlockIdWrapper { } private static final Reflection.Method getCombinedId = Reflection.getTypedMethod(block, null, int.class, iBlockData); - private static final Reflection.Method getNMS = Reflection.getTypedMethod(Reflection.getClass("{obc}.block.CraftBlock"), "getNMS", iBlockData); + private static final Reflection.Method getNMS = Reflection.getTypedMethod(Reflection.getClass("org.bukkit.craftbukkit.block.CraftBlock"), "getNMS", iBlockData); @Override public int blockToId(Block block) { return (int) getCombinedId.invoke(null, getNMS.invoke(block)); @@ -70,7 +70,7 @@ public class BlockIdWrapper14 implements BlockIdWrapper { flagDirty.invoke(getChunkProvider.invoke(nworld), pos); } - private static final Class entityTracker = Reflection.getClass("{nms.server.level}.PlayerChunkMap$EntityTracker"); + private static final Class entityTracker = Reflection.getClass("net.minecraft.server.level.PlayerChunkMap$EntityTracker"); private static final Reflection.Method updatePlayer = Reflection.getMethod(entityTracker, Core.getVersion() > 15 ? "b" : "updatePlayer", entityPlayer); @Override public void trackEntity(Player player, Entity entity) { @@ -87,7 +87,7 @@ public class BlockIdWrapper14 implements BlockIdWrapper { clearPlayer.invoke(tracker, getPlayer.invoke(player)); } - private static final Reflection.Method getMaterialByBlock = Reflection.getTypedMethod(Reflection.getClass("{obc}.util.CraftMagicNumbers"), "getMaterial", Material.class, block); + private static final Reflection.Method getMaterialByBlock = Reflection.getTypedMethod(Reflection.getClass("org.bukkit.craftbukkit.util.CraftMagicNumbers"), "getMaterial", Material.class, block); private static final Reflection.Method getBlockByBlockData = Reflection.getTypedMethod(iBlockData, null, block); @Override public Material idToMaterial(int blockState) { diff --git a/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java index 682fc30f..66ea9b08 100644 --- a/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java +++ b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/BlockIdWrapper18.java @@ -27,7 +27,7 @@ import java.util.*; public class BlockIdWrapper18 extends BlockIdWrapper14 { - private static final Reflection.Field hiddenEntities = Reflection.getField(Reflection.getClass("{obc}.entity.CraftPlayer"), Map.class, 0, UUID.class, Set.class); + private static final Reflection.Field hiddenEntities = Reflection.getField(Reflection.getClass("org.bukkit.craftbukkit.entity.CraftPlayer"), Map.class, 0, UUID.class, Set.class); @Override public void trackEntity(Player player, Entity entity) { hiddenEntities.get(player).remove(entity.getUniqueId()); 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 31c17cf1..8fa8e7de 100644 --- a/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper18.java +++ b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/CraftbukkitWrapper18.java @@ -33,7 +33,7 @@ import java.util.stream.StreamSupport; public class CraftbukkitWrapper18 implements CraftbukkitWrapper { - private static final Reflection.Method getWorld = Reflection.getMethod(Reflection.getClass("{obc}.CraftWorld"), "getHandle"); + private static final Reflection.Method getWorld = Reflection.getMethod(Reflection.getClass("org.bukkit.craftbukkit.CraftWorld"), "getHandle"); private static final Reflection.Method getChunk = Reflection.getTypedMethod(net.minecraft.world.level.World.class, null, Chunk.class, int.class, int.class); private static final Reflection.Method getChunkSections = Reflection.getTypedMethod(Chunk.class, null, ChunkSection[].class); private ChunkSection[] getChunkSections(World world, int x, int z) { @@ -46,7 +46,7 @@ public class CraftbukkitWrapper18 implements CraftbukkitWrapper { System.arraycopy(getChunkSections(backup, x, z), 0, sections, 0, sections.length); } - private static final Reflection.Method getEntity = Reflection.getTypedMethod(Reflection.getClass("{obc}.entity.CraftEntity"), "getHandle", net.minecraft.world.entity.Entity.class); + private static final Reflection.Method getEntity = Reflection.getTypedMethod(Reflection.getClass("org.bukkit.craftbukkit.entity.CraftEntity"), "getHandle", net.minecraft.world.entity.Entity.class); protected net.minecraft.world.entity.Entity getEntity(Entity e) { return (net.minecraft.world.entity.Entity) getEntity.invoke(e); } diff --git a/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/HullHiderWrapper18.java b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/HullHiderWrapper18.java index 7a378f43..9cee390f 100644 --- a/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/HullHiderWrapper18.java +++ b/FightSystem/FightSystem_18/src/de/steamwar/fightsystem/utils/HullHiderWrapper18.java @@ -33,7 +33,7 @@ import java.util.List; public class HullHiderWrapper18 implements HullHiderWrapper { - private static final Reflection.Method getState = Reflection.getTypedMethod(Reflection.getClass("{obc}.block.data.CraftBlockData"), "getState", IBlockData.class); + private static final Reflection.Method getState = Reflection.getTypedMethod(Reflection.getClass("org.bukkit.craftbukkit.block.data.CraftBlockData"), "getState", IBlockData.class); @Override public Object generateBlockChangePacket(List changes) { Object[] blockdata = new Object[changes.size()]; diff --git a/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/BlockIdWrapper8.java b/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/BlockIdWrapper8.java index 94633486..5d06a7be 100644 --- a/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/BlockIdWrapper8.java +++ b/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/BlockIdWrapper8.java @@ -29,9 +29,9 @@ import org.bukkit.entity.Player; public class BlockIdWrapper8 implements BlockIdWrapper { - private static final Class entityTracker = Reflection.getClass("{nms}.EntityTracker"); + private static final Class entityTracker = Reflection.getClass("net.minecraft.EntityTracker"); private static final Reflection.Field getEntityTracker = Reflection.getField(worldServer, entityTracker, 0); - private static final Class intHashMap = Reflection.getClass("{nms}.IntHashMap"); + private static final Class intHashMap = Reflection.getClass("net.minecraft.IntHashMap"); private static final Reflection.Field getTrackedEntities = Reflection.getField(entityTracker, intHashMap, 0); private final Object trackers; @@ -54,7 +54,7 @@ public class BlockIdWrapper8 implements BlockIdWrapper { world.getBlockAt(x, y, z).setTypeIdAndData(blockState >> 4, (byte)(blockState & 0b1111), false); } - private static final Class entityTrackerEntry = Reflection.getClass("{nms}.EntityTrackerEntry"); + private static final Class entityTrackerEntry = Reflection.getClass("net.minecraft.EntityTrackerEntry"); private static final Reflection.Method get = Reflection.getTypedMethod(intHashMap, "get", Object.class, int.class); private static final Reflection.Method updatePlayer = Reflection.getMethod(entityTrackerEntry, "updatePlayer", entityPlayer); @Override diff --git a/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/HullHiderWrapper8.java b/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/HullHiderWrapper8.java index 231a8d0a..03647c5e 100644 --- a/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/HullHiderWrapper8.java +++ b/FightSystem/FightSystem_8/src/de/steamwar/fightsystem/utils/HullHiderWrapper8.java @@ -26,8 +26,8 @@ import java.util.List; public class HullHiderWrapper8 implements HullHiderWrapper { - private static final Reflection.Constructor newMultiBlockChange = Reflection.getConstructor("{nms}.PacketPlayOutMultiBlockChange", int.class, short[].class, Reflection.getClass("{nms}.Chunk")); - private static final Reflection.Method getHandle = Reflection.getMethod("{obc}.CraftChunk", "getHandle"); + private static final Reflection.Constructor newMultiBlockChange = Reflection.getConstructor("net.minecraft.PacketPlayOutMultiBlockChange", int.class, short[].class, Reflection.getClass("net.minecraft.Chunk")); + private static final Reflection.Method getHandle = Reflection.getMethod("org.bukkit.craftbukkit.CraftChunk", "getHandle"); @Override public Object generateBlockChangePacket(List changes) { Hull.IntVector chunk = changes.get(0); diff --git a/FightSystem/FightSystem_9/src/de/steamwar/fightsystem/utils/BountifulWrapper9.java b/FightSystem/FightSystem_9/src/de/steamwar/fightsystem/utils/BountifulWrapper9.java index 67ac4f21..18031b0a 100644 --- a/FightSystem/FightSystem_9/src/de/steamwar/fightsystem/utils/BountifulWrapper9.java +++ b/FightSystem/FightSystem_9/src/de/steamwar/fightsystem/utils/BountifulWrapper9.java @@ -43,7 +43,7 @@ import java.util.Map; public class BountifulWrapper9 implements BountifulWrapper { - private static final Class enumHand = Reflection.getClass("{nms.world}.EnumHand"); + private static final Class enumHand = Reflection.getClass("net.minecraft.world.EnumHand"); private static final Object mainHand = enumHand.getEnumConstants()[0]; private static final Reflection.Field blockPlaceHand = Reflection.getField(Recording.blockPlacePacket, enumHand, 0); diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/Commands.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/Commands.java index 90bca61b..cff729df 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/Commands.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/Commands.java @@ -39,7 +39,7 @@ import org.bukkit.entity.Player; @UtilityClass public class Commands { - private static final Reflection.Field commandMap = Reflection.getField("{obc}.CraftServer", "commandMap", SimpleCommandMap.class); + private static final Reflection.Field commandMap = Reflection.getField("org.bukkit.craftbukkit.CraftServer", "commandMap", SimpleCommandMap.class); public static void injectCommand(Command cmd) { commandMap.get(Bukkit.getServer()).register("FightSystem", cmd); } diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java index 08853b65..ea8617d6 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java @@ -215,9 +215,9 @@ public class Kit { return !normal.isEnchantmentInKit(stack) && !stack.getEnchantments().isEmpty(); } - private static final Class itemStack = Reflection.getClass("{nms.world.item}.ItemStack"); - private static final Reflection.Method asNMSCopy = Reflection.getTypedMethod(Reflection.getClass("{obc}.inventory.CraftItemStack"), "asNMSCopy", itemStack, ItemStack.class); - private static final Class nbtTagCompound = Reflection.getClass("{nms.nbt}.NBTTagCompound"); + private static final Class itemStack = Reflection.getClass("net.minecraft.world.item.ItemStack"); + private static final Reflection.Method asNMSCopy = Reflection.getTypedMethod(Reflection.getClass("org.bukkit.craftbukkit.inventory.CraftItemStack"), "asNMSCopy", itemStack, ItemStack.class); + private static final Class nbtTagCompound = Reflection.getClass("net.minecraft.nbt.NBTTagCompound"); private static final Reflection.Method getTag = Reflection.getTypedMethod(itemStack, null, nbtTagCompound); private static final Reflection.Method getKeys = Reflection.getTypedMethod(nbtTagCompound, null, Set.class); public static boolean hasItems(ItemStack stack) { diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ArrowStopper.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ArrowStopper.java index 18bc11ac..6b337646 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ArrowStopper.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ArrowStopper.java @@ -41,7 +41,7 @@ public class ArrowStopper { new StateDependentTask(Config.TechhiderActive, FightState.Running, this::run, 1, 1); } - private static final Class entityArrow = Reflection.getClass("{nms.world.entity.projectile}.EntityArrow"); + private static final Class entityArrow = Reflection.getClass("net.minecraft.world.entity.projectile.EntityArrow"); private void run() { Recording.iterateOverEntities(entityArrow::isInstance, entity -> { Projectile arrow = (Projectile) entity; diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ClickAnalyzer.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ClickAnalyzer.java index 4ceed83c..3506ec25 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ClickAnalyzer.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/ClickAnalyzer.java @@ -43,7 +43,7 @@ public class ClickAnalyzer { public ClickAnalyzer() { TinyProtocol.instance.addFilter(Recording.blockPlacePacket, this::onBlockPlace); if(Core.getVersion() > 8) - TinyProtocol.instance.addFilter(Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseItem"), this::onBlockPlace); + TinyProtocol.instance.addFilter(Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUseItem"), this::onBlockPlace); } public Object onBlockPlace(Player player, Object packet) { diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Recording.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Recording.java index 31b26c5e..7f6faa56 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Recording.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Recording.java @@ -77,8 +77,8 @@ public class Recording implements Listener { return fp == null || !fp.isLiving() || FightState.getFightState() == FightState.SPECTATE; } - public static final Class primedTnt = Reflection.getClass("{nms.world.entity.item}.EntityTNTPrimed"); - private static final Reflection.Method getBukkitEntity = Reflection.getTypedMethod(Reflection.getClass("{nms.world.entity}.Entity"), "getBukkitEntity", null); + public static final Class primedTnt = Reflection.getClass("net.minecraft.world.entity.item.EntityTNTPrimed"); + private static final Reflection.Method getBukkitEntity = Reflection.getTypedMethod(Reflection.getClass("net.minecraft.world.entity.Entity"), "getBukkitEntity", null); public static void iterateOverEntities(Predicate filter, Consumer consumer) { CraftbukkitWrapper.impl.entityIterator().filter(filter).map(entity -> (Entity) getBukkitEntity.invoke(entity)).forEach(consumer); } @@ -129,7 +129,7 @@ public class Recording implements Listener { GlobalRecorder.getInstance().entitySpeed(entity); } - private static final Class blockDigPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInBlockDig"); + private static final Class blockDigPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInBlockDig"); private static final Class playerDigType = blockDigPacket.getDeclaredClasses()[0]; private static final Reflection.Field blockDigType = Reflection.getField(blockDigPacket, playerDigType, 0); private static final Object releaseUseItem = playerDigType.getEnumConstants()[5]; @@ -139,7 +139,7 @@ public class Recording implements Listener { return packet; } - public static final Class blockPlacePacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInBlockPlace"); + public static final Class blockPlacePacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInBlockPlace"); private Object blockPlace(Player p, Object packet) { boolean mainHand = BountifulWrapper.impl.mainHand(packet); if(!isNotSent(p) && BountifulWrapper.impl.bowInHand(mainHand, p)) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/BlockIdWrapper.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/BlockIdWrapper.java index 15d1b0f7..d6039f04 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/BlockIdWrapper.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/BlockIdWrapper.java @@ -29,11 +29,11 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; public interface BlockIdWrapper { - Class worldServer = Reflection.getClass("{nms.server.level}.WorldServer"); - Reflection.Method getWorldHandle = Reflection.getTypedMethod(Reflection.getClass("{obc}.CraftWorld"), "getHandle", worldServer); + Class worldServer = Reflection.getClass("net.minecraft.server.level.WorldServer"); + Reflection.Method getWorldHandle = Reflection.getTypedMethod(Reflection.getClass("org.bukkit.craftbukkit.CraftWorld"), "getHandle", worldServer); - Class craftPlayer = Reflection.getClass("{obc}.entity.CraftPlayer"); - Class entityPlayer = Reflection.getClass("{nms.server.level}.EntityPlayer"); + Class craftPlayer = Reflection.getClass("org.bukkit.craftbukkit.entity.CraftPlayer"); + Class entityPlayer = Reflection.getClass("net.minecraft.server.level.EntityPlayer"); Reflection.Method getPlayer = Reflection.getTypedMethod(craftPlayer, "getHandle", entityPlayer); BlockIdWrapper impl = VersionDependent.getVersionImpl(FightSystem.getPlugin()); diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/HullHider.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/HullHider.java index 64ec3064..df1248ed 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/HullHider.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/utils/HullHider.java @@ -71,10 +71,10 @@ public class HullHider implements Listener { packetHiders.put(packetPlayOutWorldEvent, this::worldEventHider); packetHiders.put(packetPlayOutExplosion, this::explosionHider); - posHiderGenerator("{nms.network.protocol.game}.PacketPlayOutWorldParticles", Core.getVersion() >= 18 ? double.class : float.class, 1.0); - posHiderGenerator("{nms.network.protocol.game}.PacketPlayOutNamedSoundEffect", int.class, 8.0); + posHiderGenerator("net.minecraft.network.protocol.game.PacketPlayOutWorldParticles", Core.getVersion() >= 18 ? double.class : float.class, 1.0); + posHiderGenerator("net.minecraft.network.protocol.game.PacketPlayOutNamedSoundEffect", int.class, 8.0); if(Core.getVersion() >= 9 && Core.getVersion() < 18) - posHiderGenerator("{nms.network.protocol.game}.PacketPlayOutCustomSoundEffect", int.class, 8.0); + posHiderGenerator("net.minecraft.network.protocol.game.PacketPlayOutCustomSoundEffect", int.class, 8.0); new StateDependentListener(TechHiderWrapper.ENABLED, FightState.Schem, this); new StateDependent(TechHiderWrapper.ENABLED, FightState.Schem) { @@ -198,15 +198,15 @@ public class HullHider implements Listener { } - private static final Class packetPlayOutWorldEvent = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutWorldEvent"); + private static final Class packetPlayOutWorldEvent = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutWorldEvent"); private static final Reflection.Field worldEventPosition = Reflection.getField(packetPlayOutWorldEvent, TechHider.blockPosition, 0); - public static final Reflection.Field blockPositionY = Reflection.getField("{nms.core}.BaseBlockPosition", int.class, 1); + public static final Reflection.Field blockPositionY = Reflection.getField("net.minecraft.core.BaseBlockPosition", int.class, 1); private Object worldEventHider(Player player, Object packet) { Object baseBlock = worldEventPosition.get(packet); return packetHider(player, packet, new Location(Config.world, TechHider.blockPositionX.get(baseBlock), blockPositionY.get(baseBlock), TechHider.blockPositionZ.get(baseBlock))); } - private static final Class packetPlayOutExplosion = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion"); + private static final Class packetPlayOutExplosion = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutExplosion"); private static final Reflection.Field explosionBlocks = Reflection.getField(packetPlayOutExplosion, List.class, 0); private static final Function explosionLocation = posPacketToLocation(packetPlayOutExplosion, double.class, 1.0); private Object explosionHider(Player player, Object packet) { diff --git a/MissileWars/src/de/steamwar/misslewars/slowmo/SlowMoUtils.java b/MissileWars/src/de/steamwar/misslewars/slowmo/SlowMoUtils.java index 457ae789..10b2c05c 100644 --- a/MissileWars/src/de/steamwar/misslewars/slowmo/SlowMoUtils.java +++ b/MissileWars/src/de/steamwar/misslewars/slowmo/SlowMoUtils.java @@ -32,7 +32,7 @@ public class SlowMoUtils { private static final Field field; public static final boolean freezeEnabled; - private static final Reflection.Method getWorldHandle = Reflection.getTypedMethod(Reflection.getClass("{obc}.CraftWorld"), "getHandle", null); + private static final Reflection.Method getWorldHandle = Reflection.getTypedMethod(Reflection.getClass("org.bukkit.craftbukkit.CraftWorld"), "getHandle", null); private static boolean frozen = false; private static final World world; @@ -40,7 +40,7 @@ public class SlowMoUtils { static { Field temp; try { - temp = Reflection.getClass("{nms.server.level}.WorldServer").getField("freezed"); + temp = Reflection.getClass("net.minecraft.server.level.WorldServer").getField("freezed"); } catch (NoSuchFieldException e) { temp = null; } diff --git a/SpigotCore/SpigotCore_14/src/de/steamwar/core/FlatteningWrapper14.java b/SpigotCore/SpigotCore_14/src/de/steamwar/core/FlatteningWrapper14.java index a1fac854..ea9a6be2 100644 --- a/SpigotCore/SpigotCore_14/src/de/steamwar/core/FlatteningWrapper14.java +++ b/SpigotCore/SpigotCore_14/src/de/steamwar/core/FlatteningWrapper14.java @@ -226,13 +226,13 @@ public class FlatteningWrapper14 implements FlatteningWrapper.IFlatteningWrapper renamedLegacy.put("RECORD_12", Material.MUSIC_DISC_WAIT); } - private static final Reflection.Field scoreboardName = Reflection.getField(FlatteningWrapper.scoreboardObjective, Reflection.getClass("{nms.network.chat}.IChatBaseComponent"), 0); + private static final Reflection.Field scoreboardName = Reflection.getField(FlatteningWrapper.scoreboardObjective, Reflection.getClass("net.minecraft.network.chat.IChatBaseComponent"), 0); @Override public void setScoreboardTitle(Object packet, String title) { scoreboardName.set(packet, ChatWrapper.impl.stringToChatComponent(title)); } - private static final Class scoreActionEnum = Core.getVersion() < 21 ? Reflection.getClass("{nms.server}.ScoreboardServer$Action") : null; + private static final Class scoreActionEnum = Core.getVersion() < 21 ? Reflection.getClass("net.minecraft.server.ScoreboardServer$Action") : null; private static final Reflection.Field scoreAction = Core.getVersion() < 21 ? Reflection.getField(FlatteningWrapper.scoreboardScore, scoreActionEnum, 0) : null; private static final Object scoreActionChange = Core.getVersion() < 21 ? scoreActionEnum.getEnumConstants()[0] : null; @@ -300,7 +300,7 @@ public class FlatteningWrapper14 implements FlatteningWrapper.IFlatteningWrapper return head; } - private static final Class entityPose = Reflection.getClass("{nms.world.entity}.EntityPose"); + private static final Class entityPose = Reflection.getClass("net.minecraft.world.entity.EntityPose"); private static final Object standing = entityPose.getEnumConstants()[0]; private static final Object swimming = entityPose.getEnumConstants()[3]; private static final Object sneaking = entityPose.getEnumConstants()[5]; @@ -327,13 +327,13 @@ public class FlatteningWrapper14 implements FlatteningWrapper.IFlatteningWrapper return displayName != null ? Optional.of(ChatWrapper.impl.stringToChatComponent(displayName)) : Optional.empty(); } - private static final Class registryBlocks = Reflection.getClass("{nms.core}.RegistryBlocks"); - private static final Class entityTypes = Reflection.getClass("{nms.world.entity}.EntityTypes"); - private static final Object entityTypesRegistry = Reflection.getField(Reflection.getClass(Core.getVersion() > 18 ? "net.minecraft.core.registries.BuiltInRegistries" : "{nms.core}.IRegistry"), registryBlocks, 0, entityTypes).get(null); - private static final Reflection.Method get = Reflection.getMethod(registryBlocks, null, Reflection.getClass("{nms.resources}.MinecraftKey")); + private static final Class registryBlocks = Reflection.getClass("net.minecraft.core.RegistryBlocks"); + private static final Class entityTypes = Reflection.getClass("net.minecraft.world.entity.EntityTypes"); + private static final Object entityTypesRegistry = Reflection.getField(Reflection.getClass(Core.getVersion() > 18 ? "net.minecraft.core.registries.BuiltInRegistries" : "net.minecraft.core.IRegistry"), registryBlocks, 0, entityTypes).get(null); + private static final Reflection.Method get = Reflection.getMethod(registryBlocks, null, Reflection.getClass("net.minecraft.resources.MinecraftKey")); private static final Reflection.Field spawnType = Reflection.getField(ProtocolWrapper.spawnPacket, entityTypes, 0); private static final Reflection.Field spawnLivingType = Core.getVersion() > 18 ? spawnType : Reflection.getField(ProtocolWrapper.spawnLivingPacket, int.class, 1); - private static final Reflection.Method toMinecraft = Reflection.getMethod("{obc}.util.CraftNamespacedKey", "toMinecraft", NamespacedKey.class); + private static final Reflection.Method toMinecraft = Reflection.getMethod("org.bukkit.craftbukkit.util.CraftNamespacedKey", "toMinecraft", NamespacedKey.class); private static final Map types = new HashMap<>(); static { types.put(EntityType.ARMOR_STAND, 1); @@ -352,8 +352,8 @@ public class FlatteningWrapper14 implements FlatteningWrapper.IFlatteningWrapper return player.getClientViewDistance(); } - private static final Reflection.Method getHandle = Reflection.getMethod("{obc}.CraftWorld", "getHandle"); - private static final Reflection.Method save = Reflection.getMethod("{nms.server.level}.WorldServer", null, Reflection.getClass("{nms.util}.IProgressUpdate"), boolean.class, boolean.class); + private static final Reflection.Method getHandle = Reflection.getMethod("org.bukkit.craftbukkit.CraftWorld", "getHandle"); + private static final Reflection.Method save = Reflection.getMethod("net.minecraft.server.level.WorldServer", null, Reflection.getClass("net.minecraft.util.IProgressUpdate"), boolean.class, boolean.class); @Override public void syncSave(World world) { save.invoke(getHandle.invoke(world), null, true, false); diff --git a/SpigotCore/SpigotCore_14/src/de/steamwar/techhider/BlockIds14.java b/SpigotCore/SpigotCore_14/src/de/steamwar/techhider/BlockIds14.java index 102ab31a..38d5654c 100644 --- a/SpigotCore/SpigotCore_14/src/de/steamwar/techhider/BlockIds14.java +++ b/SpigotCore/SpigotCore_14/src/de/steamwar/techhider/BlockIds14.java @@ -28,9 +28,9 @@ import java.util.Set; public class BlockIds14 implements BlockIds { - private static final Class blockStateList = Reflection.getClass("{nms.world.level.block.state}.BlockStateList"); - private static final Class fluidTypeFlowing = Reflection.getClass("{nms.world.level.material}.FluidTypeFlowing"); - private static final Class fluid = Reflection.getClass("{nms.world.level.material}.Fluid"); + private static final Class blockStateList = Reflection.getClass("net.minecraft.world.level.block.state.BlockStateList"); + private static final Class fluidTypeFlowing = Reflection.getClass("net.minecraft.world.level.material.FluidTypeFlowing"); + private static final Class fluid = Reflection.getClass("net.minecraft.world.level.material.Fluid"); private static final Reflection.Method getBlockData = Reflection.getTypedMethod(TechHider.block, null, TechHider.iBlockData); @Override @@ -40,8 +40,8 @@ public class BlockIds14 implements BlockIds { private static final Reflection.Method getStates = Reflection.getTypedMethod(TechHider.block, null, blockStateList); private static final Reflection.Method getStateList = Reflection.getTypedMethod(blockStateList, null, ImmutableList.class); - private static final Object water = Reflection.getTypedMethod(fluidTypeFlowing, null, fluid, boolean.class).invoke(Reflection.getField(Reflection.getClass("{nms.world.level.material}.FluidTypes"), fluidTypeFlowing, 1).get(null), false); - private static final Iterable registryBlockId = (Iterable) Reflection.getField(TechHider.block, Reflection.getClass("{nms.core}.RegistryBlockID"), 0).get(null); + private static final Object water = Reflection.getTypedMethod(fluidTypeFlowing, null, fluid, boolean.class).invoke(Reflection.getField(Reflection.getClass("net.minecraft.world.level.material.FluidTypes"), fluidTypeFlowing, 1).get(null), false); + private static final Iterable registryBlockId = (Iterable) Reflection.getField(TechHider.block, Reflection.getClass("net.minecraft.core.RegistryBlockID"), 0).get(null); private static final Reflection.Method getFluid = Reflection.getTypedMethod(TechHider.iBlockData, null, fluid); @Override public Set materialToAllIds(Material material) { diff --git a/SpigotCore/SpigotCore_18/src/de/steamwar/core/CraftbukkitWrapper18.java b/SpigotCore/SpigotCore_18/src/de/steamwar/core/CraftbukkitWrapper18.java index 0f6e9d62..6cfaade4 100644 --- a/SpigotCore/SpigotCore_18/src/de/steamwar/core/CraftbukkitWrapper18.java +++ b/SpigotCore/SpigotCore_18/src/de/steamwar/core/CraftbukkitWrapper18.java @@ -29,7 +29,7 @@ import org.bukkit.entity.Player; public class CraftbukkitWrapper18 implements CraftbukkitWrapper.ICraftbukkitWrapper { - private static final Reflection.Method getHandle = Reflection.getMethod("{obc}.CraftChunk", "getHandle"); + private static final Reflection.Method getHandle = Reflection.getMethod("org.bukkit.craftbukkit.CraftChunk", "getHandle"); private static final Reflection.Method getLightEngine = Reflection.getTypedMethod(World.class, null, LightEngine.class); @Override diff --git a/SpigotCore/SpigotCore_18/src/de/steamwar/core/ProtocolWrapper18.java b/SpigotCore/SpigotCore_18/src/de/steamwar/core/ProtocolWrapper18.java index 98ae4bab..877f398e 100644 --- a/SpigotCore/SpigotCore_18/src/de/steamwar/core/ProtocolWrapper18.java +++ b/SpigotCore/SpigotCore_18/src/de/steamwar/core/ProtocolWrapper18.java @@ -36,8 +36,8 @@ public class ProtocolWrapper18 implements ProtocolWrapper { equipmentStack.set(packet, Collections.singletonList(new Pair<>(slot, stack))); } - private static final Class playerInfoPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutPlayerInfo"); - private static final Class playerInfoActionClass = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutPlayerInfo$EnumPlayerInfoAction"); + private static final Class playerInfoPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo"); + private static final Class playerInfoActionClass = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo$EnumPlayerInfoAction"); private static final Reflection.Field playerInfoAction = Reflection.getField(playerInfoPacket, playerInfoActionClass, 0); private static final Reflection.Field playerInfoData = Reflection.getField(playerInfoPacket, List.class, 0); private static final EnumMap actions = new EnumMap<>(PlayerInfoAction.class); @@ -47,8 +47,8 @@ public class ProtocolWrapper18 implements ProtocolWrapper { actions.put(PlayerInfoAction.GAMEMODE, nativeActions[1]); actions.put(PlayerInfoAction.REMOVE, nativeActions[4]); } - private static final Class iChatBaseComponent = Reflection.getClass("{nms.network.chat}.IChatBaseComponent"); - private static final Reflection.Constructor playerInfoDataConstructor = Reflection.getConstructor("{nms.network.protocol.game}.PacketPlayOutPlayerInfo$PlayerInfoData", GameProfile.class, int.class, enumGamemode, iChatBaseComponent); + private static final Class iChatBaseComponent = Reflection.getClass("net.minecraft.network.chat.IChatBaseComponent"); + private static final Reflection.Constructor playerInfoDataConstructor = Reflection.getConstructor("net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo$PlayerInfoData", GameProfile.class, int.class, enumGamemode, iChatBaseComponent); @Override @SuppressWarnings("deprecation") diff --git a/SpigotCore/SpigotCore_20/src/de/steamwar/core/CraftbukkitWrapper20.java b/SpigotCore/SpigotCore_20/src/de/steamwar/core/CraftbukkitWrapper20.java index 9d0490f5..31faa3f0 100644 --- a/SpigotCore/SpigotCore_20/src/de/steamwar/core/CraftbukkitWrapper20.java +++ b/SpigotCore/SpigotCore_20/src/de/steamwar/core/CraftbukkitWrapper20.java @@ -30,7 +30,7 @@ import org.bukkit.entity.Player; public class CraftbukkitWrapper20 implements CraftbukkitWrapper.ICraftbukkitWrapper { - private static final Reflection.Method getHandle = Reflection.getMethod("{obc}.CraftChunk", "getHandle", ChunkStatus.class); + private static final Reflection.Method getHandle = Reflection.getMethod("org.bukkit.craftbukkit.CraftChunk", "getHandle", ChunkStatus.class); private static final Reflection.Method getLightEngine = Reflection.getTypedMethod(World.class, null, LevelLightEngine.class); @Override diff --git a/SpigotCore/SpigotCore_21/src/de/steamwar/core/CraftbukkitWrapper21.java b/SpigotCore/SpigotCore_21/src/de/steamwar/core/CraftbukkitWrapper21.java index af3a3bd7..337ee1db 100644 --- a/SpigotCore/SpigotCore_21/src/de/steamwar/core/CraftbukkitWrapper21.java +++ b/SpigotCore/SpigotCore_21/src/de/steamwar/core/CraftbukkitWrapper21.java @@ -30,7 +30,7 @@ import org.bukkit.entity.Player; public class CraftbukkitWrapper21 implements CraftbukkitWrapper.ICraftbukkitWrapper { - private static final Reflection.Method getHandle = Reflection.getMethod("{obc}.CraftChunk", "getHandle", ChunkStatus.class); + private static final Reflection.Method getHandle = Reflection.getMethod("org.bukkit.craftbukkit.CraftChunk", "getHandle", ChunkStatus.class); private static final Reflection.Method getLightEngine = Reflection.getTypedMethod(World.class, null, LevelLightEngine.class); @Override diff --git a/SpigotCore/SpigotCore_8/src/de/steamwar/core/BountifulWrapper8.java b/SpigotCore/SpigotCore_8/src/de/steamwar/core/BountifulWrapper8.java index 8665a815..9f0d8e1a 100644 --- a/SpigotCore/SpigotCore_8/src/de/steamwar/core/BountifulWrapper8.java +++ b/SpigotCore/SpigotCore_8/src/de/steamwar/core/BountifulWrapper8.java @@ -49,7 +49,7 @@ public class BountifulWrapper8 implements BountifulWrapper.IBountifulWrapper { return index; } - private static final Class watchableObject = Reflection.getClass("{nms}.DataWatcher$WatchableObject"); + private static final Class watchableObject = Reflection.getClass("net.minecraft.DataWatcher$WatchableObject"); private static final Reflection.Constructor watchableObjectConstructor = Reflection.getConstructor(watchableObject, int.class, int.class, Object.class); private static final Map, Integer> watchableDatatypes = new HashMap<>(); static { diff --git a/SpigotCore/SpigotCore_8/src/de/steamwar/core/ChatWrapper8.java b/SpigotCore/SpigotCore_8/src/de/steamwar/core/ChatWrapper8.java index 4408679f..5251a4f3 100644 --- a/SpigotCore/SpigotCore_8/src/de/steamwar/core/ChatWrapper8.java +++ b/SpigotCore/SpigotCore_8/src/de/steamwar/core/ChatWrapper8.java @@ -26,13 +26,13 @@ import java.util.List; public class ChatWrapper8 implements ChatWrapper { - private static final Reflection.Constructor chatComponentConstructor = Reflection.getConstructor(Reflection.getClass("{nms.network.chat}.ChatComponentText"), String.class); + private static final Reflection.Constructor chatComponentConstructor = Reflection.getConstructor(Reflection.getClass("net.minecraft.network.chat.ChatComponentText"), String.class); @Override public Object stringToChatComponent(String text) { return chatComponentConstructor.invoke(text); } - private static final Class metadataPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityMetadata"); + private static final Class metadataPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata"); private static final Reflection.Field metadataEntity = Reflection.getField(metadataPacket, int.class, 0); private static final Reflection.Field metadataMetadata = Reflection.getField(metadataPacket, List.class, 0); @Override diff --git a/SpigotCore/SpigotCore_8/src/de/steamwar/core/FlatteningWrapper8.java b/SpigotCore/SpigotCore_8/src/de/steamwar/core/FlatteningWrapper8.java index eacf97e3..23ad414b 100644 --- a/SpigotCore/SpigotCore_8/src/de/steamwar/core/FlatteningWrapper8.java +++ b/SpigotCore/SpigotCore_8/src/de/steamwar/core/FlatteningWrapper8.java @@ -33,7 +33,7 @@ import java.util.Map; public class FlatteningWrapper8 implements FlatteningWrapper.IFlatteningWrapper { private static final Reflection.Field scoreboardName = Reflection.getField(FlatteningWrapper.scoreboardObjective, String.class, 1); - private static final Class scoreActionEnum = Reflection.getClass("{nms}.PacketPlayOutScoreboardScore$EnumScoreboardAction"); + private static final Class scoreActionEnum = Reflection.getClass("net.minecraft.PacketPlayOutScoreboardScore$EnumScoreboardAction"); private static final Reflection.Field scoreAction = Reflection.getField(FlatteningWrapper.scoreboardScore, scoreActionEnum, 0); private static final Object scoreActionChange = scoreActionEnum.getEnumConstants()[0]; @@ -76,10 +76,10 @@ public class FlatteningWrapper8 implements FlatteningWrapper.IFlatteningWrapper return Byte.valueOf((byte)(pose == FlatteningWrapper.EntityPose.SNEAKING ? 2 : 0)); } - private static final Class dataWatcher = Reflection.getClass("{nms}.DataWatcher"); - private static final Class namedSpawnPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutNamedEntitySpawn"); + private static final Class dataWatcher = Reflection.getClass("net.minecraft.DataWatcher"); + private static final Class namedSpawnPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn"); private static final Reflection.Field namedSpawnDataWatcher = Reflection.getField(namedSpawnPacket, dataWatcher, 0); - private static final Class entity = Reflection.getClass("{nms}.Entity"); + private static final Class entity = Reflection.getClass("net.minecraft.Entity"); private static final Reflection.Constructor dataWatcherConstructor = Reflection.getConstructor(dataWatcher, entity); @Override public void setNamedSpawnPacketDataWatcher(Object packet) { @@ -113,7 +113,7 @@ public class FlatteningWrapper8 implements FlatteningWrapper.IFlatteningWrapper return 10; } - private static final Reflection.Method save = Reflection.getMethod("{obc}.CraftWorld", "save", boolean.class); + private static final Reflection.Method save = Reflection.getMethod("org.bukkit.craftbukkit.CraftWorld", "save", boolean.class); @Override public void syncSave(World world) { save.invoke(world, true); diff --git a/SpigotCore/SpigotCore_8/src/de/steamwar/core/ProtocolWrapper8.java b/SpigotCore/SpigotCore_8/src/de/steamwar/core/ProtocolWrapper8.java index 24a924a0..aaa31c8d 100644 --- a/SpigotCore/SpigotCore_8/src/de/steamwar/core/ProtocolWrapper8.java +++ b/SpigotCore/SpigotCore_8/src/de/steamwar/core/ProtocolWrapper8.java @@ -34,7 +34,7 @@ public class ProtocolWrapper8 implements ProtocolWrapper { if(Core.getVersion() == 8) { equipmentSlot = Reflection.getField(equipmentPacket, int.class, 1); } else { - Class enumItemSlot = Reflection.getClass("{nms.world.entity}.EnumItemSlot"); + Class enumItemSlot = Reflection.getClass("net.minecraft.world.entity.EnumItemSlot"); equipmentSlot = Reflection.getField(equipmentPacket, enumItemSlot, 0); } } @@ -46,8 +46,8 @@ public class ProtocolWrapper8 implements ProtocolWrapper { equipmentStack.set(packet, stack); } - private static final Class playerInfoPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutPlayerInfo"); - private static final Class playerInfoActionClass = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutPlayerInfo$EnumPlayerInfoAction"); + private static final Class playerInfoPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo"); + private static final Class playerInfoActionClass = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo$EnumPlayerInfoAction"); private static final Reflection.Field playerInfoAction = Reflection.getField(playerInfoPacket, playerInfoActionClass, 0); private static final Reflection.Field playerInfoData = Reflection.getField(playerInfoPacket, List.class, 0); private static final EnumMap actions = new EnumMap<>(PlayerInfoAction.class); @@ -57,8 +57,8 @@ public class ProtocolWrapper8 implements ProtocolWrapper { actions.put(PlayerInfoAction.GAMEMODE, nativeActions[1]); actions.put(PlayerInfoAction.REMOVE, nativeActions[4]); } - private static final Class iChatBaseComponent = Reflection.getClass("{nms.network.chat}.IChatBaseComponent"); - private static final Reflection.Constructor playerInfoDataConstructor = Reflection.getConstructor("{nms.network.protocol.game}.PacketPlayOutPlayerInfo$PlayerInfoData", playerInfoPacket, GameProfile.class, int.class, enumGamemode, iChatBaseComponent); + private static final Class iChatBaseComponent = Reflection.getClass("net.minecraft.network.chat.IChatBaseComponent"); + private static final Reflection.Constructor playerInfoDataConstructor = Reflection.getConstructor("net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo$PlayerInfoData", playerInfoPacket, GameProfile.class, int.class, enumGamemode, iChatBaseComponent); @Override @SuppressWarnings("deprecation") diff --git a/SpigotCore/SpigotCore_8/src/de/steamwar/scoreboard/SWScoreboard8.java b/SpigotCore/SpigotCore_8/src/de/steamwar/scoreboard/SWScoreboard8.java index 2d4b607e..a1648419 100644 --- a/SpigotCore/SpigotCore_8/src/de/steamwar/scoreboard/SWScoreboard8.java +++ b/SpigotCore/SpigotCore_8/src/de/steamwar/scoreboard/SWScoreboard8.java @@ -32,7 +32,7 @@ import java.util.Map; public class SWScoreboard8 implements SWScoreboard { private static final Reflection.Field scoreboardName = Reflection.getField(FlatteningWrapper.scoreboardObjective, String.class, 0); private static final Reflection.Field scoreboardAction = Reflection.getField(FlatteningWrapper.scoreboardObjective, int.class, Core.getVersion() > 15 ? 3 : 0); - private static final Class scoreboardDisplayEnum = Reflection.getClass("{nms.world.scores.criteria}.IScoreboardCriteria$EnumScoreboardHealthDisplay"); + private static final Class scoreboardDisplayEnum = Reflection.getClass("net.minecraft.world.scores.criteria.IScoreboardCriteria$EnumScoreboardHealthDisplay"); private static final Reflection.Field scoreboardDisplayType = Reflection.getField(FlatteningWrapper.scoreboardObjective, scoreboardDisplayEnum, 0); private static final Object displayTypeIntegers = scoreboardDisplayEnum.getEnumConstants()[0]; @@ -48,7 +48,7 @@ public class SWScoreboard8 implements SWScoreboard { private static final Object[] DISPLAY_SIDEBAR = new Object[2]; static { - Class scoreboardDisplayObjective = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutScoreboardDisplayObjective"); + Class scoreboardDisplayObjective = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutScoreboardDisplayObjective"); Reflection.Field scoreboardDisplayName = Reflection.getField(scoreboardDisplayObjective, String.class, 0); Reflection.Field scoreboardDisplaySlot = Reflection.getField(scoreboardDisplayObjective, int.class, 0); for(int id = 0; id < 2; id++) { diff --git a/SpigotCore/SpigotCore_8/src/de/steamwar/techhider/ChunkHider8.java b/SpigotCore/SpigotCore_8/src/de/steamwar/techhider/ChunkHider8.java index 600050ff..0aebc6e1 100644 --- a/SpigotCore/SpigotCore_8/src/de/steamwar/techhider/ChunkHider8.java +++ b/SpigotCore/SpigotCore_8/src/de/steamwar/techhider/ChunkHider8.java @@ -26,7 +26,7 @@ import java.util.function.BiFunction; public class ChunkHider8 implements ChunkHider { - protected static final Class mapChunkPacket = Reflection.getClass("{nms}.PacketPlayOutMapChunk"); + protected static final Class mapChunkPacket = Reflection.getClass("net.minecraft.PacketPlayOutMapChunk"); @Override public Class mapChunkPacket() { return mapChunkPacket; diff --git a/SpigotCore/SpigotCore_8/src/de/steamwar/techhider/ProtocolWrapper8.java b/SpigotCore/SpigotCore_8/src/de/steamwar/techhider/ProtocolWrapper8.java index 04b3c7c8..0f5c6b4d 100644 --- a/SpigotCore/SpigotCore_8/src/de/steamwar/techhider/ProtocolWrapper8.java +++ b/SpigotCore/SpigotCore_8/src/de/steamwar/techhider/ProtocolWrapper8.java @@ -27,15 +27,15 @@ import java.util.ArrayList; import java.util.function.BiFunction; public class ProtocolWrapper8 implements ProtocolWrapper { - private static final Class chunkCoordinateIntPair = Reflection.getClass("{nms}.ChunkCoordIntPair"); + private static final Class chunkCoordinateIntPair = Reflection.getClass("net.minecraft.ChunkCoordIntPair"); private static final Reflection.Field multiBlockChangeChunk = Reflection.getField(TechHider.multiBlockChangePacket, chunkCoordinateIntPair, 0); private static final Reflection.Field chunkCoordinateX = Reflection.getField(chunkCoordinateIntPair, int.class, 0); private static final Reflection.Field chunkCoordinateZ = Reflection.getField(chunkCoordinateIntPair, int.class, 1); - private static final Class multiBlockChangeInfo = Reflection.getClass("{nms}.PacketPlayOutMultiBlockChange$MultiBlockChangeInfo"); + private static final Class multiBlockChangeInfo = Reflection.getClass("net.minecraft.PacketPlayOutMultiBlockChange$MultiBlockChangeInfo"); private static final Reflection.Constructor multiBlockChangeInfoConstructor = Reflection.getConstructor(multiBlockChangeInfo, TechHider.multiBlockChangePacket, short.class, TechHider.iBlockData); private static final Reflection.Field multiBlockChangeInfoBlock = Reflection.getField(multiBlockChangeInfo, TechHider.iBlockData, 0); private static final Reflection.Field multiBlockChangeInfoPos = Reflection.getField(multiBlockChangeInfo, short.class, 0); - private static final Class multiBlockChangeInfoArray = Reflection.getClass("[L{nms}.PacketPlayOutMultiBlockChange$MultiBlockChangeInfo;"); + private static final Class multiBlockChangeInfoArray = Reflection.getClass("[Lnet.minecraft.PacketPlayOutMultiBlockChange$MultiBlockChangeInfo;"); private static final Reflection.Field multiBlockChangeInfos = Reflection.getField(TechHider.multiBlockChangePacket, multiBlockChangeInfoArray, 0); @Override public BiFunction multiBlockChangeGenerator(TechHider techHider) { diff --git a/SpigotCore/SpigotCore_9/src/de/steamwar/core/BountifulWrapper9.java b/SpigotCore/SpigotCore_9/src/de/steamwar/core/BountifulWrapper9.java index f3642096..629d8365 100644 --- a/SpigotCore/SpigotCore_9/src/de/steamwar/core/BountifulWrapper9.java +++ b/SpigotCore/SpigotCore_9/src/de/steamwar/core/BountifulWrapper9.java @@ -42,16 +42,16 @@ public class BountifulWrapper9 implements BountifulWrapper.IBountifulWrapper { player.spigot().sendMessage(type, msg); } - private static final Class dataWatcherObject = Reflection.getClass("{nms.network.syncher}.DataWatcherObject"); - private static final Class dataWatcherRegistry = Reflection.getClass("{nms.network.syncher}.DataWatcherRegistry"); - private static final Class dataWatcherSerializer = Reflection.getClass("{nms.network.syncher}.DataWatcherSerializer"); + private static final Class dataWatcherObject = Reflection.getClass("net.minecraft.network.syncher.DataWatcherObject"); + private static final Class dataWatcherRegistry = Reflection.getClass("net.minecraft.network.syncher.DataWatcherRegistry"); + private static final Class dataWatcherSerializer = Reflection.getClass("net.minecraft.network.syncher.DataWatcherSerializer"); private static final Reflection.Constructor dataWatcherObjectConstructor = Reflection.getConstructor(dataWatcherObject, int.class, dataWatcherSerializer); @Override public Object getDataWatcherObject(int index, Class type) { return dataWatcherObjectConstructor.invoke(index, Reflection.getField(dataWatcherRegistry, dataWatcherSerializer, 0, type).get(null)); } - private static final Class item = Reflection.getClass("{nms.network.syncher}.DataWatcher$Item"); + private static final Class item = Reflection.getClass("net.minecraft.network.syncher.DataWatcher$Item"); private static final Reflection.Constructor itemConstructor = Reflection.getConstructor(item, dataWatcherObject, Object.class); @Override public Object getDataWatcherItem(Object dwo, Object value) { diff --git a/SpigotCore/SpigotCore_9/src/de/steamwar/core/CraftbukkitWrapper9.java b/SpigotCore/SpigotCore_9/src/de/steamwar/core/CraftbukkitWrapper9.java index eb036e22..6c44fd87 100644 --- a/SpigotCore/SpigotCore_9/src/de/steamwar/core/CraftbukkitWrapper9.java +++ b/SpigotCore/SpigotCore_9/src/de/steamwar/core/CraftbukkitWrapper9.java @@ -25,10 +25,10 @@ import org.bukkit.entity.Player; public class CraftbukkitWrapper9 implements CraftbukkitWrapper.ICraftbukkitWrapper { - private static final Class chunk = Reflection.getClass("{nms.world.level.chunk}.Chunk"); - private static final Class packetPlayOutMapChunk = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutMapChunk"); + private static final Class chunk = Reflection.getClass("net.minecraft.world.level.chunk.Chunk"); + private static final Class packetPlayOutMapChunk = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutMapChunk"); private static final Reflection.Constructor newPacketPlayOutMapChunk = Reflection.getConstructor(packetPlayOutMapChunk, chunk, int.class); - private static final Reflection.Method getHandle = Reflection.getMethod("{obc}.CraftChunk", "getHandle"); + private static final Reflection.Method getHandle = Reflection.getMethod("org.bukkit.craftbukkit.CraftChunk", "getHandle"); @Override public void sendChunk(Player p, int chunkX, int chunkZ) { diff --git a/SpigotCore/SpigotCore_9/src/de/steamwar/techhider/ChunkHider9.java b/SpigotCore/SpigotCore_9/src/de/steamwar/techhider/ChunkHider9.java index d305ca12..c47c0cc4 100644 --- a/SpigotCore/SpigotCore_9/src/de/steamwar/techhider/ChunkHider9.java +++ b/SpigotCore/SpigotCore_9/src/de/steamwar/techhider/ChunkHider9.java @@ -40,7 +40,7 @@ public class ChunkHider9 extends ChunkHider8 { private static final Reflection.Field mapChunkBlockEntities = Reflection.getField(mapChunkPacket, List.class, 0); private static final Reflection.Field mapChunkData = Reflection.getField(mapChunkPacket, byte[].class, 0); - private static final Class nbtTagCompound = Reflection.getClass("{nms.nbt}.NBTTagCompound"); + private static final Class nbtTagCompound = Reflection.getClass("net.minecraft.nbt.NBTTagCompound"); private static final Reflection.Method nbtTagGetString = Reflection.getTypedMethod(nbtTagCompound, null, String.class, String.class); @Override diff --git a/SpigotCore/SpigotCore_Main/src/com/comphenix/tinyprotocol/TinyProtocol.java b/SpigotCore/SpigotCore_Main/src/com/comphenix/tinyprotocol/TinyProtocol.java index 6997b3ef..0adf52d3 100644 --- a/SpigotCore/SpigotCore_Main/src/com/comphenix/tinyprotocol/TinyProtocol.java +++ b/SpigotCore/SpigotCore_Main/src/com/comphenix/tinyprotocol/TinyProtocol.java @@ -43,18 +43,18 @@ import java.util.logging.Level; public class TinyProtocol implements Listener { - private static final Class craftServer = Reflection.getClass("{obc}.CraftServer"); - private static final Class dedicatedPlayerList = Reflection.getClass("{nms.server.dedicated}.DedicatedPlayerList"); + private static final Class craftServer = Reflection.getClass("org.bukkit.craftbukkit.CraftServer"); + private static final Class dedicatedPlayerList = Reflection.getClass("net.minecraft.server.dedicated.DedicatedPlayerList"); private static final Field getPlayerList = Reflection.getField(craftServer, dedicatedPlayerList, 0); - private static final Class playerList = Reflection.getClass("{nms.server.players}.PlayerList"); - private static final Class minecraftServer = Reflection.getClass("{nms.server}.MinecraftServer"); + private static final Class playerList = Reflection.getClass("net.minecraft.server.players.PlayerList"); + private static final Class minecraftServer = Reflection.getClass("net.minecraft.server.MinecraftServer"); private static final Field getMinecraftServer = Reflection.getField(playerList, minecraftServer, 0); - public static final Class serverConnection = Reflection.getClass("{nms.server.network}.ServerConnection"); + public static final Class serverConnection = Reflection.getClass("net.minecraft.server.network.ServerConnection"); private static final Field getServerConnection = Reflection.getField(minecraftServer, serverConnection, 0); public static Object getServerConnection(Plugin plugin) { return getServerConnection.get(getMinecraftServer.get(getPlayerList.get(plugin.getServer()))); } - private static final Class networkManager = Reflection.getClass("{nms.network}.NetworkManager"); + private static final Class networkManager = Reflection.getClass("net.minecraft.network.NetworkManager"); public static final Field networkManagers = Reflection.getField(serverConnection, List.class, 0, networkManager); public static final TinyProtocol instance = new TinyProtocol(Core.getInstance()); diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/CommandRemover.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/CommandRemover.java index 712ceaf7..52787db6 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/CommandRemover.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/CommandRemover.java @@ -29,7 +29,7 @@ import java.util.Map; @UtilityClass public class CommandRemover { - private static final Reflection.Field commandMap = Reflection.getField("{obc}.CraftServer", "commandMap", SimpleCommandMap.class); + private static final Reflection.Field commandMap = Reflection.getField("org.bukkit.craftbukkit.CraftServer", "commandMap", SimpleCommandMap.class); private static final Reflection.Field knownCommands = Reflection.getField(SimpleCommandMap.class, "knownCommands", Map.class); public static void removeAll(String... cmds) { Map knownCmds = knownCommands.get(commandMap.get(Bukkit.getServer())); diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/FlatteningWrapper.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/FlatteningWrapper.java index 0f7e9e47..7262bbae 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/FlatteningWrapper.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/FlatteningWrapper.java @@ -29,8 +29,8 @@ import org.bukkit.inventory.ItemStack; public class FlatteningWrapper { private FlatteningWrapper() {} - public static final Class scoreboardObjective = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutScoreboardObjective"); - public static final Class scoreboardScore = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutScoreboardScore"); + public static final Class scoreboardObjective = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutScoreboardObjective"); + public static final Class scoreboardScore = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutScoreboardScore"); public static final IFlatteningWrapper impl = VersionDependent.getVersionImpl(Core.getInstance()); diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/ProtocolWrapper.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/ProtocolWrapper.java index 8706e2c6..915ac467 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/ProtocolWrapper.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/ProtocolWrapper.java @@ -27,16 +27,16 @@ import java.util.function.LongSupplier; public interface ProtocolWrapper { - Class itemStack = Reflection.getClass("{nms.world.item}.ItemStack"); - Class spawnPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutSpawnEntity"); - Class spawnLivingPacket = Core.getVersion() > 18 ? ProtocolWrapper.spawnPacket : Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutSpawnEntityLiving"); - Class equipmentPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityEquipment"); + Class itemStack = Reflection.getClass("net.minecraft.world.item.ItemStack"); + Class spawnPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity"); + Class spawnLivingPacket = Core.getVersion() > 18 ? ProtocolWrapper.spawnPacket : Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutSpawnEntityLiving"); + Class equipmentPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityEquipment"); - Class enumGamemode = Reflection.getClass(Core.getVersion() > 9 ? "{nms.world.level}.EnumGamemode" : "{nms}.WorldSettings$EnumGamemode"); + Class enumGamemode = Reflection.getClass(Core.getVersion() > 9 ? "net.minecraft.world.level.EnumGamemode" : "net.minecraft.WorldSettings$EnumGamemode"); Reflection.Method getGameModeById = Reflection.getTypedMethod(enumGamemode, null, enumGamemode, int.class); // 0: hand, 1: offhand, 2: feet, 3: legs, 4: chest, 5: head - Object[] itemSlots = Core.getVersion() > 8 ? Reflection.getClass("{nms.world.entity}.EnumItemSlot").getEnumConstants() : new Integer[]{0, 0, 1, 2, 3, 4}; + Object[] itemSlots = Core.getVersion() > 8 ? Reflection.getClass("net.minecraft.world.entity.EnumItemSlot").getEnumConstants() : new Integer[]{0, 0, 1, 2, 3, 4}; ProtocolWrapper impl = VersionDependent.getVersionImpl(Core.getInstance()); @@ -45,7 +45,7 @@ public interface ProtocolWrapper { Object playerInfoPacketConstructor(PlayerInfoAction action, GameProfile profile, GameMode mode); default void initTPSWarp(LongSupplier longSupplier) { - Class systemUtils = Reflection.getClass("{nms}.SystemUtils"); + Class systemUtils = Reflection.getClass("net.minecraft.SystemUtils"); Reflection.getField(systemUtils, LongSupplier.class, 0).set(systemUtils, (LongSupplier) () -> System.nanoTime() + longSupplier.getAsLong()); } diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TPSWatcher.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TPSWatcher.java index fefba9cd..f6714e0e 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TPSWatcher.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/TPSWatcher.java @@ -79,7 +79,7 @@ public class TPSWatcher { } } - private static final Class minecraftServer = Reflection.getClass("{nms.server}.MinecraftServer"); + private static final Class minecraftServer = Reflection.getClass("net.minecraft.server.MinecraftServer"); private static final Reflection.Method getServer = Reflection.getTypedMethod(minecraftServer, "getServer", minecraftServer); private static final Reflection.Field recentTps = Reflection.getField(minecraftServer, "recentTps", double[].class); private static double[] getSpigotTPS() { diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/authlib/AuthlibInjector.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/authlib/AuthlibInjector.java index 7319f4d4..b9c4011a 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/authlib/AuthlibInjector.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/authlib/AuthlibInjector.java @@ -27,7 +27,7 @@ public class AuthlibInjector { private AuthlibInjector() {} public static void inject() { - Class minecraftServerClass = Reflection.getClass("{nms.server}.MinecraftServer"); + Class minecraftServerClass = Reflection.getClass("net.minecraft.server.MinecraftServer"); Reflection.Field gameProfile = Reflection.getField(minecraftServerClass, GameProfileRepository.class, 0); Object minecraftServer = Reflection.getTypedMethod(minecraftServerClass, "getServer", minecraftServerClass).invoke(null); gameProfile.set(minecraftServer, new SteamwarGameProfileRepository((YggdrasilGameProfileRepository) gameProfile.get(minecraftServer))); diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/events/AntiNocom.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/events/AntiNocom.java index cccdc38c..8b801d1b 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/core/events/AntiNocom.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/core/events/AntiNocom.java @@ -54,11 +54,11 @@ public class AntiNocom implements Listener { } private void registerUseItem() { - Class useItem = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseItem"); + Class useItem = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUseItem"); Function getPosition; if(Core.getVersion() > 12) { - Class movingObjectPositionBlock = Reflection.getClass("{nms.world.phys}.MovingObjectPositionBlock"); + Class movingObjectPositionBlock = Reflection.getClass("net.minecraft.world.phys.MovingObjectPositionBlock"); Reflection.Field useItemPosition = Reflection.getField(useItem, movingObjectPositionBlock, 0); Reflection.Field movingBlockPosition = Reflection.getField(movingObjectPositionBlock, TechHider.blockPosition, 0); @@ -73,7 +73,7 @@ public class AntiNocom implements Listener { }); } - private static final Class blockDig = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInBlockDig"); + private static final Class blockDig = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInBlockDig"); private static final Reflection.Field digPosition = Reflection.getField(blockDig, TechHider.blockPosition, 0); private Object onDig(Player player, Object packet) { Object pos = digPosition.get(packet); diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntity.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntity.java index d4ffc19d..c2a7c12f 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntity.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntity.java @@ -160,7 +160,7 @@ public class REntity { server.postEntityMove(this, fromX, fromZ); } - private static final Class animationPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutAnimation"); + private static final Class animationPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutAnimation"); private static final Reflection.Field animationEntity = Reflection.getField(animationPacket, int.class, Core.getVersion() > 15 ? (Core.getVersion() > 19 ? 5 : 6) : 0); private static final Reflection.Field animationAnimation = Reflection.getField(animationPacket, int.class, Core.getVersion() > 15 ? (Core.getVersion() > 19 ? 6 : 7) : 1); public void showAnimation(byte animation) { @@ -170,7 +170,7 @@ public class REntity { server.updateEntity(this, packet); } - private static final Class velocityPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityVelocity"); + private static final Class velocityPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityVelocity"); private static final Reflection.Field velocityEntity = Reflection.getField(velocityPacket, int.class, 0); private static final Reflection.Field velocityX = Reflection.getField(velocityPacket, int.class, 1); private static final Reflection.Field velocityY = Reflection.getField(velocityPacket, int.class, 2); @@ -184,7 +184,7 @@ public class REntity { server.updateEntity(this, packet); } - private static final Class statusPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityStatus"); + private static final Class statusPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityStatus"); private static final Reflection.Field statusEntity = Reflection.getField(statusPacket, int.class, 0); private static final Reflection.Field statusStatus = Reflection.getField(statusPacket, byte.class, 0); public void showDamage() { @@ -346,7 +346,7 @@ public class REntity { } } - private static final Class destroyPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityDestroy"); + private static final Class destroyPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy"); private static final Reflection.Field destroyEntities; static { if(Core.getVersion() > 15) @@ -393,7 +393,7 @@ public class REntity { return ChatWrapper.impl.getDataWatcherPacket(entityId, dataWatcherKeyValues); } - public static final Class teleportPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityTeleport"); + public static final Class teleportPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport"); public static final Reflection.Field teleportEntity = Reflection.getField(teleportPacket, int.class, 0); public static final BountifulWrapper.PositionSetter teleportPosition = BountifulWrapper.impl.getPositionSetter(teleportPacket, Core.getVersion() == 8 ? 1 : 0); private Object getTeleportPacket(){ @@ -403,12 +403,12 @@ public class REntity { return packet; } - private static final Class entityPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntity"); + private static final Class entityPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntity"); private static final Reflection.Field moveEntityId = Reflection.getField(entityPacket, int.class, 0); private static final BountifulWrapper.PositionSetter movePosition = BountifulWrapper.impl.getRelMoveSetter(entityPacket); - private static final Class lookPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntity$PacketPlayOutEntityLook"); - private static final Class movePacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntity$PacketPlayOutRelEntityMove"); - private static final Class moveLookPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntity$PacketPlayOutRelEntityMoveLook"); + private static final Class lookPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntity$PacketPlayOutEntityLook"); + private static final Class movePacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntity$PacketPlayOutRelEntityMove"); + private static final Class moveLookPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntity$PacketPlayOutRelEntityMoveLook"); private Object getMoveLookPacket(double diffX, double diffY, double diffZ, boolean rotEq) { Class clazz; if(diffX == 0 && diffY == 0 && diffZ == 0) { @@ -428,7 +428,7 @@ public class REntity { return packet; } - private static final Class headRotationPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityHeadRotation"); + private static final Class headRotationPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityHeadRotation"); private static final Reflection.Field headRotationEntity = Reflection.getField(headRotationPacket, int.class, 0); private static final Reflection.Field headRotationYaw = Reflection.getField(headRotationPacket, byte.class, 0); private Object getHeadRotationPacket(){ @@ -440,7 +440,7 @@ public class REntity { private static final Reflection.Field equipmentEntity = Reflection.getField(ProtocolWrapper.equipmentPacket, int.class, 0); - private static final Class craftItemStack = Reflection.getClass("{obc}.inventory.CraftItemStack"); + private static final Class craftItemStack = Reflection.getClass("org.bukkit.craftbukkit.inventory.CraftItemStack"); private static final Reflection.Method asNMSCopy = Reflection.getTypedMethod(REntity.craftItemStack, "asNMSCopy", ProtocolWrapper.itemStack, ItemStack.class); protected Object getEquipmentPacket(Object slot, ItemStack stack){ Object packet = Reflection.newInstance(ProtocolWrapper.equipmentPacket); diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntityServer.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntityServer.java index 59df0563..60778b6a 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntityServer.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntityServer.java @@ -47,9 +47,9 @@ public class REntityServer implements Listener { private static final HashSet emptyEntities = new HashSet<>(0); private static final HashSet emptyPlayers = new HashSet<>(0); - private static final Class useEntity = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseEntity"); + private static final Class useEntity = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUseEntity"); private static final Reflection.Field useEntityTarget = Reflection.getField(useEntity, int.class, 0); - private static final Class useEntityEnumAction = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseEntity$EnumEntityUseAction"); + private static final Class useEntityEnumAction = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUseEntity$EnumEntityUseAction"); private static final Reflection.Field useEntityAction = Reflection.getField(useEntity, useEntityEnumAction, 0); private static final Function getEntityAction; static { diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java index cb4e4638..64b577ea 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java @@ -91,7 +91,7 @@ public class RPlayer extends REntity { packetSink.accept(ProtocolWrapper.impl.playerInfoPacketConstructor(ProtocolWrapper.PlayerInfoAction.REMOVE, new GameProfile(uuid, name), GameMode.CREATIVE)); } - private static final Class namedSpawnPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutNamedEntitySpawn"); + private static final Class namedSpawnPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn"); private static final Function namedSpawnPacketGenerator = spawnPacketGenerator(namedSpawnPacket, Core.getVersion() == 8 ? 1 : 0); private static final Reflection.Field namedSpawnUUID = Reflection.getField(namedSpawnPacket, UUID.class, 0); private Object getNamedSpawnPacket() { diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/network/handlers/ServerDataHandler.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/network/handlers/ServerDataHandler.java index 47b9a146..8941432b 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/network/handlers/ServerDataHandler.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/network/handlers/ServerDataHandler.java @@ -25,7 +25,7 @@ import com.comphenix.tinyprotocol.TinyProtocol; public class ServerDataHandler { public ServerDataHandler() { - TinyProtocol.instance.addFilter(Reflection.getClass("{nms.network.protocol.game}.ClientboundServerDataPacket"), (p, o) -> null); - TinyProtocol.instance.addFilter(Reflection.getClass("{nms.network.protocol.game}.ServerboundChatSessionUpdatePacket"), (player, packet) -> null); + TinyProtocol.instance.addFilter(Reflection.getClass("net.minecraft.network.protocol.game.ClientboundServerDataPacket"), (p, o) -> null); + TinyProtocol.instance.addFilter(Reflection.getClass("net.minecraft.network.protocol.game.ServerboundChatSessionUpdatePacket"), (player, packet) -> null); } } diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java index d29f082d..dff148ca 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/techhider/TechHider.java @@ -35,17 +35,17 @@ import java.util.stream.Collectors; public class TechHider { - public static final Class blockPosition = Reflection.getClass("{nms.core}.BlockPosition"); - private static final Class baseBlockPosition = Reflection.getClass("{nms.core}.BaseBlockPosition"); + public static final Class blockPosition = Reflection.getClass("net.minecraft.core.BlockPosition"); + private static final Class baseBlockPosition = Reflection.getClass("net.minecraft.core.BaseBlockPosition"); public static final Reflection.Field blockPositionX = Reflection.getField(baseBlockPosition, int.class, 0); public static final Reflection.Field blockPositionY = Reflection.getField(baseBlockPosition, int.class, 1); public static final Reflection.Field blockPositionZ = Reflection.getField(baseBlockPosition, int.class, 2); - public static final Class iBlockData = Reflection.getClass("{nms.world.level.block.state}.IBlockData"); - public static final Class block = Reflection.getClass("{nms.world.level.block}.Block"); + public static final Class iBlockData = Reflection.getClass("net.minecraft.world.level.block.state.IBlockData"); + public static final Class block = Reflection.getClass("net.minecraft.world.level.block.Block"); private static final Reflection.Method getBlockDataByBlock = Reflection.getTypedMethod(block, null, iBlockData); - public static final Class craftMagicNumbers = Reflection.getClass("{obc}.util.CraftMagicNumbers"); + public static final Class craftMagicNumbers = Reflection.getClass("org.bukkit.craftbukkit.util.CraftMagicNumbers"); private static final Reflection.Method getBlockByMaterial = Reflection.getTypedMethod(craftMagicNumbers, "getBlock", block, Material.class); private static final Reflection.Method getBlockByBlockData = Reflection.getTypedMethod(iBlockData, null, block); @@ -86,14 +86,14 @@ public class TechHider { techhiders.put(ChunkHider.impl.mapChunkPacket(), ChunkHider.impl.chunkHiderGenerator(this)); if(Core.getVersion() > 12 && Core.getVersion() < 19) { - Class blockBreakClass = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutBlockBreak"); + Class blockBreakClass = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutBlockBreak"); techhiders.put(blockBreakClass, ProtocolWrapper.impl.blockBreakHiderGenerator(blockBreakClass, this)); } if(Core.getVersion() > 8){ - techhiders.put(Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseItem"), (p, packet) -> p.getGameMode() == GameMode.SPECTATOR ? null : packet); + techhiders.put(Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUseItem"), (p, packet) -> p.getGameMode() == GameMode.SPECTATOR ? null : packet); } - techhiders.put(Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseEntity"), (p, packet) -> p.getGameMode() == GameMode.SPECTATOR ? null : packet); + techhiders.put(Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUseEntity"), (p, packet) -> p.getGameMode() == GameMode.SPECTATOR ? null : packet); } @@ -105,10 +105,10 @@ public class TechHider { techhiders.forEach(TinyProtocol.instance::removeFilter); } - public static final Class multiBlockChangePacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutMultiBlockChange"); + public static final Class multiBlockChangePacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutMultiBlockChange"); public static final UnaryOperator multiBlockChangeCloner = ProtocolUtils.shallowCloneGenerator(TechHider.multiBlockChangePacket); - private static final Class blockChangePacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutBlockChange"); + private static final Class blockChangePacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutBlockChange"); private static final Function blockChangeCloner = ProtocolUtils.shallowCloneGenerator(blockChangePacket); private static final Reflection.Field blockChangePosition = Reflection.getField(blockChangePacket, blockPosition, 0); private static final Reflection.Field blockChangeBlockData = Reflection.getField(blockChangePacket, iBlockData, 0); @@ -131,7 +131,7 @@ public class TechHider { } } - private static final Class blockActionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutBlockAction"); + private static final Class blockActionPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutBlockAction"); private static final Reflection.Field blockActionPosition = Reflection.getField(blockActionPacket, blockPosition, 0); private Object blockActionHider(Player p, Object packet) { if (locationEvaluator.checkBlockPos(p, blockActionPosition.get(packet)) == State.SKIP) @@ -139,7 +139,7 @@ public class TechHider { return null; } - public static final Class tileEntityDataPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutTileEntityData"); + public static final Class tileEntityDataPacket = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutTileEntityData"); private static final Reflection.Field tileEntityDataPosition = Reflection.getField(tileEntityDataPacket, blockPosition, 0); private Object tileEntityDataHider(Player p, Object packet) { switch (locationEvaluator.checkBlockPos(p, tileEntityDataPosition.get(packet))) {