Skip to content

Conversation

@sylv256
Copy link
Member

@sylv256 sylv256 commented May 8, 2025

This PR refactors the codebase to use the new PredicateBlock system 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.

@sylv256 sylv256 requested a review from MerchantCalico May 8, 2025 02:33
Copy link
Member

@MerchantCalico MerchantCalico left a 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() {
Copy link
Member

@MerchantCalico MerchantCalico May 14, 2025

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() {
Copy link
Member

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.

@sylv256
Copy link
Member Author

sylv256 commented Jul 7, 2025

Whenever I come back to this I'm going to minimize the jank by removing the self-mixin.

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