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

View File

@@ -3,7 +3,7 @@ package refinedstorage;
import refinedstorage.item.*; import refinedstorage.item.*;
public final class RefinedStorageItems { 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 ItemWirelessGrid WIRELESS_GRID = new ItemWirelessGrid();
public static final ItemWirelessGridPlate WIRELESS_GRID_PLATE = new ItemWirelessGridPlate(); public static final ItemWirelessGridPlate WIRELESS_GRID_PLATE = new ItemWirelessGridPlate();
public static final ItemQuartzEnrichedIron QUARTZ_ENRICHED_IRON = new ItemQuartzEnrichedIron(); public static final ItemQuartzEnrichedIron QUARTZ_ENRICHED_IRON = new ItemQuartzEnrichedIron();

View File

@@ -11,11 +11,11 @@ public class ContainerDrive extends ContainerStorage {
super(player, drive.getInventory()); super(player, drive.getInventory());
for (int i = 0; i < 4; ++i) { 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) { 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.item.ItemStack;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World; import net.minecraft.world.World;
import refinedstorage.storage.CellStorage; import refinedstorage.storage.DiskStorage;
import refinedstorage.storage.NBTStorage; import refinedstorage.storage.NBTStorage;
import java.util.List; import java.util.List;
// @TODO: Rename to storage disk public class ItemStorageDisk extends ItemBase {
public class ItemStorageCell extends ItemBase {
public static final int TYPE_1K = 0; public static final int TYPE_1K = 0;
public static final int TYPE_4K = 1; public static final int TYPE_4K = 1;
public static final int TYPE_16K = 2; public static final int TYPE_16K = 2;
public static final int TYPE_64K = 3; public static final int TYPE_64K = 3;
public static final int TYPE_CREATIVE = 4; public static final int TYPE_CREATIVE = 4;
public ItemStorageCell() { public ItemStorageDisk() {
super("storage_cell"); super("storage_disk");
setMaxStackSize(1); setMaxStackSize(1);
setHasSubtypes(true); setHasSubtypes(true);
@@ -35,11 +34,11 @@ public class ItemStorageCell extends ItemBase {
} }
@Override @Override
public void addInformation(ItemStack cell, EntityPlayer player, List list, boolean b) { public void addInformation(ItemStack disk, EntityPlayer player, List list, boolean b) {
if (CellStorage.getCapacity(cell) == -1) { if (DiskStorage.getCapacity(disk) == -1) {
list.add(String.format(I18n.translateToLocal("misc.refinedstorage:storage.stored"), NBTStorage.getStored(cell.getTagCompound()))); list.add(String.format(I18n.translateToLocal("misc.refinedstorage:storage.stored"), NBTStorage.getStored(disk.getTagCompound())));
} else { } 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 net.minecraft.item.Item;
import refinedstorage.RefinedStorageBlocks; import refinedstorage.RefinedStorageBlocks;
import refinedstorage.RefinedStorageItems; import refinedstorage.RefinedStorageItems;
import refinedstorage.storage.CellStorage; import refinedstorage.storage.DiskStorage;
import refinedstorage.tile.TileStorage; import refinedstorage.tile.TileStorage;
@JEIPlugin @JEIPlugin
@@ -20,7 +20,7 @@ public class PluginRefinedStorage extends BlankModPlugin {
registry.addRecipes(SoldererRecipeMaker.getRecipes()); 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); 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); super.preInit(e);
// Item Variants // Item Variants
ModelBakery.registerItemVariants(RefinedStorageItems.STORAGE_CELL, ModelBakery.registerItemVariants(RefinedStorageItems.STORAGE_DISK,
new ResourceLocation("refinedstorage:1k_storage_cell"), new ResourceLocation("refinedstorage:1k_storage_disk"),
new ResourceLocation("refinedstorage:4k_storage_cell"), new ResourceLocation("refinedstorage:4k_storage_disk"),
new ResourceLocation("refinedstorage:16k_storage_cell"), new ResourceLocation("refinedstorage:16k_storage_disk"),
new ResourceLocation("refinedstorage:64k_storage_cell"), new ResourceLocation("refinedstorage:64k_storage_disk"),
new ResourceLocation("refinedstorage:creative_storage_cell") new ResourceLocation("refinedstorage:creative_storage_disk")
); );
ModelBakery.registerItemVariants(RefinedStorageItems.STORAGE_PART, ModelBakery.registerItemVariants(RefinedStorageItems.STORAGE_PART,
@@ -58,11 +58,11 @@ public class ClientProxy extends CommonProxy {
); );
// Items // Items
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_CELL, ItemStorageCell.TYPE_1K, new ModelResourceLocation("refinedstorage:1k_storage_cell", "inventory")); ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_1K, new ModelResourceLocation("refinedstorage:1k_storage_disk", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_CELL, ItemStorageCell.TYPE_4K, new ModelResourceLocation("refinedstorage:4k_storage_cell", "inventory")); ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_4K, new ModelResourceLocation("refinedstorage:4k_storage_disk", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_CELL, ItemStorageCell.TYPE_16K, new ModelResourceLocation("refinedstorage:16k_storage_cell", "inventory")); ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_16K, new ModelResourceLocation("refinedstorage:16k_storage_disk", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_CELL, ItemStorageCell.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_storage_cell", "inventory")); ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_DISK, ItemStorageDisk.TYPE_64K, new ModelResourceLocation("refinedstorage:64k_storage_disk", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_CELL, ItemStorageCell.TYPE_CREATIVE, new ModelResourceLocation("refinedstorage:creative_storage_cell", "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_1K, new ModelResourceLocation("refinedstorage:1k_storage_part", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.STORAGE_PART, ItemStoragePart.TYPE_4K, new ModelResourceLocation("refinedstorage:4k_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.RELAY, "relay");
GameRegistry.registerBlock(RefinedStorageBlocks.INTERFACE, "interface"); 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, "wireless_grid");
GameRegistry.registerItem(RefinedStorageItems.WIRELESS_GRID_PLATE, "wireless_grid_plate"); GameRegistry.registerItem(RefinedStorageItems.WIRELESS_GRID_PLATE, "wireless_grid_plate");
GameRegistry.registerItem(RefinedStorageItems.QUARTZ_ENRICHED_IRON, "quartz_enriched_iron"); 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) '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), GameRegistry.addRecipe(new ItemStack(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_1K),
"EPE", "EPE",
"SRS", "SRS",
@@ -308,8 +308,8 @@ public class CommonProxy {
'S', new ItemStack(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_16K) 'S', new ItemStack(RefinedStorageItems.STORAGE_PART, 1, ItemStoragePart.TYPE_16K)
); );
// Storage Cells // Storage Disks
GameRegistry.addRecipe(NBTStorage.initNBT(new ItemStack(RefinedStorageItems.STORAGE_CELL, 1, ItemStorageCell.TYPE_1K)), GameRegistry.addRecipe(NBTStorage.initNBT(new ItemStack(RefinedStorageItems.STORAGE_DISK, 1, ItemStorageDisk.TYPE_1K)),
"GRG", "GRG",
"RPR", "RPR",
"EEE", "EEE",
@@ -319,7 +319,7 @@ public class CommonProxy {
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON) '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", "GRG",
"RPR", "RPR",
"EEE", "EEE",
@@ -329,7 +329,7 @@ public class CommonProxy {
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON) '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", "GRG",
"RPR", "RPR",
"EEE", "EEE",
@@ -339,7 +339,7 @@ public class CommonProxy {
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON) '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", "GRG",
"RPR", "RPR",
"EEE", "EEE",

View File

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

View File

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

View File

@@ -91,11 +91,11 @@ block.refinedstorage:storage.4.name=Creative Storage Block
block.refinedstorage:relay.name=Relay block.refinedstorage:relay.name=Relay
block.refinedstorage:interface.name=Interface block.refinedstorage:interface.name=Interface
item.refinedstorage:storage_cell.0.name=1k Storage Cell item.refinedstorage:storage_disk.0.name=1k Storage Disk
item.refinedstorage:storage_cell.1.name=4k Storage Cell item.refinedstorage:storage_disk.1.name=4k Storage Disk
item.refinedstorage:storage_cell.2.name=16k Storage Cell item.refinedstorage:storage_disk.2.name=16k Storage Disk
item.refinedstorage:storage_cell.3.name=64k Storage Cell item.refinedstorage:storage_disk.3.name=64k Storage Disk
item.refinedstorage:storage_cell.4.name=Creative Storage Cell item.refinedstorage:storage_disk.4.name=Creative Storage Disk
item.refinedstorage:wireless_grid.0.name=Wireless Grid item.refinedstorage:wireless_grid.0.name=Wireless Grid
item.refinedstorage:wireless_grid.1.name=Wireless Crafting Grid item.refinedstorage:wireless_grid.1.name=Wireless Crafting Grid
item.refinedstorage:wireless_grid_plate.name=Wireless Grid Plate item.refinedstorage:wireless_grid_plate.name=Wireless Grid Plate

View File

@@ -91,11 +91,11 @@ block.refinedstorage:storage.4.name=Creative Opslag Blok
block.refinedstorage:relay.name=Relais block.refinedstorage:relay.name=Relais
block.refinedstorage:interface.name=Interface block.refinedstorage:interface.name=Interface
item.refinedstorage:storage_cell.0.name=1k Opslagcel item.refinedstorage:storage_disk.0.name=1k Opslagschijf
item.refinedstorage:storage_cell.1.name=4k Opslagcel item.refinedstorage:storage_disk.1.name=4k Opslagschijf
item.refinedstorage:storage_cell.2.name=16k Opslagcel item.refinedstorage:storage_disk.2.name=16k Opslagschijf
item.refinedstorage:storage_cell.3.name=64k Opslagcel item.refinedstorage:storage_disk.3.name=64k Opslagschijf
item.refinedstorage:storage_cell.4.name=Creative Opslagcel item.refinedstorage:storage_disk.4.name=Creative Opslagschijf
item.refinedstorage:wireless_grid.0.name=Draadloze Rooster item.refinedstorage:wireless_grid.0.name=Draadloze Rooster
item.refinedstorage:wireless_grid.1.name=Draadloze Crafting Rooster item.refinedstorage:wireless_grid.1.name=Draadloze Crafting Rooster
item.refinedstorage:wireless_grid_plate.name=Draadloze Rooster Bord item.refinedstorage:wireless_grid_plate.name=Draadloze Rooster Bord

View File

@@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "refinedstorage:items/16k_storage_cell"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "refinedstorage:items/16k_storage_disk"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "refinedstorage:items/1k_storage_cell"
}
}

View File

@@ -1,6 +1,6 @@
{ {
"parent": "item/generated", "parent": "item/generated",
"textures": { "textures": {
"layer0": "refinedstorage:items/4k_storage_cell" "layer0": "refinedstorage:items/1k_storage_disk"
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"parent": "item/generated", "parent": "item/generated",
"textures": { "textures": {
"layer0": "refinedstorage:items/blank_pattern" "layer0": "refinedstorage:items/4k_storage_disk"
} }
} }

View File

@@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "refinedstorage:items/64k_storage_cell"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "refinedstorage:items/64k_storage_disk"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "item/generated",
"textures": {
"layer0": "refinedstorage:items/creative_storage_cell"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "refinedstorage:items/creative_storage_disk"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B