From 58a5175ed99656f0f25be854ed24be1d635e1459 Mon Sep 17 00:00:00 2001 From: bitheaven Date: Thu, 9 Nov 2023 22:25:08 +0500 Subject: [PATCH] Rewrite Air function --- .../java/ru/bitheaven/createairfabric/CreateAirFabric.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/ru/bitheaven/createairfabric/CreateAirFabric.java b/src/main/java/ru/bitheaven/createairfabric/CreateAirFabric.java index 4d8140d..999e136 100644 --- a/src/main/java/ru/bitheaven/createairfabric/CreateAirFabric.java +++ b/src/main/java/ru/bitheaven/createairfabric/CreateAirFabric.java @@ -1,8 +1,7 @@ package ru.bitheaven.createairfabric; import com.simibubi.create.Create; -import fuzs.thinair.helper.AirHelper; -import fuzs.thinair.helper.AirQualityLevel; +import fuzs.thinair.helper.AirQualityHelperImpl; import io.github.fabricators_of_create.porting_lib.util.EnvExecutor; import net.fabricmc.api.ModInitializer; import net.minecraft.resources.ResourceLocation; @@ -25,8 +24,8 @@ public class CreateAirFabric implements ModInitializer { } public static boolean airQualityActivatesHelmet(LivingEntity entity) { - final AirQualityLevel air = AirHelper.getO2LevelFromLocation(entity.getEyePosition(), entity.level()).getFirst(); - return air == AirQualityLevel.RED || air == AirQualityLevel.YELLOW; + AirQualityHelperImpl air = new AirQualityHelperImpl(); + return !air.getAirQualityAtLocation(entity.level(), entity.getEyePosition()).canBreathe; } public static ResourceLocation id(String path) {