Redo all Industrial Grinder recipes, and move them to a separate class (Here starts the great recipe cleanup of 2017!)
This commit is contained in:
parent
9b73f20ad0
commit
c24116e259
8 changed files with 270 additions and 1056 deletions
58
src/main/java/techreborn/init/recipes/RecipeMethods.java
Normal file
58
src/main/java/techreborn/init/recipes/RecipeMethods.java
Normal file
|
@ -0,0 +1,58 @@
|
|||
package techreborn.init.recipes;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.common.util.OreUtil;
|
||||
import techreborn.items.*;
|
||||
|
||||
/**
|
||||
* Created by Prospector
|
||||
*/
|
||||
public class RecipeMethods {
|
||||
static ItemStack getMaterial(String name, int count, Type type) {
|
||||
if (type == Type.DUST) {
|
||||
return ItemDusts.getDustByName(name, count);
|
||||
}
|
||||
if (type == Type.SMALL_DUST) {
|
||||
return ItemDustsSmall.getSmallDustByName(name, count);
|
||||
}
|
||||
if (type == Type.INGOT) {
|
||||
return ItemIngots.getIngotByName(name, count);
|
||||
}
|
||||
if (type == Type.GEM) {
|
||||
return ItemGems.getGemByName(name, count);
|
||||
}
|
||||
if (type == Type.PLATE) {
|
||||
return ItemPlates.getPlateByName(name, count);
|
||||
}
|
||||
if (type == Type.NUGGET) {
|
||||
return ItemNuggets.getNuggetByName(name, count);
|
||||
}
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
static ItemStack getMaterial(String name, Type type) {
|
||||
return getMaterial(name, 1, type);
|
||||
}
|
||||
|
||||
static ItemStack getOre(String name, int count) {
|
||||
return OreUtil.getStackFromName(name, count);
|
||||
}
|
||||
|
||||
static ItemStack getOre(String name) {
|
||||
return getOre(name, 1);
|
||||
}
|
||||
|
||||
static boolean oresExist(String... names) {
|
||||
for (String name : names) {
|
||||
if (!OreDictionary.doesOreNameExist(name)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
enum Type {
|
||||
DUST, SMALL_DUST, INGOT, NUGGET, PLATE, GEM
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue