Recipes for upgrades.-

This commit is contained in:
Raoul Van den Berge
2016-04-12 18:23:42 +02:00
parent 8a7c5c7cd9
commit 64b7ae9509
8 changed files with 80 additions and 9 deletions

View File

@@ -7,8 +7,8 @@ import net.minecraft.item.ItemStack;
import java.util.List;
public class ItemUpgrade extends ItemBase {
public static final int TYPE_RANGE = 0;
public static final int TYPE_SPEED = 1;
public static final int TYPE_RANGE = 1;
public static final int TYPE_SPEED = 2;
public ItemUpgrade() {
super("upgrade");
@@ -20,7 +20,7 @@ public class ItemUpgrade extends ItemBase {
@Override
public void getSubItems(Item item, CreativeTabs tab, List list) {
for (int i = 0; i <= 1; ++i) {
for (int i = 0; i <= 2; ++i) {
list.add(new ItemStack(item, 1, i));
}
}

View File

@@ -51,6 +51,7 @@ public class ClientProxy extends CommonProxy {
);
ModelBakery.registerItemVariants(RefinedStorageItems.UPGRADE,
new ResourceLocation("refinedstorage:upgrade"),
new ResourceLocation("refinedstorage:range_upgrade"),
new ResourceLocation("refinedstorage:speed_upgrade")
);
@@ -86,6 +87,7 @@ public class ClientProxy extends CommonProxy {
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.PATTERN, 0, new ModelResourceLocation("refinedstorage:pattern", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, 0, new ModelResourceLocation("refinedstorage:upgrade", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_RANGE, new ModelResourceLocation("refinedstorage:range_upgrade", "inventory"));
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_SPEED, new ModelResourceLocation("refinedstorage:speed_upgrade", "inventory"));

View File

@@ -230,14 +230,14 @@ public class CommonProxy {
GameRegistry.addShapelessRecipe(new ItemStack(RefinedStorageBlocks.IMPORTER),
new ItemStack(RefinedStorageBlocks.MACHINE_CASING),
new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_CONSTRUCTION),
new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC)
new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
);
// Exporter
GameRegistry.addShapelessRecipe(new ItemStack(RefinedStorageBlocks.EXPORTER),
new ItemStack(RefinedStorageBlocks.MACHINE_CASING),
new ItemStack(RefinedStorageItems.CORE, 1, ItemCore.TYPE_DESTRUCTION),
new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_BASIC)
new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED)
);
// Destructor
@@ -368,6 +368,19 @@ public class CommonProxy {
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON)
);
// Upgrade
GameRegistry.addRecipe(new ItemStack(RefinedStorageItems.UPGRADE, 1, 0),
"EGE",
"EPE",
"EGE",
'G', new ItemStack(Blocks.glass),
'P', new ItemStack(RefinedStorageItems.PROCESSOR, 1, ItemProcessor.TYPE_IMPROVED),
'E', new ItemStack(RefinedStorageItems.QUARTZ_ENRICHED_IRON)
);
SoldererRegistry.addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_RANGE));
SoldererRegistry.addRecipe(new SoldererRecipeUpgrade(ItemUpgrade.TYPE_SPEED));
// Storage Blocks
SoldererRegistry.addRecipe(new SoldererRecipeStorage(EnumStorageType.TYPE_1K, ItemStoragePart.TYPE_1K));
SoldererRegistry.addRecipe(new SoldererRecipeStorage(EnumStorageType.TYPE_4K, ItemStoragePart.TYPE_4K));

View File

@@ -0,0 +1,48 @@
package refinedstorage.tile.solderer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import refinedstorage.RefinedStorageItems;
import refinedstorage.item.ItemUpgrade;
public class SoldererRecipeUpgrade implements ISoldererRecipe {
private int type;
public SoldererRecipeUpgrade(int type) {
this.type = type;
}
@Override
public ItemStack getRow(int row) {
if (row == 0) {
return getBottomAndTopItem();
} else if (row == 1) {
return new ItemStack(RefinedStorageItems.UPGRADE, 1, 0);
} else if (row == 2) {
return getBottomAndTopItem();
}
return null;
}
private ItemStack getBottomAndTopItem() {
switch (type) {
case ItemUpgrade.TYPE_RANGE:
return new ItemStack(Items.ender_pearl);
case ItemUpgrade.TYPE_SPEED:
return new ItemStack(Items.redstone);
}
return null;
}
@Override
public ItemStack getResult() {
return new ItemStack(RefinedStorageItems.UPGRADE, 1, type);
}
@Override
public int getDuration() {
return 250;
}
}