Fix stabilizer block check for Node Linker. #32
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Node Linking Device is supposed to be stabilized by a block of Ichorium placed above, preventing it from exploding when its instability gets too high. However, the check was implemented wrong (comparing
ItemStack
s does not work, as the class does not define anequals
method).This PR fixes it by comparing the
Block
instead. Additionally, the correctBlock
is cached at initialization, so that an ore dictionary query is not needed every tick.Currently there is only one block of ichorium (matching
blockIchorium
in the ore dictionary) in the pack. If there is ever any reason to add more (for example, Chisel variants), this check needs to be adjusted so that it accepts any of them. With this PR, the first entry from the ore dictionary is always selected as the only valid stabilizer block.Thanks to @crzymn777 from discord for reporting this.