Item/fluid storage parts

This commit is contained in:
raoulvdberge
2019-09-14 22:40:00 +02:00
parent ca8bf5dcc8
commit b6bf407103
19 changed files with 126 additions and 132 deletions

View File

@@ -1,5 +1,7 @@
package com.raoulvdberge.refinedstorage;
import com.raoulvdberge.refinedstorage.apiimpl.storage.FluidStorageType;
import com.raoulvdberge.refinedstorage.apiimpl.storage.ItemStorageType;
import com.raoulvdberge.refinedstorage.item.*;
import com.raoulvdberge.refinedstorage.item.group.MainItemGroup;
import net.minecraft.block.Block;
@@ -47,6 +49,14 @@ public final class RS {
e.getRegistry().register(new ItemSecurityCard());
e.getRegistry().register(new ItemNetworkCard());
e.getRegistry().register(new ItemCuttingTool());
for (ItemStorageType type : ItemStorageType.values()) {
e.getRegistry().register(new ItemStoragePart(type));
}
for (FluidStorageType type : FluidStorageType.values()) {
e.getRegistry().register(new ItemFluidStoragePart(type));
}
}
/* TODO

View File

@@ -28,7 +28,14 @@ public final class RSItems {
public static final ItemProcessor IMPROVED_PROCESSOR = null;
@ObjectHolder(RS.ID + ":advanced_processor")
public static final ItemProcessor ADVANCED_PROCESSOR = null;
public static final ItemStoragePart STORAGE_PART = new ItemStoragePart();
@ObjectHolder(RS.ID + ":1k_storage_part")
public static final ItemStoragePart ONE_K_STORAGE_PART = null;
@ObjectHolder(RS.ID + ":4k_storage_part")
public static final ItemStoragePart FOUR_K_STORAGE_PART = null;
@ObjectHolder(RS.ID + ":16k_storage_part")
public static final ItemStoragePart SIXTEEN_K_STORAGE_PART = null;
@ObjectHolder(RS.ID + ":64k_storage_part")
public static final ItemStoragePart SIXTY_FOUR_K_STORAGE_PART = null;
public static final ItemPattern PATTERN = new ItemPattern();
public static final ItemUpgrade UPGRADE = new ItemUpgrade();
public static final ItemStorageHousing STORAGE_HOUSING = new ItemStorageHousing();
@@ -36,7 +43,14 @@ public final class RSItems {
@ObjectHolder(RS.ID + ":network_card")
public static final ItemNetworkCard NETWORK_CARD = null;
public static final ItemFluidStorageDisk FLUID_STORAGE_DISK = new ItemFluidStorageDisk();
public static final ItemFluidStoragePart FLUID_STORAGE_PART = new ItemFluidStoragePart();
@ObjectHolder(RS.ID + ":64k_fluid_storage_part")
public static final ItemFluidStoragePart SIXTY_FOUR_K_FLUID_STORAGE_PART = null;
@ObjectHolder(RS.ID + ":256k_fluid_storage_part")
public static final ItemFluidStoragePart TWO_HUNDRED_FIFTY_SIX_K_FLUID_STORAGE_PART = null;
@ObjectHolder(RS.ID + ":1024k_fluid_storage_part")
public static final ItemFluidStoragePart THOUSAND_TWENTY_FOUR_K_FLUID_STORAGE_PART = null;
@ObjectHolder(RS.ID + ":4096k_fluid_storage_part")
public static final ItemFluidStoragePart FOUR_THOUSAND_NINETY_SIX_K_FLUID_STORAGE_PART = null;
@ObjectHolder(RS.ID + ":security_card")
public static final ItemSecurityCard SECURITY_CARD = null;
@ObjectHolder(RS.ID + ":cutting_tool")

View File

@@ -0,0 +1,24 @@
package com.raoulvdberge.refinedstorage.apiimpl.storage;
public enum FluidStorageType {
SIXTY_FOUR_K("64k", 64_000),
TWO_HUNDRED_FIFTY_SIX_K("256k", 256_000),
THOUSAND_TWENTY_FOUR_K("1024k", 1024_000),
FOUR_THOUSAND_NINETY_SIX_K("4096k", 4096_000);
private String name;
private int capacity;
FluidStorageType(String name, int capacity) {
this.name = name;
this.capacity = capacity;
}
public String getName() {
return name;
}
public int getCapacity() {
return capacity;
}
}

View File

@@ -0,0 +1,24 @@
package com.raoulvdberge.refinedstorage.apiimpl.storage;
public enum ItemStorageType {
ONE_K("1k", 1000),
FOUR_K("4k", 4000),
SIXTEEN_K("16k", 16_000),
SIXTY_FOUR_K("64k", 64_000);
private String name;
private int capacity;
ItemStorageType(String name, int capacity) {
this.name = name;
this.capacity = capacity;
}
public String getName() {
return name;
}
public int getCapacity() {
return capacity;
}
}

View File

@@ -1,46 +1,13 @@
package com.raoulvdberge.refinedstorage.item;
import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.item.info.ItemInfo;
import com.raoulvdberge.refinedstorage.apiimpl.storage.FluidStorageType;
import net.minecraft.item.Item;
public class ItemFluidStoragePart extends ItemBase {
public static final int TYPE_64K = 0;
public static final int TYPE_256K = 1;
public static final int TYPE_1024K = 2;
public static final int TYPE_4096K = 3;
public class ItemFluidStoragePart extends Item {
public ItemFluidStoragePart(FluidStorageType type) {
super(new Item.Properties().group(RS.MAIN_GROUP));
public ItemFluidStoragePart() {
super(new ItemInfo(RS.ID, "fluid_storage_part"));
//setHasSubtypes(true);
//setMaxDamage(0);
this.setRegistryName(RS.ID, type.getName() + "_fluid_storage_part");
}
/* TODO
@Override
@SideOnly(Side.CLIENT)
public void registerModels(IModelRegistration modelRegistration) {
modelRegistration.setModelVariants(
this,
new ResourceLocation(RS.ID, "64k_fluid_storage_part"),
new ResourceLocation(RS.ID, "256k_fluid_storage_part"),
new ResourceLocation(RS.ID, "1024k_fluid_storage_part"),
new ResourceLocation(RS.ID, "4096k_fluid_storage_part")
);
modelRegistration.setModel(this, TYPE_64K, new ModelResourceLocation(RS.ID + ":64k_fluid_storage_part", "inventory"));
modelRegistration.setModel(this, TYPE_256K, new ModelResourceLocation(RS.ID + ":256k_fluid_storage_part", "inventory"));
modelRegistration.setModel(this, TYPE_1024K, new ModelResourceLocation(RS.ID + ":1024k_fluid_storage_part", "inventory"));
modelRegistration.setModel(this, TYPE_4096K, new ModelResourceLocation(RS.ID + ":4096k_fluid_storage_part", "inventory"));
}
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
if (!isInCreativeTab(tab)) {
return;
}
for (int i = 0; i <= 3; ++i) {
items.add(new ItemStack(this, 1, i));
}
}*/
}

View File

@@ -1,46 +1,13 @@
package com.raoulvdberge.refinedstorage.item;
import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.item.info.ItemInfo;
import com.raoulvdberge.refinedstorage.apiimpl.storage.ItemStorageType;
import net.minecraft.item.Item;
public class ItemStoragePart 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 ItemStoragePart(ItemStorageType type) {
super(new Item.Properties().group(RS.MAIN_GROUP));
public ItemStoragePart() {
super(new ItemInfo(RS.ID, "storage_part"));
//setHasSubtypes(true);
//setMaxDamage(0);
this.setRegistryName(RS.ID, type.getName() + "_storage_part");
}
/* TODO
@Override
@SideOnly(Side.CLIENT)
public void registerModels(IModelRegistration modelRegistration) {
modelRegistration.setModelVariants(
this,
new ResourceLocation(RS.ID, "1k_storage_part"),
new ResourceLocation(RS.ID, "4k_storage_part"),
new ResourceLocation(RS.ID, "16k_storage_part"),
new ResourceLocation(RS.ID, "64k_storage_part")
);
modelRegistration.setModel(this, TYPE_1K, new ModelResourceLocation(RS.ID + ":1k_storage_part", "inventory"));
modelRegistration.setModel(this, TYPE_4K, new ModelResourceLocation(RS.ID + ":4k_storage_part", "inventory"));
modelRegistration.setModel(this, TYPE_16K, new ModelResourceLocation(RS.ID + ":16k_storage_part", "inventory"));
modelRegistration.setModel(this, TYPE_64K, new ModelResourceLocation(RS.ID + ":64k_storage_part", "inventory"));
}
@Override
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
if (!isInCreativeTab(tab)) {
return;
}
for (int i = 0; i <= 3; ++i) {
items.add(new ItemStack(this, 1, i));
}
}*/
}

