Fluid Storage Disks
This commit is contained in:
@@ -15,4 +15,5 @@ public final class RefinedStorageItems {
|
|||||||
public static final ItemStorageHousing STORAGE_HOUSING = new ItemStorageHousing();
|
public static final ItemStorageHousing STORAGE_HOUSING = new ItemStorageHousing();
|
||||||
public static final ItemGridFilter GRID_FILTER = new ItemGridFilter();
|
public static final ItemGridFilter GRID_FILTER = new ItemGridFilter();
|
||||||
public static final ItemNetworkCard NETWORK_CARD = new ItemNetworkCard();
|
public static final ItemNetworkCard NETWORK_CARD = new ItemNetworkCard();
|
||||||
|
public static final ItemFluidStorageDisk FLUID_STORAGE_DISK = new ItemFluidStorageDisk();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ import net.minecraft.item.ItemStack;
|
|||||||
import refinedstorage.RefinedStorageBlocks;
|
import refinedstorage.RefinedStorageBlocks;
|
||||||
import refinedstorage.RefinedStorageItems;
|
import refinedstorage.RefinedStorageItems;
|
||||||
import refinedstorage.api.solderer.ISoldererRecipe;
|
import refinedstorage.api.solderer.ISoldererRecipe;
|
||||||
import refinedstorage.block.EnumStorageType;
|
import refinedstorage.block.EnumItemStorageType;
|
||||||
import refinedstorage.item.ItemBlockStorage;
|
import refinedstorage.item.ItemBlockStorage;
|
||||||
import refinedstorage.item.ItemProcessor;
|
import refinedstorage.item.ItemProcessor;
|
||||||
|
|
||||||
public class SoldererRecipeStorage implements ISoldererRecipe {
|
public class SoldererRecipeStorage implements ISoldererRecipe {
|
||||||
private EnumStorageType type;
|
private EnumItemStorageType type;
|
||||||
private ItemStack[] rows;
|
private ItemStack[] rows;
|
||||||
|
|
||||||
public SoldererRecipeStorage(EnumStorageType type, int storagePart) {
|
public SoldererRecipeStorage(EnumItemStorageType type, int storagePart) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.rows = new ItemStack[]{
|
this.rows = new ItemStack[]{
|
||||||
new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC),
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class BlockStorage extends BlockNode {
|
public class BlockStorage extends BlockNode {
|
||||||
public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumStorageType.class);
|
public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumItemStorageType.class);
|
||||||
|
|
||||||
public BlockStorage() {
|
public BlockStorage() {
|
||||||
super("storage");
|
super("storage");
|
||||||
@@ -49,12 +49,12 @@ public class BlockStorage extends BlockNode {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta) {
|
public IBlockState getStateFromMeta(int meta) {
|
||||||
return getDefaultState().withProperty(TYPE, EnumStorageType.getById(meta));
|
return getDefaultState().withProperty(TYPE, EnumItemStorageType.getById(meta));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetaFromState(IBlockState state) {
|
public int getMetaFromState(IBlockState state) {
|
||||||
return ((EnumStorageType) state.getValue(TYPE)).getId();
|
return ((EnumItemStorageType) state.getValue(TYPE)).getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
52
src/main/java/refinedstorage/block/EnumFluidStorageType.java
Executable file
52
src/main/java/refinedstorage/block/EnumFluidStorageType.java
Executable file
@@ -0,0 +1,52 @@
|
|||||||
|
package refinedstorage.block;
|
||||||
|
|
||||||
|
import net.minecraft.util.IStringSerializable;
|
||||||
|
|
||||||
|
public enum EnumFluidStorageType implements IStringSerializable {
|
||||||
|
TYPE_64K(0, 64000, "64k"),
|
||||||
|
TYPE_128K(1, 128000, "128k"),
|
||||||
|
TYPE_256K(2, 256000, "256k"),
|
||||||
|
TYPE_512K(3, 512000, "512k"),
|
||||||
|
TYPE_CREATIVE(4, -1, "creative");
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
private int capacity;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
EnumFluidStorageType(int id, int capacity, String name) {
|
||||||
|
this.id = id;
|
||||||
|
this.capacity = capacity;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCapacity() {
|
||||||
|
return capacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumFluidStorageType getById(int id) {
|
||||||
|
if (id == 5) {
|
||||||
|
return TYPE_CREATIVE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (EnumFluidStorageType type : EnumFluidStorageType.values()) {
|
||||||
|
if (type.getId() == id) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TYPE_CREATIVE;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ package refinedstorage.block;
|
|||||||
|
|
||||||
import net.minecraft.util.IStringSerializable;
|
import net.minecraft.util.IStringSerializable;
|
||||||
|
|
||||||
public enum EnumStorageType implements IStringSerializable {
|
public enum EnumItemStorageType implements IStringSerializable {
|
||||||
TYPE_1K(0, 1000, "1k"),
|
TYPE_1K(0, 1000, "1k"),
|
||||||
TYPE_4K(1, 4000, "4k"),
|
TYPE_4K(1, 4000, "4k"),
|
||||||
TYPE_16K(2, 16000, "16k"),
|
TYPE_16K(2, 16000, "16k"),
|
||||||
@@ -13,7 +13,7 @@ public enum EnumStorageType implements IStringSerializable {
|
|||||||
private int capacity;
|
private int capacity;
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
EnumStorageType(int id, int capacity, String name) {
|
EnumItemStorageType(int id, int capacity, String name) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.capacity = capacity;
|
this.capacity = capacity;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -37,12 +37,12 @@ public enum EnumStorageType implements IStringSerializable {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EnumStorageType getById(int id) {
|
public static EnumItemStorageType getById(int id) {
|
||||||
if (id == 5) {
|
if (id == 5) {
|
||||||
return TYPE_CREATIVE;
|
return TYPE_CREATIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (EnumStorageType type : EnumStorageType.values()) {
|
for (EnumItemStorageType type : EnumItemStorageType.values()) {
|
||||||
if (type.getId() == id) {
|
if (type.getId() == id) {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,7 @@ import net.minecraft.world.World;
|
|||||||
import refinedstorage.RefinedStorageBlocks;
|
import refinedstorage.RefinedStorageBlocks;
|
||||||
import refinedstorage.RefinedStorageItems;
|
import refinedstorage.RefinedStorageItems;
|
||||||
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
|
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
|
||||||
import refinedstorage.block.EnumStorageType;
|
import refinedstorage.block.EnumItemStorageType;
|
||||||
import refinedstorage.tile.TileStorage;
|
import refinedstorage.tile.TileStorage;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -25,12 +25,12 @@ public class ItemBlockStorage extends ItemBlockBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||||
EnumStorageType type = EnumStorageType.getById(stack.getMetadata());
|
EnumItemStorageType type = EnumItemStorageType.getById(stack.getMetadata());
|
||||||
|
|
||||||
if (type != null && isValid(stack)) {
|
if (type != null && isValid(stack)) {
|
||||||
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(TileStorage.NBT_STORAGE);
|
NBTTagCompound tag = stack.getTagCompound().getCompoundTag(TileStorage.NBT_STORAGE);
|
||||||
|
|
||||||
if (type == EnumStorageType.TYPE_CREATIVE) {
|
if (type == EnumItemStorageType.TYPE_CREATIVE) {
|
||||||
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", ItemStorageNBT.getStoredFromNBT(tag)));
|
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", ItemStorageNBT.getStoredFromNBT(tag)));
|
||||||
} else {
|
} else {
|
||||||
tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", ItemStorageNBT.getStoredFromNBT(tag), type.getCapacity()));
|
tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", ItemStorageNBT.getStoredFromNBT(tag), type.getCapacity()));
|
||||||
@@ -40,7 +40,7 @@ public class ItemBlockStorage extends ItemBlockBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) {
|
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) {
|
||||||
EnumStorageType type = EnumStorageType.getById(stack.getMetadata());
|
EnumItemStorageType type = EnumItemStorageType.getById(stack.getMetadata());
|
||||||
|
|
||||||
if (type != null && isValid(stack) && ItemStorageNBT.getStoredFromNBT(stack.getTagCompound().getCompoundTag(TileStorage.NBT_STORAGE)) == 0 && stack.getMetadata() != ItemStorageDisk.TYPE_CREATIVE && !world.isRemote && player.isSneaking()) {
|
if (type != null && isValid(stack) && ItemStorageNBT.getStoredFromNBT(stack.getTagCompound().getCompoundTag(TileStorage.NBT_STORAGE)) == 0 && stack.getMetadata() != ItemStorageDisk.TYPE_CREATIVE && !world.isRemote && player.isSneaking()) {
|
||||||
ItemStack storagePart = new ItemStack(RefinedStorageItems.STORAGE_PART, 1, stack.getMetadata());
|
ItemStack storagePart = new ItemStack(RefinedStorageItems.STORAGE_PART, 1, stack.getMetadata());
|
||||||
|
|||||||
65
src/main/java/refinedstorage/item/ItemFluidStorageDisk.java
Executable file
65
src/main/java/refinedstorage/item/ItemFluidStorageDisk.java
Executable file
@@ -0,0 +1,65 @@
|
|||||||
|
package refinedstorage.item;
|
||||||
|
|
||||||
|
import net.minecraft.client.resources.I18n;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import refinedstorage.apiimpl.storage.fluid.FluidStorageNBT;
|
||||||
|
import refinedstorage.block.EnumFluidStorageType;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ItemFluidStorageDisk extends ItemBase {
|
||||||
|
public static final int TYPE_64K = 0;
|
||||||
|
public static final int TYPE_128K = 1;
|
||||||
|
public static final int TYPE_256K = 2;
|
||||||
|
public static final int TYPE_512K = 3;
|
||||||
|
public static final int TYPE_CREATIVE = 4;
|
||||||
|
|
||||||
|
public ItemFluidStorageDisk() {
|
||||||
|
super("fluid_storage_disk");
|
||||||
|
|
||||||
|
setMaxStackSize(1);
|
||||||
|
setHasSubtypes(true);
|
||||||
|
setMaxDamage(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||||
|
for (int i = 0; i < 5; ++i) {
|
||||||
|
list.add(FluidStorageNBT.createStackWithNBT(new ItemStack(item, 1, i)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
|
||||||
|
super.onUpdate(stack, world, entity, slot, selected);
|
||||||
|
|
||||||
|
if (!stack.hasTagCompound()) {
|
||||||
|
FluidStorageNBT.createStackWithNBT(stack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack disk, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||||
|
if (FluidStorageNBT.isValid(disk)) {
|
||||||
|
int capacity = EnumFluidStorageType.getById(disk.getItemDamage()).getCapacity();
|
||||||
|
|
||||||
|
if (capacity == -1) {
|
||||||
|
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", FluidStorageNBT.getStoredFromNBT(disk.getTagCompound())));
|
||||||
|
} else {
|
||||||
|
tooltip.add(I18n.format("misc.refinedstorage:storage.stored_capacity", FluidStorageNBT.getStoredFromNBT(disk.getTagCompound()), capacity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreated(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
super.onCreated(stack, world, player);
|
||||||
|
|
||||||
|
FluidStorageNBT.createStackWithNBT(stack);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ import net.minecraft.util.EnumHand;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import refinedstorage.RefinedStorageItems;
|
import refinedstorage.RefinedStorageItems;
|
||||||
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
|
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
|
||||||
import refinedstorage.block.EnumStorageType;
|
import refinedstorage.block.EnumItemStorageType;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -94,7 +94,7 @@ public class ItemStorageDisk extends ItemBase {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack disk, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
public void addInformation(ItemStack disk, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||||
if (ItemStorageNBT.isValid(disk)) {
|
if (ItemStorageNBT.isValid(disk)) {
|
||||||
int capacity = EnumStorageType.getById(disk.getItemDamage()).getCapacity();
|
int capacity = EnumItemStorageType.getById(disk.getItemDamage()).getCapacity();
|
||||||
|
|
||||||
if (capacity == -1) {
|
if (capacity == -1) {
|
||||||
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", ItemStorageNBT.getStoredFromNBT(disk.getTagCompound())));
|
tooltip.add(I18n.format("misc.refinedstorage:storage.stored", ItemStorageNBT.getStoredFromNBT(disk.getTagCompound())));
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import refinedstorage.RefinedStorageItems;
|
|||||||
import refinedstorage.block.BlockCable;
|
import refinedstorage.block.BlockCable;
|
||||||
import refinedstorage.block.EnumControllerType;
|
import refinedstorage.block.EnumControllerType;
|
||||||
import refinedstorage.block.EnumGridType;
|
import refinedstorage.block.EnumGridType;
|
||||||
import refinedstorage.block.EnumStorageType;
|
import refinedstorage.block.EnumItemStorageType;
|
||||||
import refinedstorage.item.*;
|
import refinedstorage.item.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -251,10 +251,10 @@ public class ClientProxy extends CommonProxy {
|
|||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.PROCESSING_PATTERN_ENCODER), 0, new ModelResourceLocation("refinedstorage:processing_pattern_encoder", "inventory"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.PROCESSING_PATTERN_ENCODER), 0, new ModelResourceLocation("refinedstorage:processing_pattern_encoder", "inventory"));
|
||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.NETWORK_TRANSMITTER), 0, new ModelResourceLocation("refinedstorage:network_transmitter", "inventory"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.NETWORK_TRANSMITTER), 0, new ModelResourceLocation("refinedstorage:network_transmitter", "inventory"));
|
||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.NETWORK_RECEIVER), 0, new ModelResourceLocation("refinedstorage:network_receiver", "inventory"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.NETWORK_RECEIVER), 0, new ModelResourceLocation("refinedstorage:network_receiver", "inventory"));
|
||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumStorageType.TYPE_1K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=1k"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_1K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=1k"));
|
||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumStorageType.TYPE_4K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=4k"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_4K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=4k"));
|
||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumStorageType.TYPE_16K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=16k"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_16K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=16k"));
|
||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=64k"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_64K.getId(), new ModelResourceLocation("refinedstorage:storage", "type=64k"));
|
||||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:storage", "type=creative"));
|
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.STORAGE), EnumItemStorageType.TYPE_CREATIVE.getId(), new ModelResourceLocation("refinedstorage:storage", "type=creative"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ public class CommonProxy {
|
|||||||
registerItem(RefinedStorageItems.UPGRADE);
|
registerItem(RefinedStorageItems.UPGRADE);
|
||||||
registerItem(RefinedStorageItems.GRID_FILTER);
|
registerItem(RefinedStorageItems.GRID_FILTER);
|
||||||
registerItem(RefinedStorageItems.NETWORK_CARD);
|
registerItem(RefinedStorageItems.NETWORK_CARD);
|
||||||
|
registerItem(RefinedStorageItems.FLUID_STORAGE_DISK);
|
||||||
|
|
||||||
OreDictionary.registerOre("itemSilicon", RefinedStorageItems.SILICON);
|
OreDictionary.registerOre("itemSilicon", RefinedStorageItems.SILICON);
|
||||||
|
|
||||||
@@ -449,10 +450,10 @@ public class CommonProxy {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Storage Blocks
|
// Storage Blocks
|
||||||
RefinedStorageAPI.SOLDERER_REGISTRY.addRecipe(new SoldererRecipeStorage(EnumStorageType.TYPE_1K, ItemStoragePart.TYPE_1K));
|
RefinedStorageAPI.SOLDERER_REGISTRY.addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_1K, ItemStoragePart.TYPE_1K));
|
||||||
RefinedStorageAPI.SOLDERER_REGISTRY.addRecipe(new SoldererRecipeStorage(EnumStorageType.TYPE_4K, ItemStoragePart.TYPE_4K));
|
RefinedStorageAPI.SOLDERER_REGISTRY.addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_4K, ItemStoragePart.TYPE_4K));
|
||||||
RefinedStorageAPI.SOLDERER_REGISTRY.addRecipe(new SoldererRecipeStorage(EnumStorageType.TYPE_16K, ItemStoragePart.TYPE_16K));
|
RefinedStorageAPI.SOLDERER_REGISTRY.addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_16K, ItemStoragePart.TYPE_16K));
|
||||||
RefinedStorageAPI.SOLDERER_REGISTRY.addRecipe(new SoldererRecipeStorage(EnumStorageType.TYPE_64K, ItemStoragePart.TYPE_64K));
|
RefinedStorageAPI.SOLDERER_REGISTRY.addRecipe(new SoldererRecipeStorage(EnumItemStorageType.TYPE_64K, ItemStoragePart.TYPE_64K));
|
||||||
|
|
||||||
// Crafting Monitor
|
// Crafting Monitor
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RefinedStorageBlocks.CRAFTING_MONITOR),
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(RefinedStorageBlocks.CRAFTING_MONITOR),
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import refinedstorage.api.network.INetworkMaster;
|
|||||||
import refinedstorage.api.storage.item.IItemStorage;
|
import refinedstorage.api.storage.item.IItemStorage;
|
||||||
import refinedstorage.api.storage.item.IItemStorageProvider;
|
import refinedstorage.api.storage.item.IItemStorageProvider;
|
||||||
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
|
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
|
||||||
import refinedstorage.block.EnumStorageType;
|
import refinedstorage.block.EnumItemStorageType;
|
||||||
import refinedstorage.inventory.ItemHandlerBasic;
|
import refinedstorage.inventory.ItemHandlerBasic;
|
||||||
import refinedstorage.inventory.ItemValidatorBasic;
|
import refinedstorage.inventory.ItemValidatorBasic;
|
||||||
import refinedstorage.tile.config.IComparable;
|
import refinedstorage.tile.config.IComparable;
|
||||||
@@ -32,7 +32,7 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, ISt
|
|||||||
|
|
||||||
public class ItemStorage extends ItemStorageNBT {
|
public class ItemStorage extends ItemStorageNBT {
|
||||||
public ItemStorage(ItemStack disk) {
|
public ItemStorage(ItemStack disk) {
|
||||||
super(disk.getTagCompound(), EnumStorageType.getById(disk.getItemDamage()).getCapacity(), TileDiskDrive.this);
|
super(disk.getTagCompound(), EnumItemStorageType.getById(disk.getItemDamage()).getCapacity(), TileDiskDrive.this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -250,14 +250,14 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, ISt
|
|||||||
ItemStack disk = disks.getStackInSlot(i);
|
ItemStack disk = disks.getStackInSlot(i);
|
||||||
|
|
||||||
if (disk != null) {
|
if (disk != null) {
|
||||||
int capacity = EnumStorageType.getById(disk.getItemDamage()).getCapacity();
|
int capacity = EnumItemStorageType.getById(disk.getItemDamage()).getCapacity();
|
||||||
|
|
||||||
if (capacity == -1) {
|
if (capacity == -1) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
stored += ItemStorageNBT.getStoredFromNBT(disk.getTagCompound());
|
stored += ItemStorageNBT.getStoredFromNBT(disk.getTagCompound());
|
||||||
storedMax += EnumStorageType.getById(disk.getItemDamage()).getCapacity();
|
storedMax += EnumItemStorageType.getById(disk.getItemDamage()).getCapacity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, ISt
|
|||||||
ItemStack stack = disks.getStackInSlot(i);
|
ItemStack stack = disks.getStackInSlot(i);
|
||||||
|
|
||||||
if (stack != null) {
|
if (stack != null) {
|
||||||
int diskCapacity = EnumStorageType.getById(stack.getItemDamage()).getCapacity();
|
int diskCapacity = EnumItemStorageType.getById(stack.getItemDamage()).getCapacity();
|
||||||
|
|
||||||
if (diskCapacity == -1) {
|
if (diskCapacity == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import refinedstorage.api.storage.item.IItemStorage;
|
|||||||
import refinedstorage.api.storage.item.IItemStorageProvider;
|
import refinedstorage.api.storage.item.IItemStorageProvider;
|
||||||
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
|
import refinedstorage.apiimpl.storage.item.ItemStorageNBT;
|
||||||
import refinedstorage.block.BlockStorage;
|
import refinedstorage.block.BlockStorage;
|
||||||
import refinedstorage.block.EnumStorageType;
|
import refinedstorage.block.EnumItemStorageType;
|
||||||
import refinedstorage.inventory.ItemHandlerBasic;
|
import refinedstorage.inventory.ItemHandlerBasic;
|
||||||
import refinedstorage.tile.config.IComparable;
|
import refinedstorage.tile.config.IComparable;
|
||||||
import refinedstorage.tile.config.IFilterable;
|
import refinedstorage.tile.config.IFilterable;
|
||||||
@@ -65,7 +65,7 @@ public class TileStorage extends TileNode implements IItemStorageProvider, IStor
|
|||||||
|
|
||||||
private ItemStorage storage;
|
private ItemStorage storage;
|
||||||
|
|
||||||
private EnumStorageType type;
|
private EnumItemStorageType type;
|
||||||
|
|
||||||
private int priority = 0;
|
private int priority = 0;
|
||||||
private int compare = 0;
|
private int compare = 0;
|
||||||
@@ -162,12 +162,12 @@ public class TileStorage extends TileNode implements IItemStorageProvider, IStor
|
|||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnumStorageType getType() {
|
public EnumItemStorageType getType() {
|
||||||
if (type == null && worldObj.getBlockState(pos).getBlock() == RefinedStorageBlocks.STORAGE) {
|
if (type == null && worldObj.getBlockState(pos).getBlock() == RefinedStorageBlocks.STORAGE) {
|
||||||
this.type = ((EnumStorageType) worldObj.getBlockState(pos).getValue(BlockStorage.TYPE));
|
this.type = ((EnumItemStorageType) worldObj.getBlockState(pos).getValue(BlockStorage.TYPE));
|
||||||
}
|
}
|
||||||
|
|
||||||
return type == null ? EnumStorageType.TYPE_1K : type;
|
return type == null ? EnumItemStorageType.TYPE_1K : type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -131,6 +131,11 @@ item.refinedstorage:storage_disk.2.name=16k Storage Disk
|
|||||||
item.refinedstorage:storage_disk.3.name=64k Storage Disk
|
item.refinedstorage:storage_disk.3.name=64k Storage Disk
|
||||||
item.refinedstorage:storage_disk.4.name=Creative Storage Disk
|
item.refinedstorage:storage_disk.4.name=Creative Storage Disk
|
||||||
item.refinedstorage:storage_disk.5.name=Debug Storage Disk
|
item.refinedstorage:storage_disk.5.name=Debug Storage Disk
|
||||||
|
item.refinedstorage:fluid_storage_disk.0.name=64k Fluid Storage Disk
|
||||||
|
item.refinedstorage:fluid_storage_disk.1.name=128k Fluid Storage Disk
|
||||||
|
item.refinedstorage:fluid_storage_disk.2.name=256k Fluid Storage Disk
|
||||||
|
item.refinedstorage:fluid_storage_disk.3.name=512k Fluid Storage Disk
|
||||||
|
item.refinedstorage:fluid_storage_disk.4.name=Creative Fluid Storage Disk
|
||||||
item.refinedstorage:wireless_grid.0.name=Wireless Grid
|
item.refinedstorage:wireless_grid.0.name=Wireless Grid
|
||||||
item.refinedstorage:wireless_grid.1.name=Creative Wireless Grid
|
item.refinedstorage:wireless_grid.1.name=Creative Wireless Grid
|
||||||
item.refinedstorage:quartz_enriched_iron.name=Quartz Enriched Iron
|
item.refinedstorage:quartz_enriched_iron.name=Quartz Enriched Iron
|
||||||
|
|||||||
Reference in New Issue
Block a user