BloodMagic/src/main/java/WayofTime/bloodmagic/routing/NodeHelper.java
Nicholas Ignoffo 08258fd6ef Run formatter
2017-08-15 21:30:56 -07:00

21 lines
640 B
Java

package WayofTime.bloodmagic.routing;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class NodeHelper {
public static boolean isNodeConnectionEnabled(World world, IRoutingNode node, BlockPos testPos) {
if (!node.isConnectionEnabled(testPos)) {
return false;
}
TileEntity tile = world.getTileEntity(testPos);
if (!(tile instanceof IRoutingNode)) {
return false;
}
IRoutingNode testNode = (IRoutingNode) tile;
return testNode.isConnectionEnabled(node.getBlockPos());
}
}