This commit is contained in:
Aidan Brady 2013-12-06 07:26:48 -05:00
parent 449822fef2
commit ecfe9a43b9
4 changed files with 12 additions and 12 deletions

View file

@ -85,6 +85,11 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
for(TileEntity acceptor : getAcceptors())
{
if(acceptorDirections.get(acceptor) == null)
{
continue;
}
ForgeDirection side = acceptorDirections.get(acceptor).getOpposite();
if(!ignored.contains(acceptor))

View file

@ -156,6 +156,11 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
int height = Math.round(entityliving.rotationPitch);
int change = 3;
if(tileEntity == null)
{
return;
}
if(tileEntity.canSetFacing(0) && tileEntity.canSetFacing(1))
{
if(height >= 65)
@ -782,7 +787,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
{
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getBlockTileEntity(x, y, z);
ItemStack itemStack = new ItemStack(blockID, 1, world.getBlockMetadata(x, y, z));
if(((IUpgradeManagement)itemStack.getItem()).supportsUpgrades(itemStack))
{
IUpgradeManagement upgrade = (IUpgradeManagement)itemStack.getItem();

View file

@ -1022,14 +1022,6 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
GasStack stored = GasStack.readFromNBT(itemstack.stackTagCompound.getCompoundTag("stored"));
if(stored == null)
{
itemstack.setItemDamage(100);
}
else {
itemstack.setItemDamage((int)Math.max(1, (Math.abs((((float)stored.amount/getMaxGas(itemstack))*100)-100))));
}
return stored;
}
@ -1055,14 +1047,12 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
if(stack == null || stack.amount == 0)
{
itemstack.setItemDamage(100);
itemstack.stackTagCompound.removeTag("stored");
}
else {
int amount = Math.max(0, Math.min(stack.amount, getMaxGas(itemstack)));
GasStack gasStack = new GasStack(stack.getGas(), amount);
itemstack.setItemDamage((int)Math.max(1, (Math.abs((((float)amount/getMaxGas(itemstack))*100)-100))));
itemstack.stackTagCompound.setCompoundTag("stored", gasStack.write(new NBTTagCompound()));
}
}

View file

@ -168,7 +168,7 @@ public class TileEntityUniversalCable extends TileEntityTransmitter<EnergyNetwor
@Override
public PowerReceiver getPowerReceiver(ForgeDirection side)
{
if(getTransmitterNetwork().getEnergyNeeded(new ArrayList()) == 0)
if(getTransmitterNetwork().getEnergyNeeded(getBuildCraftIgnored()) == 0)
{
return null;
}