View File

@@ -249,14 +249,14 @@
"item.refinedstorage.basic_processor": "Basic Processor",
"item.refinedstorage.improved_processor": "Improved Processor",
"item.refinedstorage.advanced_processor": "Advanced Processor",
"item.refinedstorage:storage_part.0": "1k Storage Part",
"item.refinedstorage:storage_part.1": "4k Storage Part",
"item.refinedstorage:storage_part.2": "16k Storage Part",
"item.refinedstorage:storage_part.3": "64k Storage Part",
"item.refinedstorage:fluid_storage_part.0": "64k Fluid Storage Part",
"item.refinedstorage:fluid_storage_part.1": "256k Fluid Storage Part",
"item.refinedstorage:fluid_storage_part.2": "1024k Fluid Storage Part",
"item.refinedstorage:fluid_storage_part.3": "4096k Fluid Storage Part",
"item.refinedstorage.1k_storage_part": "1k Storage Part",
"item.refinedstorage.4k_storage_part": "4k Storage Part",
"item.refinedstorage.16k_storage_part": "16k Storage Part",
"item.refinedstorage.64k_storage_part": "64k Storage Part",
"item.refinedstorage.64k_fluid_storage_part": "64k Fluid Storage Part",
"item.refinedstorage.256k_fluid_storage_part": "256k Fluid Storage Part",
"item.refinedstorage.1024k_fluid_storage_part": "1024k Fluid Storage Part",
"item.refinedstorage.4096k_fluid_storage_part": "4096k Fluid Storage Part",
"item.refinedstorage:pattern": "Pattern",
"item.refinedstorage:upgrade.0": "Upgrade",
"item.refinedstorage:upgrade.1": "Range Upgrade",

View File

@@ -7,21 +7,19 @@
],
"key": {
"P": {
"item": "#improved_processor"
"item": "refinedstorage:improved_processor"
},
"E": {
"item": "refinedstorage:quartz_enriched_iron"
},
"S": {
"item": "refinedstorage:fluid_storage_part",
"data": 1
"item": "refinedstorage:256k_fluid_storage_part"
},
"R": {
"item": "minecraft:bucket"
}
},
"result": {
"item": "refinedstorage:fluid_storage_part",
"data": 2
"item": "refinedstorage:1024k_fluid_storage_part"
}
}

View File

@@ -7,21 +7,19 @@
],
"key": {
"P": {
"item": "#improved_processor"
"item": "refinedstorage:improved_processor"
},
"E": {
"item": "refinedstorage:quartz_enriched_iron"
},
"S": {
"item": "refinedstorage:storage_part",
"data": 1
"item": "refinedstorage:4k_storage_part"
},
"R": {
"item": "minecraft:redstone"
}
},
"result": {
"item": "refinedstorage:storage_part",
"data": 2
"item": "refinedstorage:16k_storage_part"
}
}

View File

