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

@@ -50,6 +50,7 @@ import tconstruct.modifiers.armor.TravelModDoubleJump;
import tconstruct.modifiers.armor.TravelModRepair;
import tconstruct.modifiers.tools.ModAttack;
import tconstruct.tools.TinkerTools;
import tconstruct.util.config.PHConstruct;
import tconstruct.world.TinkerWorld;
@ObjectHolder(TConstruct.modID)
@@ -146,9 +147,11 @@ public class TinkerArmor {
@Handler
public void init(FMLInitializationEvent event) {
craftingTableRecipes();
registerModifiers();
addRecipesForDryingRack();
if (!PHConstruct.disableAllRecipes) {
craftingTableRecipes();
registerModifiers();
addRecipesForDryingRack();
}
TConstructRegistry.equipableTab.init(travelGoggles.getDefaultItem());
proxy.initialize();
}
@@ -22,6 +22,7 @@ import tconstruct.TConstruct;
import tconstruct.gadgets.item.ItemSlimeBoots;
import tconstruct.gadgets.item.ItemSlimeSling;
import tconstruct.library.TConstructRegistry;
import tconstruct.util.config.PHConstruct;
import tconstruct.world.TinkerWorld;
@Pulse(id = "Tinkers' Gadgets", description = "All the fun toys.", forced = true)
@@ -42,7 +43,7 @@ public class TinkerGadgets {
@Handler
public void init(FMLInitializationEvent event) {
if (!Loader.isModLoaded("dreamcraft")) {
if (!(Loader.isModLoaded("dreamcraft") || PHConstruct.disableAllRecipes)) {
ItemStack slimeBlockGreen = new ItemStack(TinkerWorld.slimeGel, 1, 1);
GameRegistry.addShapedRecipe(
@@ -23,6 +23,7 @@ import tconstruct.mechworks.entity.item.ExplosivePrimed;
import tconstruct.mechworks.itemblocks.ItemBlockLandmine;
import tconstruct.mechworks.logic.TileEntityLandmine;
import tconstruct.tools.TinkerTools;
import tconstruct.util.config.PHConstruct;
@ObjectHolder(TConstruct.modID)
// TODO handle migration of all items/blocks that were owned by the previously seperate mod
@@ -46,58 +47,60 @@ public class TinkerMechworks {
GameRegistry.registerTileEntity(TileEntityLandmine.class, "Landmine");
// Landmine Recipes
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerMechworks.landmine, 1, 0),
"mcm",
"rpr",
'm',
"plankWood",
'c',
new ItemStack(TinkerTools.blankPattern, 1, 1),
'r',
"dustRedstone",
'p',
Blocks.stone_pressure_plate));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerMechworks.landmine, 1, 1),
"mcm",
"rpr",
'm',
Blocks.stone,
'c',
new ItemStack(TinkerTools.blankPattern, 1, 1),
'r',
"dustRedstone",
'p',
Blocks.stone_pressure_plate));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerMechworks.landmine, 1, 2),
"mcm",
"rpr",
'm',
Blocks.obsidian,
'c',
new ItemStack(TinkerTools.blankPattern, 1, 1),
'r',
"dustRedstone",
'p',
Blocks.stone_pressure_plate));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerMechworks.landmine, 1, 3),
"mcm",
"rpr",
'm',
Items.repeater,
'c',
new ItemStack(TinkerTools.blankPattern, 1, 1),
'r',
"dustRedstone",
'p',
Blocks.stone_pressure_plate));
if (!PHConstruct.disableAllRecipes) {
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerMechworks.landmine, 1, 0),
"mcm",
"rpr",
'm',
"plankWood",
'c',
new ItemStack(TinkerTools.blankPattern, 1, 1),
'r',
"dustRedstone",
'p',
Blocks.stone_pressure_plate));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerMechworks.landmine, 1, 1),
"mcm",
"rpr",
'm',
Blocks.stone,
'c',
new ItemStack(TinkerTools.blankPattern, 1, 1),
'r',
"dustRedstone",
'p',
Blocks.stone_pressure_plate));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerMechworks.landmine, 1, 2),
"mcm",
"rpr",
'm',
Blocks.obsidian,
'c',
new ItemStack(TinkerTools.blankPattern, 1, 1),
'r',
"dustRedstone",
'p',
Blocks.stone_pressure_plate));
GameRegistry.addRecipe(
new ShapedOreRecipe(
new ItemStack(TinkerMechworks.landmine, 1, 3),
"mcm",
"rpr",
'm',
Items.repeater,
'c',
new ItemStack(TinkerTools.blankPattern, 1, 1),
'r',
"dustRedstone",
'p',
Blocks.stone_pressure_plate));
}
EntityRegistry.registerModEntity(
EntityLandmineFirework.class,
@@ -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
@@ -610,11 +610,13 @@ public class TinkerSmeltery {
public void init(FMLInitializationEvent event) {
proxy.initialize();
loadMetalPatternMaterial();
craftingTableRecipes();
addRecipesForSmeltery();
addRecipesForTableCasting();
addRecipesForBasinCasting();
addRecipesForFurnace();
if (!PHConstruct.disableAllRecipes) {
craftingTableRecipes();
addRecipesForSmeltery();
addRecipesForTableCasting();
addRecipesForBasinCasting();
addRecipesForFurnace();
}
}
@Handler
@@ -521,9 +521,11 @@ public class TinkerTools {
@Handler
public void init(FMLInitializationEvent event) {
addPartMapping();
addRecipesForToolBuilder();
addRecipesForChisel();
craftingTableRecipes();
if (!PHConstruct.disableAllRecipes) {
addRecipesForToolBuilder();
addRecipesForChisel();
craftingTableRecipes();
}
setupToolTabs();
proxy.initialize();
}
@@ -226,6 +226,11 @@ public class PHConstruct {
true,
"Allow stacks of essence berries to be consumed at once when shifting (this does not spawn XP orbs in world).")
.getBoolean();
disableAllRecipes = config.get(
"general",
"Disable All Recipes",
false,
"Disable all TiC recipes (smeltery, drying rack, crafting, etc)").getBoolean();
enableHealthRegen = config.get("Ultra Hardcore Changes", "Passive Health Regen", true).getBoolean(true);
goldAppleRecipe = config.get(
@@ -431,6 +436,8 @@ public class PHConstruct {
public static boolean consumeXPBerryStacks;
public static boolean disableAllRecipes;
// Mobs
public static int naturalSlimeSpawn;
@@ -135,8 +135,10 @@ public class TinkerWeaponry {
@Handler
public void init(FMLInitializationEvent event) {
addPartRecipies();
addWeaponRecipies();
if (!PHConstruct.disableAllRecipes) {
addPartRecipies();
addWeaponRecipies();
}
setupCreativeTab();
// Modifiers
@@ -319,8 +319,10 @@ public class TinkerWorld {
@Handler
public void init(FMLInitializationEvent event) {
craftingTableRecipes();
addRecipesForFurnace();
if (!PHConstruct.disableAllRecipes) {
craftingTableRecipes();
addRecipesForFurnace();
}
addLoot();
createEntities();
proxy.initialize();