Use pattern matching for instanceof (#1019)
This commit is contained in:
1 parent
97e7d660e4
commit
7ebc990ef6
8 files changed
+24
-48
No files matched your search
@@ -180,8 +180,7 @@ public class OptimizedExplosion
|
||||
|
||||
entity.setVelocity(entity.getVelocity().add(d5 * d11, d7 * d11, d9 * d11));
|
||||
|
||||
if (entity instanceof PlayerEntity) {
|
||||
PlayerEntity player = (PlayerEntity) entity;
|
||||
if (entity instanceof PlayerEntity player) {
|
||||
|
||||
if (!player.isSpectator()
|
||||
&& (!player.isCreative() || !player.getAbilities().flying)) { //getAbilities
|
||||
|
||||
Reference in new issue
Block a user