ME Tunnel + Network Tool
This commit is contained in:
@@ -26,8 +26,6 @@ public class Grid implements IGrid
|
||||
HashMap<Class<? extends IGridHost>, Set> Machines = new HashMap<Class<? extends IGridHost>, Set>();
|
||||
HashMap<Class<? extends IGridCache>, GridCacheWrapper> caches = new HashMap<Class<? extends IGridCache>, GridCacheWrapper>();
|
||||
|
||||
long LastFiveRemoveTime = 0;
|
||||
long LastFiveAddNode = 0;
|
||||
GridNode pivot;
|
||||
|
||||
public Grid(GridNode center) {
|
||||
|
||||
@@ -5,19 +5,16 @@ import appeng.api.networking.IGridCache;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.IGridStorage;
|
||||
import appeng.me.cache.TickManagerCache;
|
||||
|
||||
public class GridCacheWrapper implements IGridCache
|
||||
{
|
||||
|
||||
final public boolean isTickHandler;
|
||||
final IGridCache myCache;
|
||||
final String name;
|
||||
|
||||
public GridCacheWrapper(final IGridCache gc) {
|
||||
myCache = gc;
|
||||
name = myCache.getClass().getName();
|
||||
isTickHandler = myCache instanceof TickManagerCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package appeng.me.cache.helpers;
|
||||
|
||||
import appeng.api.networking.IGridConnection;
|
||||
import appeng.parts.p2p.PartP2PTunnelME;
|
||||
|
||||
public class TunnelConnection
|
||||
{
|
||||
|
||||
final public PartP2PTunnelME tunnel;
|
||||
final public IGridConnection c;
|
||||
|
||||
public TunnelConnection(PartP2PTunnelME t, IGridConnection con) {
|
||||
tunnel = t;
|
||||
c = con;
|
||||
}
|
||||
}
|
||||
@@ -135,8 +135,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
return;
|
||||
}
|
||||
|
||||
ConnectionWrapper ql = sideA.connection = sideB.connection = new ConnectionWrapper( AEApi.instance().createGridConnection( sideA.getNode(),
|
||||
sideB.getNode() ) );
|
||||
sideA.connection = sideB.connection = new ConnectionWrapper( AEApi.instance().createGridConnection( sideA.getNode(), sideB.getNode() ) );
|
||||
}
|
||||
else
|
||||
shutdown = true;
|
||||
|
||||
@@ -2,6 +2,7 @@ package appeng.me.helpers;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
@@ -32,6 +33,8 @@ public class AENetworkProxy implements IGridBlock
|
||||
final private IGridProxyable gp;
|
||||
final private boolean worldNode;
|
||||
|
||||
final private ItemStack myRepInstance;
|
||||
|
||||
private boolean isReady = false;
|
||||
private IGridNode node = null;
|
||||
|
||||
@@ -44,10 +47,17 @@ public class AENetworkProxy implements IGridBlock
|
||||
final private String nbtName; // name
|
||||
NBTTagCompound data = null; // input
|
||||
|
||||
public AENetworkProxy(IGridProxyable te, String nbtName, boolean inWorld) {
|
||||
@Override
|
||||
public ItemStack getMachineRepresentation()
|
||||
{
|
||||
return myRepInstance;
|
||||
}
|
||||
|
||||
public AENetworkProxy(IGridProxyable te, String nbtName, ItemStack visual, boolean inWorld) {
|
||||
this.gp = te;
|
||||
this.nbtName = nbtName;
|
||||
worldNode = inWorld;
|
||||
myRepInstance = visual;
|
||||
validSides = EnumSet.allOf( ForgeDirection.class );
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class AENetworkProxyMultiblock extends AENetworkProxy implements IGridMul
|
||||
}
|
||||
|
||||
public AENetworkProxyMultiblock(IGridProxyable te, String nbtName, boolean inWorld) {
|
||||
super( te, nbtName, inWorld );
|
||||
super( te, nbtName, null, inWorld );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user