Add "Disable All Recipes" config option (#169)

Co-authored-by: Maya <[email protected]>
This commit is contained in:
__felix__andMaya authored and GitHub committed 2025-04-21 04:57:34 +00:00
1 parent f88eed9dfa
commit e43aa471d1
11 files changed
+141 -111

No files matched your search

@@ -47,39 +47,41 @@ public class TinkerGears {
}
// find all gears in the registry
for (String oreName : OreDictionary.getOreNames()) {
if (!oreName.startsWith("gear")) continue;
if (!PHConstruct.disableAllRecipes) {
for (String oreName : OreDictionary.getOreNames()) {
if (!oreName.startsWith("gear")) continue;
List<ItemStack> gears = OreDictionary.getOres(oreName);
List<ItemStack> gears = OreDictionary.getOres(oreName);
// register every gear besides wooden gear for creating a gear cast
if (!oreName.equals("gearWood")) {
for (ItemStack g : gears) {
TConstructRegistry.getTableCasting().addCastingRecipe(cast, aluCastLiquid, g, false, 50);
if (!PHConstruct.removeGoldCastRecipes)
TConstructRegistry.getTableCasting().addCastingRecipe(cast, goldCastLiquid, g, false, 50);
// register every gear besides wooden gear for creating a gear cast
if (!oreName.equals("gearWood")) {
for (ItemStack g : gears) {
TConstructRegistry.getTableCasting().addCastingRecipe(cast, aluCastLiquid, g, false, 50);
if (!PHConstruct.removeGoldCastRecipes)
TConstructRegistry.getTableCasting().addCastingRecipe(cast, goldCastLiquid, g, false, 50);
}
}
}
// find a fluid that fits the gear
String material = oreName.substring(4);
// try the oredict name directly
Fluid fluid = FluidRegistry.getFluid(material);
// or lowercased
if (fluid == null) fluid = FluidRegistry.getFluid(material.toLowerCase());
// or in the tinkers liquid format
if (fluid == null) fluid = FluidRegistry.getFluid(material.toLowerCase() + ".molten");
// find a fluid that fits the gear
String material = oreName.substring(4);
// try the oredict name directly
Fluid fluid = FluidRegistry.getFluid(material);
// or lowercased
if (fluid == null) fluid = FluidRegistry.getFluid(material.toLowerCase());
// or in the tinkers liquid format
if (fluid == null) fluid = FluidRegistry.getFluid(material.toLowerCase() + ".molten");
// found one?
if (fluid != null) {
ItemStack gear = gears.get(0);
FluidStack liquid = new FluidStack(fluid.getID(), TConstruct.ingotLiquidValue * 4);
// gear casting
TConstructRegistry.getTableCasting().addCastingRecipe(gear, liquid, cast, 55);
// and melting it back
FluidType ft = FluidType.getFluidType(fluid);
if (ft != null) Smeltery.addMelting(ft, gear, 100, TConstruct.ingotLiquidValue * 4);
else Smeltery.addMelting(gear, TinkerSmeltery.glueBlock, 0, 100, liquid);
// found one?
if (fluid != null) {
ItemStack gear = gears.get(0);
FluidStack liquid = new FluidStack(fluid.getID(), TConstruct.ingotLiquidValue * 4);
// gear casting
TConstructRegistry.getTableCasting().addCastingRecipe(gear, liquid, cast, 55);
// and melting it back
FluidType ft = FluidType.getFluidType(fluid);
if (ft != null) Smeltery.addMelting(ft, gear, 100, TConstruct.ingotLiquidValue * 4);
else Smeltery.addMelting(gear, TinkerSmeltery.glueBlock, 0, 100, liquid);
}
}
}
}
@@ -14,6 +14,7 @@ import tconstruct.TConstruct;
import tconstruct.api.harvesting.CropHarvestHandlers;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.LiquidCasting;
import tconstruct.util.config.PHConstruct;
@ObjectHolder(TConstruct.modID)
@Pulse(
@@ -38,11 +39,13 @@ public class TinkerIC2 {
LiquidCasting basinCasting = TConstructRegistry.getBasinCasting();
// Block casting
basinCasting.addCastingRecipe(
new ItemStack(Blocks.diamond_block),
fluidStackBlock,
new ItemStack(Blocks.dirt),
true,
50);
if (!PHConstruct.disableAllRecipes) {
basinCasting.addCastingRecipe(
new ItemStack(Blocks.diamond_block),
fluidStackBlock,
new ItemStack(Blocks.dirt),
true,
50);
}
}
}
@@ -18,6 +18,7 @@ import tconstruct.TConstruct;
import tconstruct.library.TConstructRegistry;
import tconstruct.smeltery.TinkerSmeltery;
import tconstruct.tools.TinkerTools;
import tconstruct.util.config.PHConstruct;
import tconstruct.world.TinkerWorld;
@ObjectHolder(TConstruct.modID)
@@ -95,15 +96,17 @@ public class TinkerTE4 {
0);
// Dust Recipes
GameRegistry.addRecipe(
new ShapelessOreRecipe(new ItemStack(TinkerTools.materials, 1, 41), "dustArdite", "dustCobalt"));
GameRegistry.addRecipe(
new ShapelessOreRecipe(
new ItemStack(TinkerTools.materials, 4, 42),
"dustAluminum",
"dustAluminum",
"dustAluminum",
"dustCopper"));
if (!PHConstruct.disableAllRecipes) {
GameRegistry.addRecipe(
new ShapelessOreRecipe(new ItemStack(TinkerTools.materials, 1, 41), "dustArdite", "dustCobalt"));
GameRegistry.addRecipe(
new ShapelessOreRecipe(
new ItemStack(TinkerTools.materials, 4, 42),
"dustAluminum",
"dustAluminum",
"dustAluminum",
"dustCopper"));
}
}
@Handler