Sinytra / ForgifiedFabricAPI

Fabric API implemented on top of NeoForge
https://sinytra.org/docs
Apache License 2.0
115 stars 16 forks source link

Feature request fix CustomPacketAPI fix #161

Open fantahund opened 1 month ago

fantahund commented 1 month ago

Discussed in https://github.com/Sinytra/ForgifiedFabricAPI/discussions/160

Originally posted by **fantahund** September 30, 2024 If you register CustomPacket via the Fabric API you always get a ClassCastExeption. With the original Fabric api you don't get this error. On the Neoforge discord I was told that it is most likely due to the Forgiefied Fabric API. The class that causes the problem for me is in the Voxelmap I link it once. Packet: [Packet Class](https://github.com/fantahund/VoxelMap/blob/1.21_NeoForge_Fabric/common/src/main/java/com/mamiyaotaru/voxelmap/packets/WorldIdC2S.java) Register: [Register Class](https://github.com/fantahund/VoxelMap/blob/1.21_NeoForge_Fabric/common/src/main/java/com/mamiyaotaru/voxelmap/VoxelmapWorldIdChannelHandler.java) Error: [Error: https://cpaste.de/surovivabu.pl](https://cpaste.de/surovivabu.pl)
Su5eD commented 1 month ago

Please use a paste site for uploading logs instead of including them in the description - this makes the page unreadable.

Su5eD commented 1 month ago

Hi, I've cloned the VoxelMap repo and tried running the game using the runClient gradle task and IDE run config, but they both resulted in a crash shortly after launching.

Caused by: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: @Inject annotation on onTick specifies a target class 'net/minecraft/class_310', which is not supported [PREINJECT Applicator Phase -> mixin.voxelmap.json:APIMixinMinecraftClient from mod voxelmap -> Prepare Injections -> handler$zzb000$voxelmap$onTick(Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V -> Parse -> -> Parse Selectors]

fantahund commented 1 month ago

I am new to Neoforge and have been trying to get it to work for an hour now. I never use it because I have a test environment in Prism. I could only find out that it tries to start with the 1.21 but it should take the 1.21.1. I have not figured out how to tell it to do that.

fantahund commented 1 month ago

Oh, and please use the 1.21.1 branch now, the Fabric Neoforge branch is outdated