Repository navigation
Add standalone structure channel definitions - #76
Conversation
Glease
left a comment
There was a problem hiding this comment.
I agree this gap in feature is real and something needs to be done, but I'm not sure if we should do it in the way taken by this PR. The IChannelDefinition and ChannelDefinitions dual give me a very awkward feeling. It's following existing code's pattern (IStructrueDefinition vs StructrueDefinition) but in a way that I'd call awkward. My question on the validate() is just one symptom of it.
The fact that you didn't even mention that channel value can be 0 now in PR description is also rather awkward. Did you accidentally committed two unrelated feature into one PR?
Moved the bounded and unbounded factories to IChannelDefinition and removed ChannelDefinitions. Validation is now performed internally when adding a definition to the structure builder, with no standalone validate() method 0 is intentional and noted in the pr description. A channel can explicitly store 0, while an absent channel remains distinct by having no nbt entry, with the standard accessor still falling back to the trigger stack size. Structures requiring positive values can declare a minimum of 1 |
|
I cannot agree to a change in minimal channel value. An cursory scan of GT5 reveals LSC's capacitor IStructureElement will crash if given a channel value of 0. I'd assume more exist in the codebase. You need to either pull this part back or prepare a comprehensive PR to change all of these behavior |
reverted these changes |
Summary
StructureLib has never allowed certain special purpose channels (such as height and widget) to exist independently; they could only be emulated by mapping them to a block
This is resolved by adding independent channel definitions, allowing custom channels to be added with configurable ranges
Channel values may include 0; an absent channel remains distinct and retains the standard stacksize fallback
Showcase:

Checklist