Skip to content

Commit

Permalink
Avoid map lookup in isMovementBlocker calls (#2906)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirYwell authored Sep 3, 2024
1 parent a369513 commit 378334b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ public boolean isTicksRandomly() {
return block.isRandomlyTicking(blockState);
}

@SuppressWarnings("deprecation")
@Override
public boolean isMovementBlocker() {
return craftMaterial.isSolid();
return blockState.blocksMotion();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ public boolean isTicksRandomly() {
return block.isRandomlyTicking(blockState);
}

@SuppressWarnings("deprecation")
@Override
public boolean isMovementBlocker() {
return craftMaterial.isSolid();
return blockState.blocksMotion();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ public boolean isTicksRandomly() {
return blockState.isRandomlyTicking();
}

@SuppressWarnings("deprecation")
@Override
public boolean isMovementBlocker() {
return craftMaterial.isSolid();
return blockState.blocksMotion();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ public boolean isTicksRandomly() {
return blockState.isRandomlyTicking();
}

@SuppressWarnings("deprecation")
@Override
public boolean isMovementBlocker() {
return craftMaterial.isSolid();
return blockState.blocksMotion();
}

@Override
Expand Down

0 comments on commit 378334b

Please sign in to comment.