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

Placement of conduit type blocks don't cause block updates under certain circumstances #150

Open
Da-Technomancer opened this issue Jul 29, 2021 · 0 comments
Labels
bug Low Priority If this is on a bug, it means that it is difficult to fix, and not urgent

Comments

@Da-Technomancer
Copy link
Member

Describe the bug
When placing a conduit type block (including heat cables, fluid tubes, and alchemy conduits), if the conduit would have a connection immediately upon placement, the placement does not cause a block update, regardless of flags on the original setBlockState call.

Additional context [Optional]
This is a low impact edge case.

This is caused by this call: https://github.com/Da-Technomancer/Crossroads/blob/1.16/src/main/java/com/Da_Technomancer/crossroads/API/templates/ConduitBlock.java#L170
Which is called during World::setBlockState
This call results in this call: https://github.com/Da-Technomancer/Crossroads/blob/1.16/src/main/java/com/Da_Technomancer/crossroads/API/templates/ConduitBlock.java#L306
Turns out calling World::setBlockState at a position during another World::setBlockState call at that position overwrites the previous flags, causing the flag parameter to be 2 regardless of the initial value.
Block updates require (flag & 1) != 0 to occur.

@Da-Technomancer Da-Technomancer added bug Low Priority If this is on a bug, it means that it is difficult to fix, and not urgent labels Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Low Priority If this is on a bug, it means that it is difficult to fix, and not urgent
Projects
None yet
Development

No branches or pull requests

1 participant