ModificationStation / StationAPI

A general use API for Fabric Loader mods on legacy Minecraft versions.
85 stars 19 forks source link

Blocks with ID above 255 cause issues #106

Closed paulevsGitch closed 6 months ago

paulevsGitch commented 6 months ago

All blocks which get ID above 255 will replace vanilla items and will break drops for vanilla blocks: image

No blocks with large IDs: image

image

Interaction with vanilla blocks in the world will result with crash:

java.lang.ArrayIndexOutOfBoundsException: Index 256 out of bounds for length 256 at net.minecraft.block.Block.afterBreak(Block.java:644) at net.minecraft.block.Block.afterBreak(Block.java:2467) at net.minecraft.client.SinglePlayerClientInteractionManager.redirect$zkj000$station-flattening-v0$stationapi_redirectAfterBreak(SinglePlayerClientInteractionManager.java:1073) at net.minecraft.client.SinglePlayerClientInteractionManager.activateBlock(SinglePlayerClientInteractionManager.java:47) at net.minecraft.client.SinglePlayerClientInteractionManager.digBlock(SinglePlayerClientInteractionManager.java:86) at net.minecraft.client.Minecraft.processDigging(Minecraft.java:769) at net.minecraft.client.Minecraft.tick(Minecraft.java:1038) at net.minecraft.client.Minecraft.run(Minecraft.java:531) at java.base/java.lang.Thread.run(Thread.java:833)

Most likely this is related to ItemStacks that are created before proper init of blocks and items (for stats), there is a solution for this problem

mineLdiver commented 6 months ago

Can't seem to reproduce the issue. Registered 100000 randomly colored blocks.

Through HMI, items are being given properly. Interacting with vanilla blocks doesn't cause crashes.

I'm not sure what's going on here.

paulevsGitch commented 6 months ago

It can be reproduced with most mods that add many new block, for example with only BNB

mineLdiver commented 6 months ago

Does it happen only in multiplayer? Because in singleplayer I can't reproduce what you've described even with 100000 blocks

paulevsGitch commented 6 months ago

It happens in singleplayer, I didn't test multiplayer. That can be recreated with current BNB branch in IDE

paulevsGitch commented 6 months ago

Issue was fixed, was on VBE side