Fix one more warning

This commit is contained in:
Sollace 2024-04-12 01:27:56 +01:00
parent 136267f439
commit fd8a2f3f32
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -218,7 +218,7 @@ public class WorldRenderDelegate {
} }
private void flipAngles(Entity entity) { private void flipAngles(Entity entity) {
if (entity instanceof PlayerEntity player) { if (entity instanceof PlayerEntity) {
entity.prevYaw *= -1; entity.prevYaw *= -1;
entity.setYaw(entity.getYaw() * -1); entity.setYaw(entity.getYaw() * -1);
@ -226,9 +226,7 @@ public class WorldRenderDelegate {
entity.setPitch(entity.getPitch() * -1); entity.setPitch(entity.getPitch() * -1);
} }
if (entity instanceof LivingEntity) { if (entity instanceof LivingEntity living) {
LivingEntity living = (LivingEntity)entity;
living.bodyYaw = -living.bodyYaw; living.bodyYaw = -living.bodyYaw;
living.prevBodyYaw = -living.prevBodyYaw; living.prevBodyYaw = -living.prevBodyYaw;
living.headYaw = -living.headYaw; living.headYaw = -living.headYaw;