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

chore: apply workaround for @In malfunction in actions #102

Merged
merged 3 commits into from
Apr 3, 2022

Conversation

jdrueckert
Copy link
Member

@jdrueckert jdrueckert commented Mar 31, 2022

Contributes to MovingBlocks/Terasology#4981

What this PR does

Use initialization in construct() consistently throughout behavior actions

@Override
public void construct(Actor actor) {
    if (world == null) {
        world = CoreRegistry.get(WorldProvider.class);
    }
}
  • this will work if @in has no effect, i.e., the field is initialized to null
  • this will work if @in is fixed and initializes the field correctly, making the code in construct a no-op
  • we preserve the information that we want to use @in in actions

Additional chores

  • format prefabs (JSON)
  • minor code simplification recommended by intellij in CheckAttackStopAction action

@jdrueckert jdrueckert added Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Type: Chore Request for or implementation of maintenance changes labels Mar 31, 2022
@jdrueckert jdrueckert requested a review from skaldarnar March 31, 2022 22:34
@jdrueckert jdrueckert changed the title chore: add "initialization in construct" workaround for @In malfunction in actions chore: apply workaround for @In malfunction in actions Mar 31, 2022
skaldarnar
skaldarnar previously approved these changes Apr 2, 2022
@skaldarnar skaldarnar merged commit 63469e7 into develop Apr 3, 2022
@skaldarnar skaldarnar deleted the chore/In-workaround branch April 3, 2022 20:06
@jdrueckert
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Type: Chore Request for or implementation of maintenance changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants