Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mod Conflict] Cobblemon Restoration Tank #508

Closed
JPAKx4 opened this issue Dec 22, 2024 · 1 comment
Closed

[Mod Conflict] Cobblemon Restoration Tank #508

JPAKx4 opened this issue Dec 22, 2024 · 1 comment

Comments

@JPAKx4
Copy link

JPAKx4 commented Dec 22, 2024

When connected to the storage network, the restoration tank (As multiblock or on it's own) throws an index out of bounds exception when ticking InventoryConnectorBlockEntity. This crashes the server.

This is the file for the restoration block: https://gitlab.com/cable-mc/cobblemon/-/blob/main/common/src/main/kotlin/com/cobblemon/mod/common/block/RestorationTankBlock.kt

I am a Cobblemon dev so if the restoration block needs to be changed to create compatibility then feel free to let me know and/or point me in the right direction.

https://mclo.gs/Wy82ShJ

@tom5454
Copy link
Owner

tom5454 commented Dec 25, 2024

It's an issue in your code here:
https://gitlab.com/cable-mc/cobblemon/-/blob/main/common/src/main/kotlin/com/cobblemon/mod/common/block/entity/RestorationTankBlockEntity.kt#L121
You return -1 that's then crashing inside Fabric API, you have to return an empty array instead.
This will crash with every mod that's trying to interact with the block's inventory.

@tom5454 tom5454 closed this as completed Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants