Skip to content

Conversation

@SpaceWalkerRS
Copy link
Contributor

@SpaceWalkerRS SpaceWalkerRS commented Nov 11, 2024

No description provided.

private static boolean ignoreNonWires = false;

public static int getNeighborBlockSignal(Block wireBlock, RedstoneWireEvaluator evaluator, Level level, BlockPos pos) {
ignoreWires = true;
Copy link
Member

Choose a reason for hiding this comment

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

I am concerned about these static fields, mod compatibility with threading mods will definitely suffer

Copy link
Member

Choose a reason for hiding this comment

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

I think converting them to a local variable should be possible if I am not misunderstanding the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah that'd work

Copy link
Member

@2No2Name 2No2Name left a comment

Choose a reason for hiding this comment

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

Since you are the original author of this optimization and also the tests are passing, I mostly trust that the code is correct. When merging I will change the static fields to local variables, as I do not see a good reason to keep them static.

private static boolean ignoreNonWires = false;

public static int getNeighborBlockSignal(Block wireBlock, RedstoneWireEvaluator evaluator, Level level, BlockPos pos) {
ignoreWires = true;
Copy link
Member

Choose a reason for hiding this comment

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

I think converting them to a local variable should be possible if I am not misunderstanding the code

@2No2Name
Copy link
Member

Rebased onto develop and replaced the static fields with local variables.

Thanks for the PR

@2No2Name 2No2Name closed this Nov 14, 2024
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