Added routing nodes and a bit of infrastructure - not even working yet.
This commit is contained in:
parent
9950b32d53
commit
8b0756e9da
7 changed files with 357 additions and 7 deletions
25
src/main/java/WayofTime/bloodmagic/routing/NodeHelper.java
Normal file
25
src/main/java/WayofTime/bloodmagic/routing/NodeHelper.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package WayofTime.bloodmagic.routing;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.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());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue