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

Clean up redstone-power related data and properties #1023

Open
Aaron1011 opened this issue Jan 9, 2016 · 1 comment
Open

Clean up redstone-power related data and properties #1023

Aaron1011 opened this issue Jan 9, 2016 · 1 comment

Comments

@Aaron1011
Copy link
Contributor

Currently, redstone power levels are represented in the API through a combination of PoweredData, RedstonePoweredData, PoweredProperty, and IndirectlyPoweredProperty.

PoweredData and RedstonePoweredData are not clearly defined as to whether they deal with input or output power. As a consequence, they are implemented differently depending on the block, making it difficult to determine what they actually mean.

PoweredProperty and IndirectlyPoweredProperty do function properly, but their usefulness is greatly decreased by the fact that they deliberately hide the actual value, instead only returning a boolean.

As it stands currently, the represntation of redstone power in the API needs a general overhaul, both to improve usability and clearly define what is actually being represented.

@Aaron1011 Aaron1011 added the priority: low Low priority label Jan 9, 2016
@Aaron1011 Aaron1011 self-assigned this Jan 9, 2016
@Aaron1011 Aaron1011 changed the title Clean up redstone-power related data and properties. Clean up redstone-power related data and properties Jan 9, 2016
@me4502
Copy link
Contributor

me4502 commented May 2, 2016

I've had a go at this here, https://github.com/SpongePowered/SpongeAPI/compare/feature/clean-redstone

I feel PoweredData makes sense, because it states if a lever, button etc is currently in its powered state.

As for RedstonePoweredData, I changed that to RedstoneOutputData, as that's what it signifies.

As for the two properties, I changed them to integers and clarified in the javadocs what they do, and that they aren't applicable to all blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants