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

Fix #200 - Crash When Placing a Comparator Reading a Large Energy Storage #202

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

aderoian
Copy link
Contributor

@aderoian aderoian commented Dec 9, 2024

Fixes #200

Changes

  • Added ComparatorOutputProvider to standardizing getting a comparator value from a block entity
  • RedstoneAddonBlockEntity.RedstoneControllable overrides ComparatorOutputProvider#getComparatorOutput and always returns 0 since only the redstone addon should be used to read comparator output.

Fix

Initial Cause: Invalid casting in SmallStorageBlock

We now cast to ComparatorOutputProvider since all block entities of a block with a comparator output should be its child. Since RedstoneAddonBlockEntity.RedstoneControllable overrides ComparatorOutputProvider#getComparatorOutput there is no longer an invalid cast.

@Rearth
Copy link
Owner

Rearth commented Dec 11, 2024

Great PR, thanks. Adding an interface to standardize this across entities is something I should've done much earlier already

@Rearth Rearth merged commit 3c66e61 into Rearth:1.21 Dec 11, 2024
1 check failed
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

Successfully merging this pull request may close these issues.

Crash When Placing a Comparator Reading a Large Energy Storage
2 participants