mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 13:09:53 +00:00
Add "Disable All Recipes" config option (#169)
Co-authored-by: Maya <[email protected]>
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user