reformat
This commit is contained in:
@@ -11,15 +11,19 @@ import storagecraft.storage.IStorage;
|
||||
import storagecraft.storage.IStorageProvider;
|
||||
import storagecraft.util.InventoryUtils;
|
||||
|
||||
public class TileDrive extends TileMachine implements IInventory, IStorageProvider {
|
||||
public class TileDrive extends TileMachine implements IInventory, IStorageProvider
|
||||
{
|
||||
private InventorySimple inventory = new InventorySimple("drive", 8);
|
||||
|
||||
@Override
|
||||
public int getEnergyUsage() {
|
||||
public int getEnergyUsage()
|
||||
{
|
||||
int base = 5;
|
||||
|
||||
for (int i = 0; i < getSizeInventory(); ++i) {
|
||||
if (getStackInSlot(i) != null) {
|
||||
for (int i = 0; i < getSizeInventory(); ++i)
|
||||
{
|
||||
if (getStackInSlot(i) != null)
|
||||
{
|
||||
base += 2;
|
||||
}
|
||||
}
|
||||
@@ -28,87 +32,105 @@ public class TileDrive extends TileMachine implements IInventory, IStorageProvid
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMachine() {
|
||||
public void updateMachine()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return inventory.getSizeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slot) {
|
||||
public ItemStack getStackInSlot(int slot)
|
||||
{
|
||||
return inventory.getStackInSlot(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
public ItemStack decrStackSize(int slot, int amount)
|
||||
{
|
||||
return inventory.decrStackSize(slot, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slot) {
|
||||
public ItemStack getStackInSlotOnClosing(int slot)
|
||||
{
|
||||
return inventory.getStackInSlotOnClosing(slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack stack) {
|
||||
public void setInventorySlotContents(int slot, ItemStack stack)
|
||||
{
|
||||
inventory.setInventorySlotContents(slot, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
public String getInventoryName()
|
||||
{
|
||||
return inventory.getInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
public boolean hasCustomInventoryName()
|
||||
{
|
||||
return inventory.hasCustomInventoryName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
return inventory.getInventoryStackLimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
public boolean isUseableByPlayer(EntityPlayer player)
|
||||
{
|
||||
return inventory.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
public void openInventory()
|
||||
{
|
||||
inventory.openInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
public void closeInventory()
|
||||
{
|
||||
inventory.closeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack)
|
||||
{
|
||||
return inventory.isItemValidForSlot(slot, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
InventoryUtils.restoreInventory(this, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
InventoryUtils.saveInventory(this, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStorages(List<IStorage> storages) {
|
||||
for (int i = 0; i < getSizeInventory(); ++i) {
|
||||
if (getStackInSlot(i) != null) {
|
||||
public void addStorages(List<IStorage> storages)
|
||||
{
|
||||
for (int i = 0; i < getSizeInventory(); ++i)
|
||||
{
|
||||
if (getStackInSlot(i) != null)
|
||||
{
|
||||
storages.add(new CellStorage(getStackInSlot(i)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user