use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.
the class ProcessingPure 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();
DustMaterial byproductMaterial = GTUtility.selectItemInList(1, material, material.oreByProducts, DustMaterial.class);
ItemStack pureDustStack = OreDictUnifier.get(OrePrefix.dustPure, material);
if (pureDustStack.isEmpty()) {
// fallback for reduced & cleanGravel
pureDustStack = OreDictUnifier.get(OrePrefix.dust, material);
}
RecipeMap.HAMMER_RECIPES.recipeBuilder().inputs(stack).outputs(OreDictUnifier.get(OrePrefix.dustPure, material)).duration(10).EUt(16).buildAndRegister();
RecipeMap.MACERATOR_RECIPES.recipeBuilder().inputs(stack).outputs(pureDustStack).chancedOutput(OreDictUnifier.get(OrePrefix.dust, byproductMaterial), 1000).buildAndRegister();
}
}
use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.
the class ProcessingToolOther method registerOre.
// @Override
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
if (entry.material != Materials.Stone && entry.material != Materials.Flint) {
if (entry.material != Materials.Rubber) {
ModHandler.addShapedRecipe("plunger_" + entry.material + "_" + entry.material, MetaItems.PLUNGER.getStackForm(entry.material, entry.material), "xRR", " SR", "S f", 'S', new UnificationEntry(OrePrefix.stick, entry.material), 'R', new UnificationEntry(OrePrefix.plate, Materials.Rubber));
}
if (!ModHandler.isMaterialWood(entry.material) && !entry.material.hasFlag(NO_SMASHING)) {
if (entry.material instanceof SolidMaterial) {
SolidMaterial solidMaterial = (SolidMaterial) entry.material;
ModHandler.addShapedRecipe("screwdriver_" + solidMaterial + "_" + solidMaterial.handleMaterial, MetaItems.SCREWDRIVER.getStackForm(solidMaterial, solidMaterial.handleMaterial), " fS", " Sh", "W ", 'S', OreDictUnifier.get(OrePrefix.stick, solidMaterial), 'W', OreDictUnifier.get(OrePrefix.stick, solidMaterial));
}
ModHandler.addShapedRecipe("wrench_" + entry.material + "_" + entry.material, MetaItems.WRENCH.getStackForm(entry.material, entry.material), "IhI", "III", " I ", 'I', OreDictUnifier.get(OrePrefix.ingot, entry.material));
ModHandler.addShapedRecipe("crowbar_" + entry.material + "_" + entry.material, MetaItems.CROWBAR.getStackForm(entry.material, entry.material), "hDS", "DSD", "SDf", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'D', EnumDyeColor.BLUE);
ModHandler.addShapedRecipe("wirecutter_" + entry.material + "_" + entry.material, MetaItems.WIRECUTTER.getStackForm(entry.material, entry.material), "PfP", "hPd", "STS", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material), 'T', OreDictUnifier.get(OrePrefix.screw, entry.material));
ModHandler.addShapedRecipe("scoop_" + entry.material + "_" + entry.material, MetaItems.SCOOP.getStackForm(entry.material, entry.material), "SWS", "SSS", "xSh", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'W', new ItemStack(Blocks.WOOL, 1, 32767));
ModHandler.addShapedRecipe("branchcutter_" + entry.material + "_" + entry.material, MetaItems.BRANCHCUTTER.getStackForm(entry.material, entry.material), "PfP", "PdP", "STS", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material), 'T', OreDictUnifier.get(OrePrefix.screw, entry.material));
ModHandler.addShapedRecipe("knife_" + entry.material + "_" + entry.material, MetaItems.KNIFE.getStackForm(entry.material, entry.material), "fPh", " S ", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material));
ModHandler.addShapedRecipe("butchknife_" + entry.material + "_" + entry.material, MetaItems.BUTCHERYKNIFE.getStackForm(entry.material, entry.material), "PPf", "PP ", "Sh ", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material));
ModHandler.addShapedRecipe("soldiron_lv_" + entry.material + "_" + Materials.Rubber, // TODO electric tools
MetaItems.SOLDERING_IRON_LV.getStackForm(entry.material, Materials.Rubber), "LBf", "Sd ", "P ", 'B', OreDictUnifier.get(OrePrefix.bolt, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material), 'S', OreDictUnifier.get(OrePrefix.stick, Materials.Iron), 'L', MetaItems.BATTERY_RE_LV_LITHIUM.getStackForm());
}
}
}
use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.
the class ProcessingWire method registerOre.
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
ItemStack stack = simpleStack.asItemStack();
switch(entry.orePrefix) {
case wireGt01:
if (entry.material == Materials.Cobalt || entry.material == Materials.Lead || entry.material == Materials.Tin || entry.material == Materials.Zinc || entry.material == Materials.SolderingAlloy) {
ModHandler.addShapelessRecipe(entry.material + "_t_cable01", OreDictUnifier.get(OrePrefix.cableGt01, entry.material), entry, new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Items.STRING));
RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 1, 15)).outputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).outputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 1, 15)).duration(100).EUt(8).buildAndRegister();
} else if (entry.material == Materials.RedAlloy) {
ModHandler.addShapelessRecipe(entry.material + "_t_cable01", OreDictUnifier.get(OrePrefix.cableGt01, entry.material), entry, new UnificationEntry(OrePrefix.plate, Materials.Paper));
RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper)).outputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper)).duration(100).EUt(8).buildAndRegister();
} else {
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(stack).circuitMeta(24).fluidInputs(Materials.Rubber.getFluid(L)).outputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt01, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Rubber)).duration(100).EUt(8).buildAndRegister();
}
if (!entry.material.hasFlag(DustMaterial.MatFlags.NO_SMASHING)) {
RecipeMap.BENDER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack)).outputs(OreDictUnifier.get(OrePrefix.springSmall, entry.material, 2)).duration(100).EUt(8).buildAndRegister();
RecipeMap.WIREMILL_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack)).outputs(OreDictUnifier.get(OrePrefix.wireFine, entry.material, 4)).duration(200).EUt(8).buildAndRegister();
RecipeMap.WIREMILL_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.ingot, entry.material)).outputs(GTUtility.copy(GTUtility.copyAmount(2, stack), OreDictUnifier.get(OrePrefix.wireFine, entry.material, 8))).duration(100).EUt(4).buildAndRegister();
RecipeMap.WIREMILL_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.stick, entry.material)).outputs(GTUtility.copy(stack, OreDictUnifier.get(OrePrefix.wireFine, entry.material, 4))).duration(50).EUt(4).buildAndRegister();
}
if (!entry.material.hasFlag(DustMaterial.MatFlags.NO_WORKING)) {
ModHandler.addShapedRecipe(entry.material + "_t_wire01", OreDictUnifier.get(OrePrefix.wireGt01, entry.material), "Xx", 'X', OreDictUnifier.get(OrePrefix.plate, entry.material));
}
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(2, stack)).circuitMeta(2).outputs(OreDictUnifier.get(OrePrefix.wireGt02, entry.material)).duration(150).EUt(8).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(4, stack)).circuitMeta(4).outputs(OreDictUnifier.get(OrePrefix.wireGt04, entry.material)).duration(200).EUt(8).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(8, stack)).circuitMeta(8).outputs(OreDictUnifier.get(OrePrefix.wireGt08, entry.material)).duration(300).EUt(8).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(12, stack)).circuitMeta(12).outputs(OreDictUnifier.get(OrePrefix.wireGt12, entry.material)).duration(400).EUt(8).buildAndRegister();
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(16, stack)).circuitMeta(16).outputs(OreDictUnifier.get(OrePrefix.wireGt16, entry.material)).duration(500).EUt(8).buildAndRegister();
break;
case wireGt02:
if (entry.material == Materials.Cobalt || entry.material == Materials.Lead || entry.material == Materials.Tin || entry.material == Materials.Zinc || entry.material == Materials.SolderingAlloy) {
ModHandler.addShapelessRecipe(entry.material + "_t_cable02", OreDictUnifier.get(OrePrefix.cableGt02, entry.material), entry, new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Items.STRING));
RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 1, 15)).outputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).outputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 1, 15)).duration(100).EUt(8).buildAndRegister();
} else if (entry.material == Materials.RedAlloy) {
ModHandler.addShapelessRecipe(entry.material + "_t_cable02", OreDictUnifier.get(OrePrefix.cableGt02, entry.material), entry, new UnificationEntry(OrePrefix.plate, Materials.Paper));
RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper)).outputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper)).duration(100).EUt(8).buildAndRegister();
} else {
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(stack).circuitMeta(24).fluidInputs(Materials.Rubber.getFluid(L)).outputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt02, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Rubber)).duration(100).EUt(8).buildAndRegister();
}
ModHandler.addShapelessRecipe(entry.material + "_wire02_t_wire01", OreDictUnifier.get(OrePrefix.wireGt01, entry.material, 2), entry);
ModHandler.addShapelessRecipe(entry.material + "_wire01_t_wire02", GTUtility.copyAmount(1, stack), new UnificationEntry(OrePrefix.wireGt01, entry.material), new UnificationEntry(OrePrefix.wireGt01, entry.material));
break;
case wireGt04:
if (entry.material == Materials.Cobalt || entry.material == Materials.Lead || entry.material == Materials.Tin || entry.material == Materials.Zinc || entry.material == Materials.SolderingAlloy) {
ModHandler.addShapelessRecipe(entry.material + "_t_cable04", OreDictUnifier.get(OrePrefix.cableGt04, entry.material), entry, new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Items.STRING));
RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 2, 15)).outputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).outputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 2, 15)).duration(100).EUt(8).buildAndRegister();
} else if (entry.material == Materials.RedAlloy) {
ModHandler.addShapelessRecipe(entry.material + "_t_cable04", OreDictUnifier.get(OrePrefix.cableGt04, entry.material), entry, new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper));
RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper, 2)).outputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper, 2)).duration(100).EUt(8).buildAndRegister();
} else {
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(stack).circuitMeta(24).fluidInputs(Materials.Rubber.getFluid(2 * L)).outputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt04, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Rubber, 2)).duration(100).EUt(8).buildAndRegister();
}
ModHandler.addShapelessRecipe(entry.material + "_wire04_t_wire01", OreDictUnifier.get(OrePrefix.wireGt01, entry.material, 4), entry);
ModHandler.addShapelessRecipe(entry.material + "_wire02_t_wire04", GTUtility.copyAmount(1, stack), new UnificationEntry(OrePrefix.wireGt02, entry.material), new UnificationEntry(OrePrefix.wireGt02, entry.material));
break;
case wireGt08:
if (entry.material == Materials.Cobalt || entry.material == Materials.Lead || entry.material == Materials.Tin || entry.material == Materials.Zinc || entry.material == Materials.SolderingAlloy) {
ModHandler.addShapelessRecipe(entry.material + "_wire08_t_cable08", OreDictUnifier.get(OrePrefix.cableGt08, entry.material), entry, new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Items.STRING));
RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 3, 15)).outputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).outputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 3, 15)).duration(100).EUt(8).buildAndRegister();
} else if (entry.material == Materials.RedAlloy) {
ModHandler.addShapelessRecipe(entry.material + "_wire08_t_cable08", OreDictUnifier.get(OrePrefix.cableGt08, entry.material), entry, new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper));
RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper)).outputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper, 3)).duration(100).EUt(8).buildAndRegister();
} else {
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(stack).circuitMeta(24).fluidInputs(Materials.Rubber.getFluid(3 * L)).outputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt08, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Rubber, 3)).duration(100).EUt(8).buildAndRegister();
}
ModHandler.addShapelessRecipe(entry.material + "_wire08_t_wire01", OreDictUnifier.get(OrePrefix.wireGt01, entry.material, 8), entry);
ModHandler.addShapelessRecipe(entry.material + "_wire04_t_wire08", GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.wireGt04, entry.material), OreDictUnifier.get(OrePrefix.wireGt04, entry.material));
break;
case wireGt12:
if (entry.material == Materials.Cobalt || entry.material == Materials.Lead || entry.material == Materials.Tin || entry.material == Materials.Zinc || entry.material == Materials.SolderingAlloy) {
ModHandler.addShapelessRecipe(entry.material + "_wire12_t_cable12", OreDictUnifier.get(OrePrefix.cableGt12, entry.material), entry, new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Blocks.CARPET, 1, 15), new ItemStack(Items.STRING));
RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 4, 15)).outputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).outputs(GTUtility.copyAmount(1, stack), new ItemStack(Blocks.CARPET, 4, 15)).duration(100).EUt(8).buildAndRegister();
} else if (entry.material == Materials.RedAlloy) {
ModHandler.addShapelessRecipe(entry.material + "_wire12_t_cable12", OreDictUnifier.get(OrePrefix.cableGt12, entry.material), entry, new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper), new UnificationEntry(OrePrefix.plate, Materials.Paper));
RecipeMap.BOXINATOR_RECIPES.recipeBuilder().inputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper, 4)).outputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Paper, 4)).duration(100).EUt(8).buildAndRegister();
} else {
RecipeMap.ASSEMBLER_RECIPES.recipeBuilder().inputs(stack).circuitMeta(24).fluidInputs(Materials.Rubber.getFluid(4 * L)).outputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).duration(100).EUt(8).buildAndRegister();
RecipeMap.UNBOXINATOR_RECIPES.recipeBuilder().inputs(OreDictUnifier.get(OrePrefix.cableGt12, entry.material)).outputs(GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.plate, Materials.Rubber, 4)).duration(100).EUt(8).buildAndRegister();
}
ModHandler.addShapelessRecipe(entry.material + "_wire12_t_wire01", OreDictUnifier.get(OrePrefix.wireGt01, entry.material, 12), entry);
ModHandler.addShapelessRecipe(entry.material + "_wire12_t_wire08_04", GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.wireGt08, entry.material), OreDictUnifier.get(OrePrefix.wireGt04, entry.material));
break;
case wireGt16:
ModHandler.addShapelessRecipe(entry.material + "_wire01_t_wire16", OreDictUnifier.get(OrePrefix.wireGt01, entry.material, 16), entry);
ModHandler.addShapelessRecipe(entry.material + "_wire08_t_wire16", GTUtility.copyAmount(1, stack), OreDictUnifier.get(OrePrefix.wireGt08, entry.material), OreDictUnifier.get(OrePrefix.wireGt08, entry.material));
break;
}
}
use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.
the class OreDictUnifier method getUnificated.
public static ItemStack getUnificated(ItemStack itemStack) {
if (itemStack.isEmpty())
return ItemStack.EMPTY;
UnificationEntry unificationEntry = getUnificationEntry(itemStack);
if (unificationEntry == null || !stackUnificationItems.containsKey(unificationEntry) || !unificationEntry.orePrefix.isUnificationEnabled)
return itemStack;
ArrayList<SimpleItemStack> keys = stackUnificationItems.get(unificationEntry);
keys.sort(Comparator.comparing(a -> a.item.delegate.name().getResourceDomain()));
return keys.size() > 0 ? keys.get(0).asItemStack(itemStack.getCount()) : itemStack;
}
use of gregtech.api.unification.stack.SimpleItemStack in project GregTech by GregTechCE.
the class BlockMachine method onBlockActivated.
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
MetaTileEntity metaTileEntity = getMetaTileEntity(worldIn, pos);
if (metaTileEntity == null)
return false;
ItemStack itemInHand = playerIn.getHeldItem(hand);
if (!itemInHand.isEmpty()) {
SimpleItemStack simpleItemStack = new SimpleItemStack(itemInHand);
if (GregTechAPI.screwdriverList.contains(simpleItemStack)) {
if (GTUtility.doDamageItem(itemInHand, DAMAGE_FOR_SCREWDRIVER_CLICK, true) && metaTileEntity.onScrewdriverClick(playerIn, hand, facing, hitX, hitY, hitZ)) {
GTUtility.doDamageItem(itemInHand, DAMAGE_FOR_SCREWDRIVER_CLICK, false);
return true;
} else
return false;
} else if (GregTechAPI.wrenchList.contains(simpleItemStack)) {
if (GTUtility.doDamageItem(itemInHand, DAMAGE_FOR_WRENCH_CLICK, true) && metaTileEntity.onWrenchClick(playerIn, hand, facing, hitX, hitY, hitZ)) {
GTUtility.doDamageItem(itemInHand, DAMAGE_FOR_WRENCH_CLICK, false);
return true;
} else
return false;
}
}
return metaTileEntity.onRightClick(playerIn, hand, facing, hitX, hitY, hitZ);
}
Aggregations