get available slots!

This commit is contained in:
AlgorithmX2 2014-01-01 03:05:27 -06:00
parent 5edb6ee7a6
commit 47f4946279

View file

@ -3,6 +3,7 @@ package appeng.parts.automation;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import appeng.api.config.Upgrades;
import appeng.api.networking.IGridNode; import appeng.api.networking.IGridNode;
import appeng.api.networking.ticking.IGridTickable; import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickingRequest; import appeng.api.networking.ticking.TickingRequest;
@ -18,6 +19,11 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
super( c, is ); super( c, is );
} }
protected int availableSlots()
{
return Math.min( 1 + getInstalledUpgrades( Upgrades.CAPACITY ) * 4, config.getSizeInventory() );
}
public void writeToNBT(net.minecraft.nbt.NBTTagCompound extra) public void writeToNBT(net.minecraft.nbt.NBTTagCompound extra)
{ {
super.writeToNBT( extra ); super.writeToNBT( extra );