API Update.
This commit is contained in:
parent
1ff35ba8ec
commit
3220a2e07c
8 changed files with 27 additions and 14 deletions
2
api
2
api
|
@ -1 +1 @@
|
|||
Subproject commit 1aa680440944ff48b144201545f62db08ed28261
|
||||
Subproject commit bda364035f2fcae422eff6d2250354207f15a93f
|
3
me/cache/GridStorageCache.java
vendored
3
me/cache/GridStorageCache.java
vendored
|
@ -148,6 +148,9 @@ public class GridStorageCache implements IStorageGrid
|
|||
{
|
||||
myItemNetwork = null;
|
||||
myFluidNetwork = null;
|
||||
|
||||
itemMonitor.forceUpdate();
|
||||
fluidMonitor.forceUpdate();
|
||||
}
|
||||
|
||||
public IMEInventoryHandler<IAEItemStack> getItemInventoryHandler()
|
||||
|
|
|
@ -3,9 +3,10 @@ package appeng.me.storage;
|
|||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import appeng.api.implementations.IStorageMonitorable;
|
||||
import appeng.api.implementations.ITileStorageMonitorable;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.IStorageMonitorable;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
|
@ -17,7 +18,7 @@ public class AEExternalHandler implements IExternalStorageHandler
|
|||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel channel)
|
||||
{
|
||||
if ( channel == StorageChannel.ITEMS && te instanceof IStorageMonitorable )
|
||||
if ( channel == StorageChannel.ITEMS && te instanceof ITileStorageMonitorable )
|
||||
return true;
|
||||
|
||||
if ( channel == StorageChannel.ITEMS && te instanceof IInventory )
|
||||
|
@ -37,20 +38,21 @@ public class AEExternalHandler implements IExternalStorageHandler
|
|||
return new VoidFluidInventory( (TileCondenser) te );
|
||||
}
|
||||
|
||||
if ( te instanceof IStorageMonitorable )
|
||||
if ( te instanceof ITileStorageMonitorable )
|
||||
{
|
||||
IStorageMonitorable iface = (IStorageMonitorable) te;
|
||||
ITileStorageMonitorable iface = (ITileStorageMonitorable) te;
|
||||
IStorageMonitorable sm = iface.getMonitorable( d );
|
||||
|
||||
if ( channel == StorageChannel.ITEMS )
|
||||
if ( channel == StorageChannel.ITEMS && sm != null )
|
||||
{
|
||||
IMEInventory<IAEItemStack> ii = iface.getItemInventory();
|
||||
IMEInventory<IAEItemStack> ii = sm.getItemInventory();
|
||||
if ( ii != null )
|
||||
return ii;
|
||||
}
|
||||
|
||||
if ( channel == StorageChannel.FLUIDS )
|
||||
if ( channel == StorageChannel.FLUIDS && sm != null )
|
||||
{
|
||||
IMEInventory<IAEFluidStack> fi = iface.getFluidInventory();
|
||||
IMEInventory<IAEFluidStack> fi = sm.getFluidInventory();
|
||||
if ( fi != null )
|
||||
return fi;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
|||
|
||||
int newAdaptorHash = Platform.generateTileHash( target );
|
||||
|
||||
if ( adaptorHash == newAdaptorHash )
|
||||
if ( adaptorHash == newAdaptorHash && newAdaptorHash != 0 )
|
||||
return adaptor;
|
||||
|
||||
adaptorHash = newAdaptorHash;
|
||||
|
|
|
@ -85,7 +85,7 @@ public class PartStorageBus extends PartBasicState implements IGridTickable, ICe
|
|||
|
||||
int newHandlerHash = Platform.generateTileHash( target );
|
||||
|
||||
if ( handlerHash == newHandlerHash )
|
||||
if ( handlerHash == newHandlerHash && handlerHash != 0 )
|
||||
return handler;
|
||||
|
||||
handlerHash = newHandlerHash;
|
||||
|
|
|
@ -30,6 +30,7 @@ import appeng.block.AEBaseBlock;
|
|||
import appeng.client.texture.CableBusTextures;
|
||||
import appeng.client.texture.FlipableIcon;
|
||||
import appeng.client.texture.TaughtIcon;
|
||||
import appeng.items.parts.ItemPart;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
import appeng.parts.AEBasePart;
|
||||
|
@ -46,7 +47,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
|||
public PartCable(Class c, ItemStack is) {
|
||||
super( c, is );
|
||||
proxy.setIdlePowerUsage( 1.0 / 16.0 );
|
||||
proxy.myColor = AEColor.fromCable( is );
|
||||
proxy.myColor = AEColor.values()[((ItemPart) is.getItem()).varientOf( is.getItemDamage() )];
|
||||
}
|
||||
|
||||
public Icon getGlassTexture(AEColor c)
|
||||
|
|
|
@ -3,8 +3,8 @@ package appeng.parts.reporting;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Vec3;
|
||||
import appeng.api.implementations.IStorageMonitorable;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.IStorageMonitorable;
|
||||
import appeng.client.texture.CableBusTextures;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.me.GridAccessException;
|
||||
|
|
|
@ -35,6 +35,7 @@ import appeng.api.storage.IMEInventory;
|
|||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.IMEMonitorHandlerReciever;
|
||||
import appeng.api.storage.IStorageMonitorable;
|
||||
import appeng.api.storage.MEMonitorHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
|
@ -51,7 +52,7 @@ import appeng.tile.inventory.InvOperation;
|
|||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHandler
|
||||
public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHandler, IStorageMonitorable
|
||||
{
|
||||
|
||||
static final AENoHandler noHandler = new AENoHandler();
|
||||
|
@ -610,6 +611,12 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
|||
return super.getAECurrentPower() > 1 || gridPowered;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IStorageMonitorable getMonitorable(ForgeDirection side)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack getStorageType()
|
||||
{
|
||||
if ( isPowered() )
|
||||
|
|
Loading…
Reference in a new issue