Fix? again

This commit is contained in:
BitHeaven 2024-03-12 11:37:03 +05:00
parent 3a3b3b11fa
commit f4625f84b3
1 changed files with 4 additions and 3 deletions

View File

@ -19,9 +19,10 @@ public abstract class EntityOxygenSystemMixin {
@Redirect(at = @At(value = "INVOKE", target = "Learth/terrarium/adastra/common/items/armor/SpaceSuitItem;hasOxygen(Lnet/minecraft/world/entity/Entity;)Z"),
method = "entityTick(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/entity/LivingEntity;)V")
private boolean redirectOxygenTick(Entity entity) {
if (!(entity instanceof LivingEntity livingEntity)) return SpaceSuitItem.hasOxygen(entity);
boolean createOxygen = true;
createOxygen &= !DivingHelmetItem.getWornItem(entity).isEmpty();
createOxygen &= !BacktankUtil.getAllWithAir((LivingEntity) entity).isEmpty();
return SpaceSuitItem.hasOxygen(entity) || createOxygen;
createOxygen &= !DivingHelmetItem.getWornItem(livingEntity).isEmpty();
createOxygen &= !BacktankUtil.getAllWithAir(livingEntity).isEmpty();
return SpaceSuitItem.hasOxygen(livingEntity) || createOxygen;
}
}