Skip to content

Add standalone structure channel definitions - #76

Merged
Glease merged 7 commits into
masterfrom
custom-channel
Oct 15, 2026
Merged

Glease merged 7 commits into
masterfrom
custom-channel

Conversation

@ABKQPO

@ABKQPO ABKQPO commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

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:
image

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

@Glease Glease left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread src/main/java/com/gtnewhorizon/structurelib/structure/IChannelAwareElement.java Outdated
Comment thread src/main/java/com/gtnewhorizon/structurelib/structure/ChannelDefinitions.java Outdated
@ABKQPO

ABKQPO commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

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

@Dream-Master
Dream-Master requested a review from Glease October 7, 2026 08:31
@Glease

Glease commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

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

@ABKQPO

ABKQPO commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

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

Comment thread src/main/java/com/gtnewhorizon/structurelib/gui/GuiScreenConfigureChannels.java Outdated
Comment thread src/main/java/com/gtnewhorizon/structurelib/structure/IChannelAwareElement.java Outdated
@Glease
Glease merged commit 9672d40 into master Oct 15, 2026
2 checks passed
@Glease
Glease deleted the custom-channel branch October 15, 2026 01:11
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.

2 participants