ME Tunnel + Network Tool
This commit is contained in:
@@ -7,6 +7,7 @@ import java.io.DataOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,6 +32,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile
|
||||
{
|
||||
|
||||
private final EnumMap<TileEventType, List<AETileEventHandler>> handlers = new EnumMap<TileEventType, List<AETileEventHandler>>( TileEventType.class );
|
||||
private final static HashMap<Class, ItemStack> myItem = new HashMap();
|
||||
|
||||
private ForgeDirection forward = ForgeDirection.UNKNOWN;
|
||||
private ForgeDirection up = ForgeDirection.UNKNOWN;
|
||||
@@ -38,6 +40,21 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile
|
||||
public boolean dropItems = true;
|
||||
public int renderFragment = 0;
|
||||
|
||||
public TileEntity getTile()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
static public void registerTileItem(Class c, ItemStack wat)
|
||||
{
|
||||
myItem.put( c, wat );
|
||||
}
|
||||
|
||||
protected ItemStack getItemFromTile(Object obj)
|
||||
{
|
||||
return myItem.get( obj.getClass() );
|
||||
}
|
||||
|
||||
/**
|
||||
* isRedstonePowerd has already changed.
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import appeng.tile.AEBaseInvTile;
|
||||
public abstract class AENetworkInvTile extends AEBaseInvTile implements IGridHost, IGridProxyable
|
||||
{
|
||||
|
||||
protected AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", true );
|
||||
protected AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", getItemFromTile( this ), true );
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode(ForgeDirection dir)
|
||||
|
||||
@@ -12,7 +12,7 @@ import appeng.tile.powersink.AEBasePoweredTile;
|
||||
public abstract class AENetworkPowerTile extends AEBasePoweredTile implements IGridHost, IGridProxyable
|
||||
{
|
||||
|
||||
protected AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", true );
|
||||
protected AENetworkProxy gridProxy = new AENetworkProxy( this, "proxy", getItemFromTile( this ), true );
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType(ForgeDirection dir)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class AENetworkTile extends AEBaseTile implements IGridHost, IGridProxyab
|
||||
|
||||
protected AENetworkProxy createProxy()
|
||||
{
|
||||
return new AENetworkProxy( this, "proxy", true );
|
||||
return new AENetworkProxy( this, "proxy", getItemFromTile( this ), true );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -291,4 +291,10 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
|
||||
{
|
||||
// never called!
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return cb.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,4 +404,5 @@ public class TileIOPort extends AENetworkInvTile implements IBusCommon, IConfigM
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user