Skip to content
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

Optimized mana enchanter multiblock checking #4465

Merged

Conversation

TheRealWormbo
Copy link
Collaborator

As per #4388, the enchanter no longer assumes its rotation could change from one tick to another and performs its structure validation at a much reduced rate while it is idle.

@@ -136,6 +137,8 @@ public class ManaEnchanterBlockEntity extends BotaniaBlockEntity implements Mana

public int stage3EndTicks = 0;

private transient int idleTicks = 0;
Copy link
Member

Choose a reason for hiding this comment

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

remove transient

return switch (axis) {
case X -> Rotation.NONE;
case Z -> Rotation.CLOCKWISE_90;
default -> null;
Copy link
Member

Choose a reason for hiding this comment

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

you could just throw here and elide the null check on the caller side, this is never going to be Y

@TheRealWormbo TheRealWormbo force-pushed the 1.20-mana-enchanter-optimization branch from cad1cd1 to 279ad82 Compare October 21, 2023 08:37
@williewillus williewillus merged commit d9e949b into VazkiiMods:1.20.x Oct 24, 2023
1 check passed
@TheRealWormbo TheRealWormbo deleted the 1.20-mana-enchanter-optimization branch October 25, 2023 06:03
williewillus pushed a commit that referenced this pull request Oct 29, 2023
…ions (#4470)

This fixes a bug introduced in PR #4465 where the validation mapping
between an axis and the multiblock rotation were the opposite of the
mapping defined when forming the enchanter multiblock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants