mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Change ad-astra oxygen check to use the current location instead of the entity
This commit is contained in:
parent
f84ef86546
commit
cda4e5b0b6
2 changed files with 5 additions and 4 deletions
|
@ -2,10 +2,11 @@ package com.minelittlepony.unicopia.compat.ad_astra;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public interface OxygenApi {
|
public interface OxygenApi {
|
||||||
AtomicReference<OxygenApi> API = new AtomicReference<>(entity -> false);
|
AtomicReference<OxygenApi> API = new AtomicReference<>((world, pos) -> false);
|
||||||
|
|
||||||
boolean hasOxygen(Entity entity);
|
boolean hasOxygen(World world, BlockPos pos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,7 +200,7 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
|
||||||
|
|
||||||
if ((RegistryUtils.isIn(entity.getWorld(), dimension, RegistryKeys.DIMENSION_TYPE, UTags.DimensionTypes.HAS_NO_ATMOSPHERE)
|
if ((RegistryUtils.isIn(entity.getWorld(), dimension, RegistryKeys.DIMENSION_TYPE, UTags.DimensionTypes.HAS_NO_ATMOSPHERE)
|
||||||
|| Unicopia.getConfig().dimensionsWithoutAtmosphere.get().contains(RegistryUtils.getId(entity.getWorld(), dimension, RegistryKeys.DIMENSION_TYPE).toString()))
|
|| Unicopia.getConfig().dimensionsWithoutAtmosphere.get().contains(RegistryUtils.getId(entity.getWorld(), dimension, RegistryKeys.DIMENSION_TYPE).toString()))
|
||||||
&& !OxygenApi.API.get().hasOxygen(entity)) {
|
&& !OxygenApi.API.get().hasOxygen(entity.getWorld(), entity.getBlockPos())) {
|
||||||
return FlightType.NONE;
|
return FlightType.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue