massive refactor of storage

This commit is contained in:
Raoul Van den Berge
2015-12-13 21:14:54 +01:00
parent 455ec9dd47
commit 3e021cdf46
12 changed files with 268 additions and 258 deletions

View File

@@ -1,13 +1,17 @@
package storagecraft.tile;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import storagecraft.SC;
import storagecraft.inventory.InventorySC;
import storagecraft.storage.CellStorage;
import storagecraft.storage.IStorage;
import storagecraft.storage.IStorageProvider;
public class TileDrive extends TileMachine implements IInventory {
public class TileDrive extends TileMachine implements IInventory, IStorageProvider {
private InventorySC inventory = new InventorySC("drive", 8);
@Override
@@ -88,4 +92,13 @@ public class TileDrive extends TileMachine implements IInventory {
SC.saveInventory(this, nbt);
}
@Override
public void addStorages(List<IStorage> providers) {
for (int i = 0; i < getSizeInventory(); ++i) {
if (getStackInSlot(i) != null) {
providers.add(new CellStorage(getStackInSlot(i)));
}
}
}
}