286799714 / TimelessandClassics_Reforged

A forked version of CGM, based around adding significant amounts of more realistic improvement, while maintaining the same simplicity and customization
28 stars 16 forks source link

[Bug - 0.3.10.1] Missing / Wrong Number of Material in Crafting Guns. #70

Open ItsukaHiro opened 3 months ago

ItsukaHiro commented 3 months ago

After manage to build the jar file, crafting recipe is working on client side. But when running mod on server, there is 4 guns that have wrong recipe: image image image image

Compare to singleplayer: image image image image

I really need a fix right now because I'm planning to open a server in around next two. Hope you can help me.

ItsukaHiro commented 3 months ago

After digging a liitle bit (when I realize M82A2 still have iron ingot as material, just wrong number), I try to modify the actual amount of iron ingot by using datapack. And yah, the number show in workbench equal the actual amount minus 256

And, if I have enough material (as the datapack show), I still can craft the gun normally on the server :V

ItsukaHiro commented 3 months ago

Found the issue: When transfer the recipe through network, the code use readByte() and writeByte(), which is limited in -127 to 127, while the number is larger. Easy solution is change it to readShort() and writeShort().