Skip to content

Ghost block + multiblock component refactor#706

Merged
LordIdra merged 3 commits into
masterfrom
idra/ghost-block-refactor
May 9, 2026
Merged

Ghost block + multiblock component refactor#706
LordIdra merged 3 commits into
masterfrom
idra/ghost-block-refactor

Conversation

@LordIdra
Copy link
Copy Markdown
Contributor

Ghost blocks and multiblock components have become quite a mess with all the changes that have been made. This PR cleans it up by unifying the multiblock components under a single class (there was never really any good reason for it to be an interface) and adding an abstraction layer (RebarGhostBlockHolder) which separates the ghost block logic from the multiblock logic. The abstraction layer will also allow implementors of RebarMultiblock to spawn their own ghost blocks easily, which was previously very annoying to do. This also unifies handling of mixed multiblock components (rebar/vanilla) which has removed a lot of unnecessary logic.

Comment thread rebar/src/main/kotlin/io/github/pylonmc/rebar/block/base/RebarSimpleMultiblock.kt Outdated
Copy link
Copy Markdown
Member

@Seggan Seggan left a comment

Choose a reason for hiding this comment

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

Woops wrong button

@Intybyte
Copy link
Copy Markdown
Member

While this approach is much simpler, it also prevents people from making their own blocks using multiblocks, let's say i am a plugin dev and i want part of it to be done using idk, a Nexo or ItemsAdder block, now i can't add such feature without forking rebar unlike before

@LordIdra
Copy link
Copy Markdown
Contributor Author

While this approach is much simpler, it also prevents people from making their own blocks using multiblocks, let's say i am a plugin dev and i want part of it to be done using idk, a Nexo or ItemsAdder block, now i can't add such feature without forking rebar unlike before

Yes you can, just extend MultiblockComponent

@Intybyte
Copy link
Copy Markdown
Member

While this approach is much simpler, it also prevents people from making their own blocks using multiblocks, let's say i am a plugin dev and i want part of it to be done using idk, a Nexo or ItemsAdder block, now i can't add such feature without forking rebar unlike before

Yes you can, just extend MultiblockComponent

oh it is an open class, then it should be fine

@LordIdra LordIdra merged commit 849e349 into master May 9, 2026
1 check passed
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.

3 participants