The Great Refactor of 2017 - More recipes moved over!
This commit is contained in:
parent
c8ebf402af
commit
e86c0d175c
7 changed files with 250 additions and 362 deletions
|
@ -1,8 +1,13 @@
|
|||
package techreborn.init.recipes;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.common.util.OreUtil;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.blocks.BlockMachineFrame;
|
||||
import techreborn.init.IC2Duplicates;
|
||||
import techreborn.items.*;
|
||||
import techreborn.parts.powerCables.ItemStandaloneCables;
|
||||
|
||||
|
@ -29,6 +34,12 @@ public abstract class RecipeMethods {
|
|||
return ItemParts.getPartByName(name, count);
|
||||
} else if (type == Type.CABLE) {
|
||||
return ItemStandaloneCables.getCableByName(name, count);
|
||||
} else if (type == Type.MACHINE_FRAME) {
|
||||
return BlockMachineFrame.getFrameByName(name, count);
|
||||
} else if (type == Type.MACHINE_CASING) {
|
||||
return BlockMachineCasing.getStackByName(name, count);
|
||||
} else if (type == Type.UPGRADE) {
|
||||
return ItemUpgrades.getUpgradeByName(name, count);
|
||||
} else {
|
||||
|
||||
}
|
||||
|
@ -40,7 +51,7 @@ public abstract class RecipeMethods {
|
|||
}
|
||||
|
||||
static ItemStack getOre(String name, int count) {
|
||||
return OreUtil.getStackFromName(name, count);
|
||||
return OreUtil.getStackFromName(name, count).copy();
|
||||
}
|
||||
|
||||
static ItemStack getOre(String name) {
|
||||
|
@ -56,7 +67,57 @@ public abstract class RecipeMethods {
|
|||
return true;
|
||||
}
|
||||
|
||||
static ItemStack getStack(Item item) {
|
||||
return getStack(item, 1);
|
||||
}
|
||||
|
||||
static ItemStack getStack(Item item, int count) {
|
||||
return getStack(item, count, 0);
|
||||
}
|
||||
|
||||
static ItemStack getStack(Item item, boolean wildcard) {
|
||||
return getStack(item, 1, true);
|
||||
}
|
||||
|
||||
static ItemStack getStack(Item item, int count, boolean wildcard) {
|
||||
return getStack(item, count, OreDictionary.WILDCARD_VALUE);
|
||||
}
|
||||
|
||||
static ItemStack getStack(Item item, int count, int metadata) {
|
||||
return new ItemStack(item, count, metadata);
|
||||
}
|
||||
|
||||
static ItemStack getStack(Block block) {
|
||||
return getStack(block, 1);
|
||||
}
|
||||
|
||||
static ItemStack getStack(Block block, int count) {
|
||||
return getStack(block, count, 0);
|
||||
}
|
||||
|
||||
static ItemStack getStack(Block block, boolean wildcard) {
|
||||
return getStack(block, 1, true);
|
||||
}
|
||||
|
||||
static ItemStack getStack(Block block, int count, boolean wildcard) {
|
||||
return getStack(block, count, OreDictionary.WILDCARD_VALUE);
|
||||
}
|
||||
|
||||
static ItemStack getStack(Block block, int count, int metadata) {
|
||||
return getStack(Item.getItemFromBlock(block), count, OreDictionary.WILDCARD_VALUE);
|
||||
}
|
||||
|
||||
static ItemStack getStack(IC2Duplicates ic2Duplicates) {
|
||||
return getStack(ic2Duplicates, 1);
|
||||
}
|
||||
|
||||
static ItemStack getStack(IC2Duplicates ic2Duplicates, int count) {
|
||||
ItemStack stack = ic2Duplicates.getStackBasedOnConfig();
|
||||
stack.setCount(count);
|
||||
return stack;
|
||||
}
|
||||
|
||||
enum Type {
|
||||
DUST, SMALL_DUST, INGOT, NUGGET, PLATE, GEM, CELL, PART, CABLE
|
||||
DUST, SMALL_DUST, INGOT, NUGGET, PLATE, GEM, CELL, PART, CABLE, MACHINE_FRAME, MACHINE_CASING, UPGRADE
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue