Avoid map lookup in isMovementBlocker calls (#2906)

This commit is contained in:
Hannes Greule 2024-09-03 21:39:32 +02:00 committed by GitHub
parent a369513684
commit 378334bd75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 4 deletions

View File

@ -135,9 +135,10 @@ public class PaperweightBlockMaterial implements BlockMaterial {
return block.isRandomlyTicking(blockState);
}
@SuppressWarnings("deprecation")
@Override
public boolean isMovementBlocker() {
return craftMaterial.isSolid();
return blockState.blocksMotion();
}
@Override

View File

@ -125,9 +125,10 @@ public class PaperweightBlockMaterial implements BlockMaterial {
return block.isRandomlyTicking(blockState);
}
@SuppressWarnings("deprecation")
@Override
public boolean isMovementBlocker() {
return craftMaterial.isSolid();
return blockState.blocksMotion();
}
@Override

View File

@ -126,9 +126,10 @@ public class PaperweightBlockMaterial implements BlockMaterial {
return blockState.isRandomlyTicking();
}
@SuppressWarnings("deprecation")
@Override
public boolean isMovementBlocker() {
return craftMaterial.isSolid();
return blockState.blocksMotion();
}
@Override

View File

@ -126,9 +126,10 @@ public class PaperweightBlockMaterial implements BlockMaterial {
return blockState.isRandomlyTicking();
}
@SuppressWarnings("deprecation")
@Override
public boolean isMovementBlocker() {
return craftMaterial.isSolid();
return blockState.blocksMotion();
}
@Override