Fixed Bug: #0614 - Network details

This commit is contained in:
AlgorithmX2 2014-07-13 14:42:52 -05:00
parent 061c995136
commit 0107926bdd
2 changed files with 41 additions and 0 deletions

View file

@ -1,8 +1,30 @@
package appeng.tile.crafting;
import net.minecraft.item.ItemStack;
import appeng.api.AEApi;
public class TileCraftingStorageTile extends TileCraftingTile
{
static final ItemStack stackStorage4k = AEApi.instance().blocks().blockCraftingStorage4k.stack( 1 );
static final ItemStack stackStorage16k = AEApi.instance().blocks().blockCraftingStorage16k.stack( 1 );
static final ItemStack stackStorage64k = AEApi.instance().blocks().blockCraftingStorage64k.stack( 1 );
@Override
protected ItemStack getItemFromTile(Object obj)
{
int storage = ((TileCraftingTile) obj).getStorageBytes() / 1024;
if ( storage == 4 )
return stackStorage4k;
if ( storage == 16 )
return stackStorage16k;
if ( storage == 64 )
return stackStorage64k;
return super.getItemFromTile( obj );
}
public boolean isAccelerator()
{
return false;
@ -15,6 +37,9 @@ public class TileCraftingStorageTile extends TileCraftingTile
public int getStorageBytes()
{
if ( worldObj == null )
return 0;
switch (worldObj.getBlockMetadata( xCoord, yCoord, zCoord ) & 3)
{
default:

View file

@ -6,9 +6,11 @@ import java.util.EnumSet;
import java.util.Iterator;
import java.util.LinkedList;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.implementations.IPowerChannelState;
import appeng.api.networking.GridFlags;
@ -37,17 +39,28 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
CraftingCPUCluster clust;
final CraftingCPUCalculator calc = new CraftingCPUCalculator( this );
public ISimplifiedBundle lightCache;
public NBTTagCompound previousState = null;
public boolean isCoreBlock = false;
static final ItemStack coProcessorStack = AEApi.instance().blocks().blockCraftingAccelerator.stack( 1 );
@Override
protected AENetworkProxy createProxy()
{
return new AENetworkProxyMultiblock( this, "proxy", getItemFromTile( this ), true );
}
@Override
protected ItemStack getItemFromTile(Object obj)
{
if ( ((TileCraftingTile) obj).isAccelerator() )
return coProcessorStack;
return super.getItemFromTile( obj );
}
public void updateStatus(CraftingCPUCluster c)
{
clust = c;
@ -99,6 +112,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
public void onReady()
{
super.onReady();
gridProxy.setVisualRepresentation( getItemFromTile( this ) );
updateMultiBlock();
}
@ -184,6 +198,8 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
public boolean isAccelerator()
{
if ( worldObj == null )
return false;
return (worldObj.getBlockMetadata( xCoord, yCoord, zCoord ) & 3) == 1;
}