Rewrite Air function
This commit is contained in:
parent
7ccdf8d063
commit
58a5175ed9
|
@ -1,8 +1,7 @@
|
||||||
package ru.bitheaven.createairfabric;
|
package ru.bitheaven.createairfabric;
|
||||||
|
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
import fuzs.thinair.helper.AirHelper;
|
import fuzs.thinair.helper.AirQualityHelperImpl;
|
||||||
import fuzs.thinair.helper.AirQualityLevel;
|
|
||||||
import io.github.fabricators_of_create.porting_lib.util.EnvExecutor;
|
import io.github.fabricators_of_create.porting_lib.util.EnvExecutor;
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
@ -25,8 +24,8 @@ public class CreateAirFabric implements ModInitializer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean airQualityActivatesHelmet(LivingEntity entity) {
|
public static boolean airQualityActivatesHelmet(LivingEntity entity) {
|
||||||
final AirQualityLevel air = AirHelper.getO2LevelFromLocation(entity.getEyePosition(), entity.level()).getFirst();
|
AirQualityHelperImpl air = new AirQualityHelperImpl();
|
||||||
return air == AirQualityLevel.RED || air == AirQualityLevel.YELLOW;
|
return !air.getAirQualityAtLocation(entity.level(), entity.getEyePosition()).canBreathe;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResourceLocation id(String path) {
|
public static ResourceLocation id(String path) {
|
||||||
|
|
Loading…
Reference in New Issue