Rename storage cells to storage disks

This commit is contained in:
Raoul Van den Berge
2016-03-24 20:29:17 +01:00
parent 36cca7a9c8
commit 44559fe063
26 changed files with 78 additions and 85 deletions

View File

@@ -12,7 +12,7 @@ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import refinedstorage.item.ItemStorageCell;
import refinedstorage.item.ItemStorageDisk;
import refinedstorage.proxy.CommonProxy;
@Mod(modid = RefinedStorage.ID, version = RefinedStorage.VERSION)
@@ -25,7 +25,7 @@ public final class RefinedStorage {
public static final CreativeTabs TAB = new CreativeTabs(ID) {
@Override
public ItemStack getIconItemStack() {
return new ItemStack(RefinedStorageItems.STORAGE_CELL, 1, ItemStorageCell.TYPE_1K);
return new ItemStack(RefinedStorageItems.STORAGE_DISK, 1, ItemStorageDisk.TYPE_1K);
}
@Override

View File

@@ -3,7 +3,7 @@ package refinedstorage;
import refinedstorage.item.*;
public final class RefinedStorageItems {
public static final ItemStorageCell STORAGE_CELL = new ItemStorageCell();
public static final ItemStorageDisk STORAGE_DISK = new ItemStorageDisk();
public static final ItemWirelessGrid WIRELESS_GRID = new ItemWirelessGrid();
public static final ItemWirelessGridPlate WIRELESS_GRID_PLATE = new ItemWirelessGridPlate();
public static final ItemQuartzEnrichedIron QUARTZ_ENRICHED_IRON = new ItemQuartzEnrichedIron();

View File

@@ -11,11 +11,11 @@ public class ContainerDrive extends ContainerStorage {
super(player, drive.getInventory());
for (int i = 0; i < 4; ++i) {
addSlotToContainer(new SlotFiltered(drive, i, 98 + (i * 18), 78, new BasicItemValidator(RefinedStorageItems.STORAGE_CELL)));
addSlotToContainer(new SlotFiltered(drive, i, 98 + (i * 18), 78, new BasicItemValidator(RefinedStorageItems.STORAGE_DISK)));
}
for (int i = 0; i < 4; ++i) {
addSlotToContainer(new SlotFiltered(drive, 4 + i, 98 + (i * 18), 96, new BasicItemValidator(RefinedStorageItems.STORAGE_CELL)));
addSlotToContainer(new SlotFiltered(drive, 4 + i, 98 + (i * 18), 96, new BasicItemValidator(RefinedStorageItems.STORAGE_DISK)));
}
}
}

View File

@@ -6,21 +6,20 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import refinedstorage.storage.CellStorage;
import refinedstorage.storage.DiskStorage;
import refinedstorage.storage.NBTStorage;
import java.util.List;
// @TODO: Rename to storage disk
public class ItemStorageCell extends ItemBase {
public class ItemStorageDisk extends ItemBase {
public static final int TYPE_1K = 0;
public static final int TYPE_4K = 1;
public static final int TYPE_16K = 2;
public static final int TYPE_64K = 3;
public static final int TYPE_CREATIVE = 4;
public ItemStorageCell() {
super("storage_cell");
public ItemStorageDisk() {
super("storage_disk");
setMaxStackSize(1);
setHasSubtypes(true);
@@ -35,11 +34,11 @@ public class ItemStorageCell extends ItemBase {
}
@Override
public void addInformation(ItemStack cell, EntityPlayer player, List list, boolean b) {
if (CellStorage.getCapacity(cell) == -1) {
list.add(String.format(I18n.translateToLocal("misc.refinedstorage:storage.stored"), NBTStorage.getStored(cell.getTagCompound())));
public void addInformation(ItemStack disk, EntityPlayer player, List list, boolean b) {
if (DiskStorage.getCapacity(disk) == -1) {
list.add(String.format(I18n.translateToLocal("misc.refinedstorage:storage.stored"), NBTStorage.getStored(disk.getTagCompound())));
} else {
list.add(String.format(I18n.translateToLocal("misc.refinedstorage:storage.stored_capacity"), NBTStorage.getStored(cell.getTagCompound()), CellStorage.getCapacity(cell)));
list.add(String.format(I18n.translateToLocal("misc.refinedstorage:storage.stored_capacity"), NBTStorage.getStored(disk.getTagCompound()), DiskStorage.getCapacity(disk)));
}
}

View File

@@ -6,7 +6,7 @@ import mezz.jei.api.JEIPlugin;
import net.minecraft.item.Item;
import refinedstorage.RefinedStorageBlocks;
import refinedstorage.RefinedStorageItems;
import refinedstorage.storage.CellStorage;
import refinedstorage.storage.DiskStorage;
import refinedstorage.tile.TileStorage;
@JEIPlugin
@@ -20,7 +20,7 @@ public class PluginRefinedStorage extends BlankModPlugin {
registry.addRecipes(SoldererRecipeMaker.getRecipes());
registry.getJeiHelpers().getNbtIgnoreList().ignoreNbtTagNames(RefinedStorageItems.STORAGE_CELL, CellStorage.NBT_ITEMS, CellStorage.NBT_STORED);
registry.getJeiHelpers().getNbtIgnoreList().ignoreNbtTagNames(RefinedStorageItems.STORAGE_DISK, DiskStorage.NBT_ITEMS, DiskStorage.NBT_STORED);
registry.getJeiHelpers().getNbtIgnoreList().ignoreNbtTagNames(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), TileStorage.NBT_STORAGE);
}
}

View File

@@ -22,12 +22,12 @@ public class ClientProxy extends CommonProxy {
super.preInit(e);
// Item Variants
ModelBakery.registerItemVariants(RefinedStorageItems.STORAGE_CELL,
new ResourceLocation("refinedstorage:1k_storage_cell"),
new ResourceLocation("refinedstorage:4k_storage_cell"),
new ResourceLocation("refinedstorage:16k_storage_cell"),
new ResourceLocation("refinedstorage:64k_storage_cell"),
new ResourceLocation("refinedstorage:creative_storage_cell")
ModelBakery.registerItemVariants(RefinedStorageItems.STORAGE_DISK,
new ResourceLocation("refinedstorage:1k_storage_disk"),
new ResourceLocation("refinedstorage:4k_storage_disk"),
new ResourceLocation("refinedstorage:16k_storage_disk"),
new ResourceLocation("refinedstorage:64k_storage_disk"),
new ResourceLocation("refinedstorage:creative_storage_disk")
);
ModelBakery.registerItemVariants(RefinedStorageItems.STORAGE_PART,
@@ -58,11 +58,11 @@ public class ClientProxy extends CommonProxy {
);
// Items
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_CELL, ItemStorageCell.TYPE_1K, new ModelResourceLocation("refinedstorage:1k_storage_cell", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_CELL, ItemStorageCell.TYPE_4K, new ModelResourceLocation("refinedstorage:4k_storage_cell", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_CELL, ItemStorageCell.TYPE_16K, new ModelResourceLocation("refinedstorage:16k_storage_cell", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_CELL, ItemStorageCell.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_storage_cell", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_CELL, ItemStorageCell.TYPE_CREATIVE, new ModelResourceLocation("refinedstorage:creative_storage_cell", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_1K, new ModelResourceLocation("refinedstorage:1k_storage_disk", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_4K, new ModelResourceLocation("refinedstorage:4k_storage_disk", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_16K, new ModelResourceLocation("refinedstorage:16k_storage_disk", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_storage_disk", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_CREATIVE, new ModelResourceLocation("refinedstorage:creative_storage_disk", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_PART, ItemStoragePart.TYPE_1K, new ModelResourceLocation("refinedstorage:1k_storage_part", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_PART, ItemStoragePart.TYPE_4K, new ModelResourceLocation("refinedstorage:4k_storage_part", "inventory"));

View File

@@ -72,7 +72,7 @@ public class CommonProxy {
GameRegistry.registerBlock(RefinedStorageBlocks.RELAY, "relay");
GameRegistry.registerBlock(RefinedStorageBlocks.INTERFACE, "interface");
GameRegistry.registerItem(RefinedStorageItems.STORAGE_CELL, "storage_cell");
GameRegistry.registerItem(RefinedStorageItems.STORAGE_DISK, "storage_disk");
GameRegistry.registerItem(RefinedStorageItems.WIRELESS_GRID, "wireless_grid");
GameRegistry.registerItem(RefinedStorageItems.WIRELESS_GRID_PLATE, "wireless_grid_plate");
GameRegistry.registerItem(RefinedStorageItems.QUARTZ_ENRICHED_IRON, "quartz_enriched_iron");
@@ -267,7 +267,7 @@ public class CommonProxy {
'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
);
// Storage Cell Parts
// Storage Parts
GameRegistry.addRecipe(new ItemStack(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_1K),
"EPE",
"SRS",
@@ -308,8 +308,8 @@ public class CommonProxy {
'S', new ItemStack(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_16K)
);
// Storage Cells
GameRegistry.addRecipe(NBTStorage.initNBT(new ItemStack(RefinedStorageItems.STORAGE_CELL, 1, ItemStorageCell.TYPE_1K)),
// Storage Disks
GameRegistry.addRecipe(NBTStorage.initNBT(new ItemStack(RefinedStorageItems.STORAGE_DISK, 1, ItemStorageDisk.TYPE_1K)),
"GRG",
"RPR",
"EEE",
@@ -319,7 +319,7 @@ public class CommonProxy {
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON)
);
GameRegistry.addRecipe(NBTStorage.initNBT(new ItemStack(RefinedStorageItems.STORAGE_CELL, 1, ItemStorageCell.TYPE_4K)),
GameRegistry.addRecipe(NBTStorage.initNBT(new ItemStack(RefinedStorageItems.STORAGE_DISK, 1, ItemStorageDisk.TYPE_4K)),
"GRG",
"RPR",
"EEE",
@@ -329,7 +329,7 @@ public class CommonProxy {
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON)
);
GameRegistry.addRecipe(NBTStorage.initNBT(new ItemStack(RefinedStorageItems.STORAGE_CELL, 1, ItemStorageCell.TYPE_16K)),
GameRegistry.addRecipe(NBTStorage.initNBT(new ItemStack(RefinedStorageItems.STORAGE_DISK, 1, ItemStorageDisk.TYPE_16K)),
"GRG",
"RPR",
"EEE",
@@ -339,7 +339,7 @@ public class CommonProxy {
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON)
);
GameRegistry.addRecipe(NBTStorage.initNBT(new ItemStack(RefinedStorageItems.STORAGE_CELL, 1, ItemStorageCell.TYPE_64K)),
GameRegistry.addRecipe(NBTStorage.initNBT(new ItemStack(RefinedStorageItems.STORAGE_DISK, 1, ItemStorageDisk.TYPE_64K)),
"GRG",
"RPR",
"EEE",

View File

@@ -1,15 +1,15 @@
package refinedstorage.storage;
import net.minecraft.item.ItemStack;
import refinedstorage.item.ItemStorageCell;
import refinedstorage.item.ItemStorageDisk;
import refinedstorage.tile.TileDrive;
import refinedstorage.tile.settings.ModeSettingUtils;
public class CellStorage extends NBTStorage {
public class DiskStorage extends NBTStorage {
private TileDrive drive;
public CellStorage(ItemStack cell, TileDrive drive) {
super(cell.getTagCompound(), getCapacity(cell), drive.getPriority());
public DiskStorage(ItemStack disk, TileDrive drive) {
super(disk.getTagCompound(), getCapacity(disk), drive.getPriority());
this.drive = drive;
}
@@ -23,17 +23,17 @@ public class CellStorage extends NBTStorage {
return false;
}
public static int getCapacity(ItemStack cell) {
switch (cell.getItemDamage()) {
case ItemStorageCell.TYPE_1K:
public static int getCapacity(ItemStack disk) {
switch (disk.getItemDamage()) {
case ItemStorageDisk.TYPE_1K:
return 1000;
case ItemStorageCell.TYPE_4K:
case ItemStorageDisk.TYPE_4K:
return 4000;
case ItemStorageCell.TYPE_16K:
case ItemStorageDisk.TYPE_16K:
return 16000;
case ItemStorageCell.TYPE_64K:
case ItemStorageDisk.TYPE_64K:
return 64000;
case ItemStorageCell.TYPE_CREATIVE:
case ItemStorageDisk.TYPE_CREATIVE:
return -1;
}

View File

@@ -50,7 +50,7 @@ public class TileDrive extends TileMachine implements IStorageProvider, IStorage
public void addStorages(List<IStorage> storages) {
for (int i = 0; i < getSizeInventory(); ++i) {
if (getStackInSlot(i) != null) {
storages.add(new CellStorage(getStackInSlot(i), this));
storages.add(new DiskStorage(getStackInSlot(i), this));
}
}
}
@@ -205,13 +205,13 @@ public class TileDrive extends TileMachine implements IStorageProvider, IStorage
ItemStack stack = getStackInSlot(i);
if (stack != null) {
int cellCapacity = CellStorage.getCapacity(stack);
int diskCapacity = DiskStorage.getCapacity(stack);
if (cellCapacity == -1) {
if (diskCapacity == -1) {
return -1;
}
capacity += cellCapacity;
capacity += diskCapacity;
}
}