Skip to content

Commit

Permalink
fix: removed old code and handled edge case where entity is underwate…
Browse files Browse the repository at this point in the history
…r with water breathing in space
  • Loading branch information
Roelymole committed Jan 9, 2025
1 parent 07d8db1 commit 51c17c6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 51c17c6

Please sign in to comment.