Crafting Machine Link API, and Export bus crafting implementation.

This commit is contained in:
AlgorithmX2
2014-07-04 01:19:35 -05:00
parent eb691e1802
commit 0a470eefc2
9 changed files with 683 additions and 22 deletions
+18 -3
View File
@@ -13,6 +13,7 @@ import appeng.api.networking.IGrid;
import appeng.api.networking.IGridBlock;
import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode;
import appeng.api.networking.crafting.ICraftingGrid;
import appeng.api.networking.energy.IEnergyGrid;
import appeng.api.networking.events.MENetworkPowerIdleChange;
import appeng.api.networking.pathing.IPathingGrid;
@@ -57,12 +58,12 @@ public class AENetworkProxy implements IGridBlock
{
return myRepInstance;
}
public void setVisualRepresentation( ItemStack is )
public void setVisualRepresentation(ItemStack is)
{
myRepInstance = is;
}
public AENetworkProxy(IGridProxyable te, String nbtName, ItemStack visual, boolean inWorld) {
this.gp = te;
this.nbtName = nbtName;
@@ -276,6 +277,20 @@ public class AENetworkProxy implements IGridBlock
return sg;
}
public ICraftingGrid getCrafting() throws GridAccessException
{
IGrid grid = getGrid();
if ( grid == null )
throw new GridAccessException();
ICraftingGrid sg = grid.getCache( ICraftingGrid.class );
if ( sg == null )
throw new GridAccessException();
return sg;
}
@Override
public boolean isWorldAccessable()
{