Open Aaron1011 opened 8 years ago
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.
Currently, redstone power levels are represented in the API through a combination of
PoweredData
,RedstonePoweredData
,PoweredProperty
, andIndirectlyPoweredProperty
.PoweredData
andRedstonePoweredData
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
andIndirectlyPoweredProperty
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.