Fix? again
This commit is contained in:
parent
3a3b3b11fa
commit
f4625f84b3
|
@ -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"),
|
@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")
|
method = "entityTick(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/entity/LivingEntity;)V")
|
||||||
private boolean redirectOxygenTick(Entity entity) {
|
private boolean redirectOxygenTick(Entity entity) {
|
||||||
|
if (!(entity instanceof LivingEntity livingEntity)) return SpaceSuitItem.hasOxygen(entity);
|
||||||
boolean createOxygen = true;
|
boolean createOxygen = true;
|
||||||
createOxygen &= !DivingHelmetItem.getWornItem(entity).isEmpty();
|
createOxygen &= !DivingHelmetItem.getWornItem(livingEntity).isEmpty();
|
||||||
createOxygen &= !BacktankUtil.getAllWithAir((LivingEntity) entity).isEmpty();
|
createOxygen &= !BacktankUtil.getAllWithAir(livingEntity).isEmpty();
|
||||||
return SpaceSuitItem.hasOxygen(entity) || createOxygen;
|
return SpaceSuitItem.hasOxygen(livingEntity) || createOxygen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue