use of gregtech.api.unification.material.type.GemMaterial in project GregTech by GregTechCE.
the class ProcessingCrushedPurified method registerOre.
// public static void register() {
// OrePrefix.crushedPurified.addProcessingHandler(new ProcessingCrushedPurified());
// }
// @Override
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack itemStack) {
if (entry.material instanceof SolidMaterial) {
ItemStack crushedPurifiedStack = itemStack.asItemStack();
SolidMaterial solidMaterial = (SolidMaterial) entry.material;
ItemStack crushedCentrifugedStack = OreDictUnifier.get(OrePrefix.crushedCentrifuged, solidMaterial);
ItemStack dustStack = OreDictUnifier.get(OrePrefix.dust, solidMaterial);
ItemStack byproductStack = OreDictUnifier.get(OrePrefix.dustTiny, GTUtility.selectItemInList(1, solidMaterial, solidMaterial.oreByProducts, DustMaterial.class));
if (!crushedCentrifugedStack.isEmpty()) {
RecipeMap.THERMAL_CENTRIFUGE_RECIPES.recipeBuilder().inputs(crushedPurifiedStack).outputs(crushedCentrifugedStack, byproductStack).duration((int) (entry.material.getMass() * 20)).EUt(60).buildAndRegister();
} else {
RecipeMap.THERMAL_CENTRIFUGE_RECIPES.recipeBuilder().inputs(crushedPurifiedStack).outputs(dustStack, byproductStack).duration((int) (entry.material.getMass() * 20)).EUt(60).buildAndRegister();
}
if (entry.material instanceof GemMaterial) {
ItemStack exquisiteStack = OreDictUnifier.get(OrePrefix.gemExquisite, entry.material);
ItemStack flawlessStack = OreDictUnifier.get(OrePrefix.gemFlawless, entry.material);
ItemStack gemStack = OreDictUnifier.get(OrePrefix.gem, entry.material);
ItemStack flawedStack = OreDictUnifier.get(OrePrefix.gemFlawed, entry.material);
ItemStack chippedStack = OreDictUnifier.get(OrePrefix.gemChipped, entry.material);
if (entry.material.hasFlag(GemMaterial.MatFlags.HIGH_SIFTER_OUTPUT)) {
RecipeMap.SIFTER_RECIPES.recipeBuilder().inputs(crushedPurifiedStack).chancedOutput(exquisiteStack, 300).chancedOutput(flawlessStack, 1200).chancedOutput(gemStack, 4500).chancedOutput(flawedStack, 1400).chancedOutput(chippedStack, 2800).chancedOutput(dustStack, 3500).duration(800).EUt(16).buildAndRegister();
} else {
RecipeMap.SIFTER_RECIPES.recipeBuilder().inputs(crushedPurifiedStack).chancedOutput(exquisiteStack, 100).chancedOutput(flawlessStack, 400).chancedOutput(gemStack, 1500).chancedOutput(flawedStack, 2000).chancedOutput(chippedStack, 4000).chancedOutput(dustStack, 5000).duration(800).EUt(16).buildAndRegister();
}
}
}
}
use of gregtech.api.unification.material.type.GemMaterial in project GregTech by GregTechCE.
the class ProcessingGem method registerOre.
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
if (entry.material instanceof GemMaterial) {
GemMaterial material = (GemMaterial) entry.material;
ItemStack stack = simpleStack.asItemStack();
long materialAmount = entry.orePrefix.materialAmount;
ItemStack crushedStack = OreDictUnifier.getDust(material, materialAmount);
if (material.hasFlag(SolidMaterial.MatFlags.MORTAR_GRINDABLE)) {
ModHandler.addShapelessRecipe("gem_t_dust_" + material, crushedStack, "m", stack);
}
if (!material.hasFlag(DustMaterial.MatFlags.NO_SMASHING)) {
OrePrefix prevPrefix = GTUtility.getItem(ORDER, ORDER.indexOf(entry.orePrefix) - 1, null);
if (prevPrefix != null) {
ItemStack prevStack = OreDictUnifier.get(prevPrefix, material, 2);
ModHandler.addShapelessRecipe("gem_t_gem_" + material, prevStack, "h", stack);
RecipeMap.HAMMER_RECIPES.recipeBuilder().inputs(stack).outputs(prevStack).duration(20).EUt(16).buildAndRegister();
}
}
if (!material.hasFlag(DustMaterial.MatFlags.NO_WORKING)) {
if (material.hasFlag(SolidMaterial.MatFlags.GENERATE_LONG_ROD) && materialAmount >= M * 2) {
RecipeMap.LATHE_RECIPES.recipeBuilder().inputs(stack).outputs(OreDictUnifier.get(OrePrefix.stickLong, material, (int) (materialAmount / (M * 2))), OreDictUnifier.getDust(material, materialAmount % (M * 2))).duration((int) material.getMass()).EUt(16).buildAndRegister();
} else if (materialAmount >= M) {
RecipeMap.LATHE_RECIPES.recipeBuilder().inputs(stack).outputs(OreDictUnifier.get(OrePrefix.stick, material, (int) (materialAmount / M)), OreDictUnifier.getDust(material, materialAmount % M)).duration((int) material.getMass()).EUt(16).buildAndRegister();
}
}
}
}
use of gregtech.api.unification.material.type.GemMaterial in project GregTech by GregTechCE.
the class ProcessingLens method registerOre.
// public static void register() {
// OrePrefix.lens.addProcessingHandler(new ProcessingLens());
// }
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
if (entry.material instanceof GemMaterial) {
ItemStack stack = simpleStack.asItemStack();
RecipeMap.LATHE_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.plate, entry.material)).outputs(stack, OreDictUnifier.get(OrePrefix.dustSmall, entry.material)).duration((int) (entry.material.getMass() / 2L)).EUt(16).buildAndRegister();
EnumDyeColor dyeColor = GTUtility.determineDyeColor(entry.material.materialRGB);
MarkerMaterial colorMaterial = MarkerMaterials.Color.COLORS.get(dyeColor);
OreDictUnifier.registerOre(stack, OrePrefix.craftingLens, colorMaterial);
}
}
Aggregations