use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.
the class ProcessingCrystallized method registerOre.
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
if (entry.material instanceof SolidMaterial) {
ItemStack stack = simpleStack.asItemStack();
ItemStack dustStack = OreDictUnifier.get(OrePrefix.dust, ((SolidMaterial) entry.material).macerateInto);
RecipeMap.HAMMER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack)).outputs(dustStack).duration(10).EUt(10).buildAndRegister();
RecipeMap.MACERATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack)).outputs(dustStack).duration(20).EUt(16).buildAndRegister();
}
}
use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.
the class ProcessingDirtyDust method registerOre.
// @Override
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack itemStack) {
if (entry.material instanceof DustMaterial) {
DustMaterial material = (DustMaterial) entry.material;
ItemStack stack = itemStack.asItemStack();
ItemStack dustStack = OreDictUnifier.get(OrePrefix.dust, material);
if (entry.orePrefix == OrePrefix.dustPure && material.separatedOnto != null) {
ItemStack separatedStack = OreDictUnifier.get(OrePrefix.dustSmall, material.separatedOnto);
RecipeMap.ELECTROMAGNETIC_SEPARATOR_RECIPES.recipeBuilder().inputs(stack).outputs(dustStack).chancedOutput(separatedStack, 4000).duration((int) material.separatedOnto.getMass()).EUt(24).buildAndRegister();
}
int byProductIndex;
if (entry.orePrefix == OrePrefix.dustRefined) {
byProductIndex = 2;
} else if (entry.orePrefix == OrePrefix.dustPure) {
byProductIndex = 1;
} else
byProductIndex = 0;
FluidMaterial byproduct = GTUtility.selectItemInList(byProductIndex, material, material.oreByProducts, FluidMaterial.class);
RecipeBuilder builder = RecipeMap.CENTRIFUGE_RECIPES.recipeBuilder().inputs(stack).outputs(dustStack).duration((int) (material.getMass() * 4)).EUt(24);
if (byproduct instanceof DustMaterial) {
builder.outputs(OreDictUnifier.get(OrePrefix.dustTiny, byproduct));
} else {
builder.fluidOutputs(byproduct.getFluid(GTValues.L / 9));
}
builder.buildAndRegister();
}
}
use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.
the class ProcessingGear method registerOre.
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
if (entry.material instanceof SolidMaterial) {
SolidMaterial material = (SolidMaterial) entry.material;
ItemStack stack = simpleStack.asItemStack();
boolean isSmall = entry.orePrefix == OrePrefix.gearSmall;
if (material.hasFlag(DustMaterial.MatFlags.SMELT_INTO_FLUID)) {
RecipeMap.FLUID_SOLIDFICATION_RECIPES.recipeBuilder().notConsumable(isSmall ? MetaItems.SHAPE_MOLD_GEAR_SMALL : MetaItems.SHAPE_MOLD_GEAR).fluidInputs(material.getFluid(L * (isSmall ? 1 : 4))).outputs(stack).duration(isSmall ? 20 : 100).EUt(8).buildAndRegister();
}
if (isSmall) {
if (material instanceof MetalMaterial && !material.hasFlag(DustMaterial.MatFlags.NO_SMASHING)) {
ModHandler.addShapedRecipe("sgear_" + material, stack, "h##", "#P#", 'P', OreDictUnifier.get(OrePrefix.plate, material));
}
} else {
ModHandler.addShapedRecipe("gear_" + material, stack, "RPR", "PdP", "RPR", 'P', OreDictUnifier.get(OrePrefix.plate, material), 'R', OreDictUnifier.get(OrePrefix.stick, material));
}
}
}
use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.
the class ProcessingPlank method registerOre.
// public static void register() {
// OrePrefix.plank.addProcessingHandler(new ProcessingPlank());
// }
//
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
ItemStack stack = simpleStack.asItemStack();
if (entry.material == Materials.Wood) {
RecipeMap.LATHE_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack)).outputs(OreDictUnifier.get(OrePrefix.stick, Materials.Wood, 2)).duration(10).EUt(8).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(8, stack), OreDictUnifier.get(OrePrefix.dust, Materials.Redstone, 1)).outputs(new ItemStack(Blocks.NOTEBLOCK, 1)).duration(200).EUt(4).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(8, stack), OreDictUnifier.get(OrePrefix.gem, Materials.Diamond, 1)).outputs(new ItemStack(Blocks.JUKEBOX, 1)).duration(400).EUt(4).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(6, stack), new ItemStack(Items.BOOK, 3)).outputs(new ItemStack(Blocks.BOOKSHELF, 1)).duration(400).EUt(4).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack)).circuitMeta(1).outputs(new ItemStack(Blocks.WOODEN_BUTTON, 1)).duration(100).EUt(4).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(2, stack)).circuitMeta(2).outputs(new ItemStack(Blocks.WOODEN_PRESSURE_PLATE)).duration(200).EUt(4).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(3, stack)).circuitMeta(3).outputs(new ItemStack(Blocks.TRAPDOOR)).duration(300).EUt(4).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(4, stack)).circuitMeta(4).outputs(new ItemStack(Blocks.CRAFTING_TABLE)).duration(400).EUt(4).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(6, stack)).circuitMeta(6).outputs(new ItemStack(Items.OAK_DOOR)).duration(600).EUt(4).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(8, stack)).circuitMeta(8).outputs(new ItemStack(Blocks.CHEST, 1)).duration(800).EUt(4).buildAndRegister();
if (stack.getItemDamage() == W) {
for (byte i = 0; i < 64; i++) {
// FIXME
ItemStack itemStack = stack.copy();
itemStack.setItemDamage(i);
ItemStack output = ModHandler.getRecipeOutput(null, itemStack, itemStack, itemStack);
if (!output.isEmpty() && output.getCount() >= 3) {
RecipeMap.CUTTER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, itemStack)).outputs(GTUtility.copyAmount(output.getCount() / 3, output)).duration(25).EUt(4).buildAndRegister();
// ModHandler.removeRecipe(itemStack, itemStack, itemStack);
ModHandler.addShapedRecipe("slab?_" + entry.material, GTUtility.copyAmount(output.getCount() / 3, output), "sP", 'P', itemStack);
}
if (itemStack.isEmpty() && i >= 16)
break;
}
} else {
ItemStack output = ModHandler.getRecipeOutput(null, stack, stack, stack);
if (!output.isEmpty() && output.getCount() >= 3) {
RecipeMap.CUTTER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack)).outputs(GTUtility.copyAmount(output.getCount() / 3, output)).duration(25).EUt(4).buildAndRegister();
// ModHandler.removeRecipe(stack, stack, stack);
ModHandler.addShapedRecipe("slab?_" + entry.material, GTUtility.copyAmount(output.getCount() / 3, output), "sP", 'P', stack);
}
}
}
}
use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.
the class ProcessingRotor method registerOre.
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
if (entry.material instanceof SolidMaterial && !entry.material.hasFlag(NO_UNIFICATION | NO_WORKING)) {
SolidMaterial material = (SolidMaterial) entry.material;
ItemStack stack = simpleStack.asItemStack();
ItemStack plateStack = OreDictUnifier.get(OrePrefix.plate, material);
ItemStack ringStack = OreDictUnifier.get(OrePrefix.ring, material);
ModHandler.addShapedRecipe("rotor_" + entry.material, stack, "PhP", "SRf", "PdP", 'P', plateStack, 'R', ringStack, 'S', OreDictUnifier.get(OrePrefix.screw, material));
// RecipeMap.ASSEMBLER_RECIPES.recipeBuilder()
// .inputs(GTUtility.copyAmount(4, plateStack), ringStack)
// .outputs(stack)
// .fluidInputs(Materials.SolderingAlloy.getFluid(32)) // TODO MATERIAL FLUIDS
// .duration(240)
// .EUt(24)
// .buildAndRegister();
}
}
Aggregations