CreativeCore

CreativeCore

88M Downloads

Missing methods and inconsistent calls on Fabric networking

SrRapero720 opened this issue ยท 5 comments

commented

Example 1:
CreativeNetwork#sendToClient(CreativePacket, Level, BlockPos); and its variants aren't available on Fabric version of CreativeCore

Example 2:
Type registration is inconsistent, it calls methods like CreativePacket#executeServer directly instead of run CreativePacket properly
On my implementation i made my custom methods for networking doing the common class casting and then calling my custom methods, making the default CC methods no-op throwing an exception

Again, working on forge, not on fabric, because type register adds the consumer calling sided execute methods directly
image

commented

Fixed the first example. Not sure what your second thing is about?

commented

I mean these

context.player().getServer().execute(() -> payload.executeServer(context.player()));

And these

context.client().execute(() -> payload.executeClient(context.player()));

These should be calling CreativePacket#execute instead of directly call sided methods
I use execute to run common task that the packet can do in both sides like set the data of a block entity and use sided methods to do things like seek the MediaPlayer of WaterFrames

commented

On forge that's how was done (calling execute). Fabric differs of that

ctx.enqueueWork(() -> packet.execute(ctx.player()));

commented

Will be fixed in the next update for 1.21, do you need this for 1.20 as well?

commented

Will be fixed in the next update for 1.21, do you need this for 1.20 as well?

if you please