@@ -7,22 +7,19 @@
],
"key": {
"S": {
"type": "forge:ore_dict",
"ore": "itemSilicon"
"tag": "refinedstorage:silicons"
},
"E": {
"item": "refinedstorage:quartz_enriched_iron"
},
"G": {
"type": "forge:ore_dict",
"ore": "blockGlass"
"tag": "forge:glass"
},
"R": {
"item": "minecraft:redstone"
}
},
"result": {
"item": "refinedstorage:storage_part",
"data": 0
"item": "refinedstorage:1k_storage_part"
}
}

View File

@@ -7,21 +7,19 @@
],
"key": {
"P": {
"item": "#basic_processor"
"item": "refinedstorage:basic_processor"
},
"E": {
"item": "refinedstorage:quartz_enriched_iron"
},
"S": {
"item": "refinedstorage:fluid_storage_part",
"data": 0
"item": "refinedstorage:64k_fluid_storage_part"
},
"R": {
"item": "minecraft:bucket"
}
},
"result": {
"item": "refinedstorage:fluid_storage_part",
"data": 1
"item": "refinedstorage:256k_fluid_storage_part"
}
}

View File

@@ -7,21 +7,19 @@
],
"key": {
"P": {
"item": "#advanced_processor"
"item": "refinedstorage:advanced_processor"
},
"E": {
"item": "refinedstorage:quartz_enriched_iron"
},
"S": {
"item": "refinedstorage:fluid_storage_part",
"data": 2
"item": "refinedstorage:1024k_fluid_storage_part"
},
"R": {
"item": "minecraft:bucket"
}
},
"result": {
"item": "refinedstorage:fluid_storage_part",
"data": 3
"item": "refinedstorage:4096k_fluid_storage_part"
}
}

View File

@@ -7,21 +7,19 @@
],
"key": {
"P": {
"item": "#basic_processor"
"item": "refinedstorage:basic_processor"
},
"E": {
"item": "refinedstorage:quartz_enriched_iron"
},
"S": {
"item": "refinedstorage:storage_part",
"data": 0
"item": "refinedstorage:1k_storage_part"
},
"R": {
"item": "minecraft:redstone"
}
},
"result": {
"item": "refinedstorage:storage_part",
"data": 1
"item": "refinedstorage:4k_storage_part"
}
}

View File

@@ -7,22 +7,19 @@
],
"key": {
"S": {
"type": "forge:ore_dict",
"ore": "itemSilicon"
"tag": "refinedstorage:silicons"
},
"E": {
"item": "refinedstorage:quartz_enriched_iron"
},
"G": {
"type": "forge:ore_dict",
"ore": "blockGlass"
"tag": "forge:glass"
},
"R": {
"item": "minecraft:bucket"
}
},
"result": {
"item": "refinedstorage:fluid_storage_part",
"data": 0
"item": "refinedstorage:64k_fluid_storage_part"
}
}

View File

@@ -7,21 +7,19 @@
],
"key": {
"P": {
"item": "#advanced_processor"
"item": "refinedstorage:advanced_processor"
},
"E": {
"item": "refinedstorage:quartz_enriched_iron"
},
"S": {
"item": "refinedstorage:storage_part",
"data": 2
"item": "refinedstorage:16k_storage_part"
},
"R": {
"item": "minecraft:redstone"
}
},
"result": {
"item": "refinedstorage:storage_part",
"data": 3
"item": "refinedstorage:64k_storage_part"
}
}

View File

@@ -8,7 +8,7 @@
"item": "minecraft:diamond"
},
{
"item": "refinedstorage:silicon"
"tag": "refinedstorage:silicons"
},
{
"item": "minecraft:redstone"

View File

@@ -8,7 +8,7 @@
"item": "minecraft:iron_ingot"
},
{
"item": "refinedstorage:silicon"
"tag": "refinedstorage:silicons"
},
{
"item": "minecraft:redstone"

View File

@@ -8,7 +8,7 @@
"item": "minecraft:gold_ingot"
},
{
"item": "refinedstorage:silicon"
"tag": "refinedstorage:silicons"
},
{
"item": "minecraft:redstone"

View File

@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"refinedstorage:silicon"
]
}