From dc72ec1b93163c477f37fb8b75f67dedc4ecd4d6 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sun, 13 Jul 2025 20:57:22 +0200 Subject: [PATCH] Hotfix REntityServer for 1.15 or earlier --- .../SpigotCore_Main/src/de/steamwar/entity/REntityServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntityServer.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntityServer.java index 119507aa..2a9a2a13 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntityServer.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntityServer.java @@ -50,11 +50,11 @@ public class REntityServer implements Listener { private static final Class useEntity = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundInteractPacket"); private static final Reflection.Field useEntityTarget = Reflection.getField(useEntity, int.class, 0); private static final Class useEntityEnumAction = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundInteractPacket$Action"); - private static final Class useEntityEnumActionType = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundInteractPacket$ActionType"); private static final Reflection.Field useEntityAction = Reflection.getField(useEntity, useEntityEnumAction, 0); private static final Function getEntityAction; static { if(Core.getVersion() > 15) { + Class useEntityEnumActionType = Reflection.getClass("net.minecraft.network.protocol.game.ServerboundInteractPacket$ActionType"); Reflection.Method useEntityGetAction = Reflection.getTypedMethod(useEntityEnumAction, null, useEntityEnumActionType); getEntityAction = value -> ((Enum) useEntityGetAction.invoke(value)).ordinal(); } else {