-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Predicate Redstone #11
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
base: 1.21
Are you sure you want to change the base?
Conversation
- `PredicateBlockItem` → `OperatorBlockItem` - All `PredicateBarrierBlock` use `OperatorBlockItem`
MerchantCalico
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good. While a bit cursed, the refactors make total sense to me.
I've mainly suggested a change caused by my old multiloader shenanigan code, to help avoid issues in the future with other mods integrating with us.
| conditionTemplate("creative_only") | ||
| ); | ||
|
|
||
| public static void registerAll() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moreso an issue caused by my own code and not knowing you could do this, but we could move the actual registration away from registerAll(), and instead have it ran in the block/item fields. Which would help with race conditions on Fabric.
Like this:
public static final PredicateButtonBlock CREATIVE_ONLY_BUTTON = register("creative_only_button", new PredicateButtonBlock(
buttonProps(),
Barricade.asResource("barricade/icon/iron_sword"),
conditionTemplate("creative_only")
));| barrierProps() | ||
| ); | ||
|
|
||
| public static void registerAll() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment on block registration code.
common/src/main/java/net/modgarden/barricade/block/PredicateLeverBlock.java
Show resolved
Hide resolved
|
Whenever I come back to this I'm going to minimize the jank by removing the self-mixin. |
This PR refactors the codebase to use the new
PredicateBlocksystem and adds two new blocks: the Creative-Only Lever and the Creative-Only Button. It also does a few quality of life things such as enabling Enhanced Class Redefinition (DCEVM is now required) and using helper methods in registration classes.