use of com.simibubi.create.foundation.utility.BlockFace in project Create by Creators-of-Create.
the class CapManipulationBehaviourBase method findNewCapability.
public void findNewCapability() {
Level world = getWorld();
BlockFace targetBlockFace = target.getTarget(world, tileEntity.getBlockPos(), tileEntity.getBlockState()).getOpposite();
BlockPos pos = targetBlockFace.getPos();
targetCapability = LazyOptional.empty();
if (!world.isLoaded(pos))
return;
BlockEntity invTE = world.getBlockEntity(pos);
if (invTE == null)
return;
Capability<T> capability = capability();
targetCapability = bypassSided ? invTE.getCapability(capability) : invTE.getCapability(capability, targetBlockFace.getFace());
if (targetCapability.isPresent())
targetCapability.addListener(this::onHandlerInvalidated);
}
Aggregations