From 51c17c6c30f1d51d7d773378953cdcad8dff403e Mon Sep 17 00:00:00 2001 From: Roelymole Date: Thu, 9 Jan 2025 00:58:24 +0000 Subject: [PATCH] fix: removed old code and handled edge case where entity is underwater with water breathing in space --- .../impl/internal/mixin/gear/LivingEntityMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dev/galacticraft/impl/internal/mixin/gear/LivingEntityMixin.java b/src/main/java/dev/galacticraft/impl/internal/mixin/gear/LivingEntityMixin.java index 8b04adbc2..31af220a2 100644 --- a/src/main/java/dev/galacticraft/impl/internal/mixin/gear/LivingEntityMixin.java +++ b/src/main/java/dev/galacticraft/impl/internal/mixin/gear/LivingEntityMixin.java @@ -79,7 +79,7 @@ private void galacticraft_oxygenCheck(CallbackInfo ci) { LivingEntity entity = ((LivingEntity) (Object) this); if (entity.isAlive()) { if (!entity.level().isBreathable(entity.blockPosition().relative(Direction.UP, (int) Math.floor(entity.getEyeHeight(entity.getPose()))))) { - if (!entity.canBreatheUnderwater() && (!(entity instanceof Player) || !((Player)entity).getAbilities().invulnerable)) { + if (!entity.isEyeInFluid(FluidTags.WATER) && (!(entity instanceof Player) || !((Player)entity).getAbilities().invulnerable)) { entity.setAirSupply(this.decreaseAirSupply(entity.getAirSupply())); if (entity.getAirSupply() == -20) { entity.setAirSupply(0);