2014-01-08 02:55:50 +01:00
package mekanism.common.integration ;
2013-12-24 17:55:40 +01:00
2015-03-06 13:50:09 +01:00
import ic2.api.recipe.RecipeInputOreDict ;
import ic2.api.recipe.Recipes ;
2014-01-14 03:43:36 +01:00
import java.util.ArrayList ;
2015-03-18 01:22:15 +01:00
import java.util.Arrays ;
import java.util.List ;
2014-01-14 03:43:36 +01:00
2022-09-04 14:06:37 +02:00
import mekanism.api.MekanismConfig ;
2014-01-16 00:01:12 +01:00
import mekanism.api.gas.GasRegistry ;
import mekanism.api.gas.GasStack ;
2013-12-24 17:55:40 +01:00
import mekanism.api.infuse.InfuseObject ;
import mekanism.api.infuse.InfuseRegistry ;
2022-09-04 14:06:37 +02:00
import mekanism.api.recipe.RecipeHelper ;
2014-08-31 07:34:53 +02:00
import mekanism.api.util.StackUtils ;
2022-09-08 17:36:04 +02:00
import mekanism.common.* ;
import mekanism.common.block.BlockMachine ;
2014-01-08 02:55:50 +01:00
import mekanism.common.recipe.RecipeHandler ;
2014-01-14 03:43:36 +01:00
import mekanism.common.recipe.RecipeHandler.Recipe ;
2022-09-08 17:36:04 +02:00
import mekanism.common.recipe.ShapedMekanismRecipe ;
2013-12-24 17:55:40 +01:00
import mekanism.common.util.MekanismUtils ;
2014-01-14 03:43:36 +01:00
import net.minecraft.entity.player.EntityPlayer ;
2014-04-20 05:34:19 +02:00
import net.minecraft.init.Blocks ;
import net.minecraft.init.Items ;
2014-01-14 03:43:36 +01:00
import net.minecraft.inventory.Container ;
import net.minecraft.inventory.InventoryCrafting ;
2013-12-24 17:55:40 +01:00
import net.minecraft.item.ItemStack ;
2014-01-14 03:43:36 +01:00
import net.minecraft.item.crafting.CraftingManager ;
2013-12-24 17:55:40 +01:00
import net.minecraft.item.crafting.FurnaceRecipes ;
import net.minecraftforge.oredict.OreDictionary ;
2014-06-26 02:10:53 +02:00
import cpw.mods.fml.common.Optional.Method ;
2013-12-24 17:55:40 +01:00
public final class OreDictManager
{
2015-03-18 01:22:15 +01:00
private static final List < String > minorCompat = Arrays . asList ( " Nickel " , " Aluminum " ) ;
2022-09-08 17:36:04 +02:00
private static List < String > osmiumcompat = new ArrayList < > ( ) ;
2015-03-18 01:22:15 +01:00
2022-09-08 15:48:38 +02:00
public static void init ( ) {
2022-09-08 17:36:04 +02:00
if ( MekanismConfig . general . OreDictOsmium ) {
osmiumcompat . add ( " Osmium " ) ;
}
if ( MekanismConfig . general . OreDictPlatinum ) {
osmiumcompat . add ( " Platinum " ) ;
}
2014-01-14 03:43:36 +01:00
addLogRecipes ( ) ;
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " plankWood " ) ) {
if ( ore . getHasSubtypes ( ) ) {
2014-05-29 20:01:43 +02:00
ItemStack wildStack = new ItemStack ( ore . getItem ( ) , 1 , OreDictionary . WILDCARD_VALUE ) ;
2022-09-08 15:48:38 +02:00
if ( ! Recipe . PRECISION_SAWMILL . containsRecipe ( wildStack ) ) {
2014-09-04 05:26:55 +02:00
RecipeHandler . addPrecisionSawmillRecipe ( wildStack , new ItemStack ( Items . stick , 6 ) , new ItemStack ( MekanismItems . Sawdust ) , 0 . 25 ) ;
2014-01-14 03:43:36 +01:00
}
2022-09-08 15:48:38 +02:00
} else {
2014-09-04 05:26:55 +02:00
RecipeHandler . addPrecisionSawmillRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( Items . stick , 6 ) , new ItemStack ( MekanismItems . Sawdust ) , 0 . 25 ) ;
2014-01-14 03:43:36 +01:00
}
}
2022-09-08 15:52:18 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " ingotSteel " ) ) {
RecipeHandler . addMetallurgicInfuserRecipe ( InfuseRegistry . get ( " REDSTONE " ) , 10 , StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . EnrichedAlloy ) ) ;
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " oreNetherSteel " ) ) {
2015-03-18 00:16:36 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . OtherDust , 4 , 1 ) ) ;
2014-02-04 18:24:39 +01:00
}
2022-09-08 15:48:38 +02:00
if ( OreDictionary . getOres ( " itemRubber " ) . size ( ) > 0 ) {
for ( ItemStack ore : OreDictionary . getOres ( " woodRubber " ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addPrecisionSawmillRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( Blocks . planks , 4 ) , StackUtils . size ( OreDictionary . getOres ( " itemRubber " ) . get ( 0 ) , 1 ) , 1F ) ;
2014-01-30 23:02:56 +01:00
}
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " dustSulfur " ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addChemicalOxidizerRecipe ( StackUtils . size ( ore , 1 ) , new GasStack ( GasRegistry . getGas ( " sulfurDioxideGas " ) , 100 ) ) ;
2014-01-16 00:01:12 +01:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " dustSalt " ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addChemicalOxidizerRecipe ( StackUtils . size ( ore , 1 ) , new GasStack ( GasRegistry . getGas ( " brine " ) , 15 ) ) ;
2014-07-10 05:52:01 +02:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " dustRefinedObsidian " ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addOsmiumCompressorRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . Ingot , 1 , 0 ) ) ;
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . OtherDust , 1 , 6 ) ) ;
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . CompressedObsidian ) ) ;
2022-09-08 15:48:38 +02:00
2015-03-18 01:22:15 +01:00
InfuseRegistry . registerInfuseObject ( StackUtils . size ( ore , 1 ) , new InfuseObject ( InfuseRegistry . get ( " OBSIDIAN " ) , 10 ) ) ;
2013-12-24 17:55:40 +01:00
}
2022-09-08 15:48:38 +02:00
for ( Resource resource : Resource . values ( ) ) {
for ( ItemStack ore : OreDictionary . getOres ( " clump " + resource . getName ( ) ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . DirtyDust , 1 , resource . ordinal ( ) ) ) ;
2015-03-18 00:16:36 +01:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " shard " + resource . getName ( ) ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addPurificationChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . Clump , 1 , resource . ordinal ( ) ) ) ;
2015-03-18 00:16:36 +01:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " crystal " + resource . getName ( ) ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addChemicalInjectionChamberRecipe ( StackUtils . size ( ore , 1 ) , " hydrogenChloride " , new ItemStack ( MekanismItems . Shard , 1 , resource . ordinal ( ) ) ) ;
2015-03-18 00:16:36 +01:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " dustDirty " + resource . getName ( ) ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . Dust , 1 , resource . ordinal ( ) ) ) ;
2015-03-18 00:16:36 +01:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " ore " + resource . getName ( ) ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . Dust , 2 , resource . ordinal ( ) ) ) ;
RecipeHandler . addPurificationChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . Clump , 3 , resource . ordinal ( ) ) ) ;
RecipeHandler . addChemicalInjectionChamberRecipe ( StackUtils . size ( ore , 1 ) , " hydrogenChloride " , new ItemStack ( MekanismItems . Shard , 4 , resource . ordinal ( ) ) ) ;
RecipeHandler . addChemicalDissolutionChamberRecipe ( StackUtils . size ( ore , 1 ) , new GasStack ( GasRegistry . getGas ( resource . getName ( ) . toLowerCase ( ) ) , 1000 ) ) ;
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " ingot " + resource . getName ( ) ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . Dust , 1 , resource . ordinal ( ) ) ) ;
2015-03-18 00:16:36 +01:00
}
2022-09-08 15:48:38 +02:00
2015-03-18 01:22:15 +01:00
try {
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " dust " + resource . getName ( ) ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCombinerRecipe ( StackUtils . size ( ore , 8 ) , StackUtils . size ( OreDictionary . getOres ( " ore " + resource . getName ( ) ) . get ( 0 ) , 1 ) ) ;
}
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2013-12-24 17:55:40 +01:00
}
2022-09-08 17:36:04 +02:00
if ( MekanismConfig . general . OreDictOsmium | | MekanismConfig . general . OreDictPlatinum ) {
for ( String s : osmiumcompat ) {
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( new ItemStack ( MekanismBlocks . BasicBlock , 1 , 0 ) , new Object [ ] {
" XXX " , " XXX " , " XXX " , Character . valueOf ( 'X' ) , " ingot " + s
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( new ItemStack ( MekanismItems . SpeedUpgrade ) , new Object [ ] {
" G " , " ADA " , " G " , Character . valueOf ( 'G' ) , " blockGlass " , Character . valueOf ( 'A' ) , MekanismItems . EnrichedAlloy , Character . valueOf ( 'D' ) , " dust " + s
} ) ) ;
BlockMachine . MachineType . METALLURGIC_INFUSER . addRecipe ( new ShapedMekanismRecipe ( new ItemStack ( MekanismBlocks . MachineBlock , 1 , 8 ) , new Object [ ] {
" IFI " , " ROR " , " IFI " , Character . valueOf ( 'I' ) , " ingotIron " , Character . valueOf ( 'F' ) , Blocks . furnace , Character . valueOf ( 'R' ) , " dustRedstone " , Character . valueOf ( 'O' ) , " ingot " + s
} ) ) ;
BlockMachine . MachineType . PURIFICATION_CHAMBER . addRecipe ( new ShapedMekanismRecipe ( new ItemStack ( MekanismBlocks . MachineBlock , 1 , 9 ) , new Object [ ] {
" ECE " , " ORO " , " ECE " , Character . valueOf ( 'C' ) , MekanismUtils . getControlCircuit ( Tier . BaseTier . ADVANCED ) , Character . valueOf ( 'E' ) , " alloyAdvanced " , Character . valueOf ( 'O' ) , " ingot " + s , Character . valueOf ( 'R' ) , new ItemStack ( MekanismBlocks . MachineBlock , 1 , 0 )
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( new ItemStack ( MekanismBlocks . BasicBlock , 1 , 8 ) , new Object [ ] {
" SGS " , " GPG " , " SGS " , Character . valueOf ( 'S' ) , " ingotSteel " , Character . valueOf ( 'P' ) , " ingot " + s , Character . valueOf ( 'G' ) , " blockGlass "
} ) ) ;
BlockMachine . MachineType . ELECTRIC_PUMP . addRecipe ( new ShapedMekanismRecipe ( new ItemStack ( MekanismBlocks . MachineBlock , 1 , 12 ) , new Object [ ] {
" B " , " ECE " , " OOO " , Character . valueOf ( 'B' ) , Items . bucket , Character . valueOf ( 'E' ) , MekanismItems . EnrichedAlloy , Character . valueOf ( 'C' ) , new ItemStack ( MekanismBlocks . BasicBlock , 1 , 8 ) , Character . valueOf ( 'O' ) , " ingot " + s
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( new ItemStack ( MekanismItems . WalkieTalkie ) , new Object [ ] {
" O " , " SCS " , " S " , Character . valueOf ( 'O' ) , " ingot " + s , Character . valueOf ( 'S' ) , " ingotSteel " , Character . valueOf ( 'C' ) , MekanismUtils . getControlCircuit ( Tier . BaseTier . BASIC )
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( new ItemStack ( MekanismItems . ElectrolyticCore ) , new Object [ ] {
" EPE " , " IEG " , " EPE " , Character . valueOf ( 'E' ) , MekanismItems . EnrichedAlloy , Character . valueOf ( 'P' ) , " dust " + s , Character . valueOf ( 'I' ) , " dustIron " , Character . valueOf ( 'G' ) , " dustGold "
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( new ItemStack ( Blocks . rail , 24 ) , new Object [ ] {
" O O " , " OSO " , " O O " , Character . valueOf ( 'O' ) , " ingot " + s , Character . valueOf ( 'S' ) , " stickWood "
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( MekanismItems . GaugeDropper . getEmptyItem ( ) , new Object [ ] {
" O " , " G G " , " GGG " , Character . valueOf ( 'O' ) , " ingot " + s , Character . valueOf ( 'G' ) , " paneGlass "
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( new ItemStack ( MekanismItems . TierInstaller , 1 , 1 ) , new Object [ ] {
" ECE " , " oWo " , " ECE " , Character . valueOf ( 'E' ) , " alloyAdvanced " , Character . valueOf ( 'C' ) , MekanismUtils . getControlCircuit ( Tier . BaseTier . ADVANCED ) , Character . valueOf ( 'o' ) , " ingot " + s , Character . valueOf ( 'W' ) , " plankWood "
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( MekanismUtils . getEnergyCube ( Tier . EnergyCubeTier . ADVANCED ) , new Object [ ] {
" ETE " , " oBo " , " ETE " , Character . valueOf ( 'E' ) , " alloyAdvanced " , Character . valueOf ( 'o' ) , " ingot " + s , Character . valueOf ( 'T' ) , MekanismItems . EnergyTablet . getUnchargedItem ( ) , Character . valueOf ( 'B' ) , MekanismUtils . getEnergyCube ( Tier . EnergyCubeTier . BASIC )
} ) ) ;
//Gas Tank Recipes
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( MekanismUtils . getEmptyGasTank ( Tier . GasTankTier . BASIC ) , new Object [ ] {
" APA " , " P P " , " APA " , Character . valueOf ( 'P' ) , " ingot " + s , Character . valueOf ( 'A' ) , " alloyBasic "
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( MekanismUtils . getEmptyGasTank ( Tier . GasTankTier . ADVANCED ) , new Object [ ] {
" APA " , " PTP " , " APA " , Character . valueOf ( 'P' ) , " ingot " + s , Character . valueOf ( 'A' ) , " alloyAdvanced " , Character . valueOf ( 'T' ) , MekanismUtils . getEmptyGasTank ( Tier . GasTankTier . BASIC )
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( MekanismUtils . getEmptyGasTank ( Tier . GasTankTier . ELITE ) , new Object [ ] {
" APA " , " PTP " , " APA " , Character . valueOf ( 'P' ) , " ingot " + s , Character . valueOf ( 'A' ) , " alloyElite " , Character . valueOf ( 'T' ) , MekanismUtils . getEmptyGasTank ( Tier . GasTankTier . ADVANCED )
} ) ) ;
CraftingManager . getInstance ( ) . getRecipeList ( ) . add ( new ShapedMekanismRecipe ( MekanismUtils . getEmptyGasTank ( Tier . GasTankTier . ULTIMATE ) , new Object [ ] {
" APA " , " PTP " , " APA " , Character . valueOf ( 'P' ) , " ingot " + s , Character . valueOf ( 'A' ) , " alloyUltimate " , Character . valueOf ( 'T' ) , MekanismUtils . getEmptyGasTank ( Tier . GasTankTier . ELITE )
} ) ) ;
for ( ItemStack ore : OreDictionary . getOres ( " ingot " + s ) ) {
RecipeHandler . addMetallurgicInfuserRecipe ( InfuseRegistry . get ( " REDSTONE " ) , 10 , StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . ControlCircuit , 1 , 0 ) ) ;
}
}
}
2022-09-08 15:48:38 +02:00
for ( String s : minorCompat ) {
for ( ItemStack ore : OreDictionary . getOres ( " ore " + s ) ) {
2015-03-18 01:22:15 +01:00
try {
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " dust " + s ) . get ( 0 ) , 2 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2015-03-18 01:22:15 +01:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " ingot " + s ) ) {
2015-03-18 01:22:15 +01:00
try {
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " dust " + s ) . get ( 0 ) , 1 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2015-03-18 01:22:15 +01:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " dust " + s ) ) {
2015-03-18 01:22:15 +01:00
try {
RecipeHandler . addCombinerRecipe ( StackUtils . size ( ore , 8 ) , StackUtils . size ( OreDictionary . getOres ( " ore " + s ) . get ( 0 ) , 1 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2015-03-18 01:22:15 +01:00
}
2014-01-18 17:26:24 +01:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " oreYellorite " ) ) {
2014-03-07 16:46:43 +01:00
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " dustYellorium " ) . get ( 0 ) , 2 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2014-03-07 16:46:43 +01:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " oreCertusQuartz " ) ) {
2014-07-14 23:14:32 +02:00
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " dustCertusQuartz " ) . get ( 0 ) , 4 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2014-07-14 23:14:32 +02:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " crystalCertusQuartz " ) ) {
2014-07-14 23:14:32 +02:00
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " dustCertusQuartz " ) . get ( 0 ) , 1 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2014-07-14 23:14:32 +02:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " dustCertusQuartz " ) ) {
2014-07-14 23:14:32 +02:00
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " crystalCertusQuartz " ) . get ( 0 ) , 1 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2014-07-14 23:14:32 +02:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " gemQuartz " ) ) {
2014-07-14 23:14:32 +02:00
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " dustNetherQuartz " ) . get ( 0 ) , 1 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2014-07-14 23:14:32 +02:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " dustNetherQuartz " ) ) {
2014-07-14 23:14:32 +02:00
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " gemQuartz " ) . get ( 0 ) , 1 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2014-07-14 23:14:32 +02:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " oreQuartz " ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( Items . quartz , 6 ) ) ;
2014-07-14 23:14:32 +02:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " crystalFluix " ) ) {
2014-08-31 07:34:53 +02:00
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " dustFluix " ) . get ( 0 ) , 1 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2014-08-31 07:34:53 +02:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " dustFluix " ) ) {
2014-08-31 07:34:53 +02:00
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " crystalFluix " ) . get ( 0 ) , 1 ) ) ;
2022-09-08 15:48:38 +02:00
} catch ( Exception e ) {
}
2014-08-31 07:34:53 +02:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " ingotCopper " ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addMetallurgicInfuserRecipe ( InfuseRegistry . get ( " TIN " ) , 10 , StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . Ingot , 1 , 2 ) ) ;
2013-12-24 17:55:40 +01:00
}
2022-09-08 15:48:38 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " ingotRefinedObsidian " ) ) {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . OtherDust , 1 , 6 ) ) ;
2013-12-24 17:55:40 +01:00
}
for ( ItemStack ore : OreDictionary . getOres ( " ingotRedstone " ) )
{
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( Items . redstone ) ) ;
2013-12-24 17:55:40 +01:00
}
for ( ItemStack ore : OreDictionary . getOres ( " ingotRefinedGlowstone " ) )
{
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( Items . glowstone_dust ) ) ;
2014-01-18 17:26:24 +01:00
}
2013-12-24 17:55:40 +01:00
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( new ItemStack ( MekanismItems . Ingot , 1 , 2 ) , StackUtils . size ( OreDictionary . getOres ( " dustBronze " ) . get ( 0 ) , 1 ) ) ;
2013-12-24 17:55:40 +01:00
2014-10-02 19:13:19 +02:00
if ( Mekanism . hooks . IC2Loaded )
2013-12-24 17:55:40 +01:00
{
2014-06-26 02:10:53 +02:00
addIC2BronzeRecipe ( ) ;
2013-12-24 17:55:40 +01:00
}
} catch ( Exception e ) { }
try {
2015-03-18 01:22:15 +01:00
FurnaceRecipes . smelting ( ) . func_151394_a ( new ItemStack ( MekanismItems . Dust , 1 , Resource . SILVER . ordinal ( ) ) , StackUtils . size ( OreDictionary . getOres ( " ingotSilver " ) . get ( 0 ) , 1 ) , 0 . 0F ) ;
2013-12-24 17:55:40 +01:00
} catch ( Exception e ) { }
try {
2015-03-18 01:22:15 +01:00
FurnaceRecipes . smelting ( ) . func_151394_a ( new ItemStack ( MekanismItems . Dust , 1 , Resource . LEAD . ordinal ( ) ) , StackUtils . size ( OreDictionary . getOres ( " ingotLead " ) . get ( 0 ) , 1 ) , 0 . 0F ) ;
2013-12-24 17:55:40 +01:00
} catch ( Exception e ) { }
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( new ItemStack ( Items . coal ) , StackUtils . size ( OreDictionary . getOres ( " dustCoal " ) . get ( 0 ) , 1 ) ) ;
2013-12-24 17:55:40 +01:00
} catch ( Exception e ) { }
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( new ItemStack ( Items . coal , 1 , 1 ) , StackUtils . size ( OreDictionary . getOres ( " dustCharcoal " ) . get ( 0 ) , 1 ) ) ;
2013-12-24 17:55:40 +01:00
} catch ( Exception e ) { }
2015-02-24 16:32:41 +01:00
try {
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( new ItemStack ( Items . gunpowder ) , StackUtils . size ( OreDictionary . getOres ( " dustSaltpeter " ) . get ( 0 ) , 1 ) ) ;
2015-02-24 16:32:41 +01:00
} catch ( Exception e ) { }
2016-07-06 23:34:29 +02:00
for ( ItemStack ore : OreDictionary . getOres ( " sand " ) )
{
try {
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , StackUtils . size ( OreDictionary . getOres ( " itemSilicon " ) . get ( 0 ) , 1 ) ) ;
} catch ( Exception e ) { }
}
2015-02-24 16:32:41 +01:00
for ( ItemStack ore : OreDictionary . getOres ( " dustSaltpeter " ) )
{
2015-03-18 01:22:15 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( Items . gunpowder ) ) ;
2013-12-24 17:55:40 +01:00
}
for ( ItemStack ore : OreDictionary . getOres ( " ingotSteel " ) )
{
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . OtherDust , 1 , 1 ) ) ;
2013-12-24 17:55:40 +01:00
}
2015-02-24 16:32:41 +01:00
for ( ItemStack ore : OreDictionary . getOres ( " dustLapis " ) )
2013-12-24 17:55:40 +01:00
{
2015-03-18 01:22:15 +01:00
RecipeHandler . addCrusherRecipe ( new ItemStack ( Items . dye , 1 , 4 ) , StackUtils . size ( ore , 1 ) ) ;
2013-12-24 17:55:40 +01:00
}
2015-02-25 15:03:14 +01:00
for ( ItemStack ore : OreDictionary . getOres ( " dustLithium " ) )
{
2015-03-18 01:22:15 +01:00
RecipeHandler . addChemicalOxidizerRecipe ( StackUtils . size ( ore , 1 ) , new GasStack ( GasRegistry . getGas ( " lithium " ) , 100 ) ) ;
2015-02-25 15:03:14 +01:00
}
2013-12-24 17:55:40 +01:00
for ( ItemStack ore : OreDictionary . getOres ( " dustObsidian " ) )
{
2015-03-18 01:22:15 +01:00
RecipeHandler . addCombinerRecipe ( StackUtils . size ( ore , 4 ) , new ItemStack ( Blocks . obsidian ) ) ;
RecipeHandler . addMetallurgicInfuserRecipe ( InfuseRegistry . get ( " DIAMOND " ) , 10 , StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . OtherDust , 1 , 5 ) ) ;
2013-12-24 17:55:40 +01:00
}
for ( ItemStack ore : OreDictionary . getOres ( " dustDiamond " ) )
{
2014-07-10 05:52:01 +02:00
InfuseRegistry . registerInfuseObject ( ore , new InfuseObject ( InfuseRegistry . get ( " DIAMOND " ) , 10 ) ) ;
2015-03-18 01:22:15 +01:00
RecipeHandler . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( Items . diamond ) ) ;
2013-12-24 17:55:40 +01:00
}
for ( ItemStack ore : OreDictionary . getOres ( " dustTin " ) )
{
InfuseRegistry . registerInfuseObject ( ore , new InfuseObject ( InfuseRegistry . get ( " TIN " ) , 50 ) ) ;
}
2014-04-06 02:16:09 +02:00
try {
for ( ItemStack ore : OreDictionary . getOres ( " treeSapling " ) )
{
if ( ore . getItemDamage ( ) = = 0 | | ore . getItemDamage ( ) = = OreDictionary . WILDCARD_VALUE )
{
2014-08-01 01:58:12 +02:00
RecipeHandler . addCrusherRecipe ( new ItemStack ( ore . getItem ( ) , 1 , OreDictionary . WILDCARD_VALUE ) , new ItemStack ( MekanismItems . BioFuel , 2 ) ) ;
2014-04-06 02:16:09 +02:00
}
}
} catch ( Exception e ) { }
2013-12-24 17:55:40 +01:00
}
2014-01-14 03:43:36 +01:00
2014-10-02 19:13:19 +02:00
@Method ( modid = " IC2 " )
2014-06-26 02:10:53 +02:00
public static void addIC2BronzeRecipe ( )
{
2014-08-23 17:07:03 +02:00
try {
2015-03-18 01:22:15 +01:00
Recipes . macerator . addRecipe ( new RecipeInputOreDict ( " ingotBronze " ) , null , StackUtils . size ( OreDictionary . getOres ( " dustBronze " ) . get ( 0 ) , 1 ) ) ;
2014-08-23 17:07:03 +02:00
} catch ( Exception e ) { }
2014-06-26 02:10:53 +02:00
}
2014-01-14 03:43:36 +01:00
/ * *
2014-08-23 21:46:13 +02:00
* Handy method for retrieving all log items , finding their corresponding planks , and making recipes with them . Credit to CofhCore .
2014-01-14 03:43:36 +01:00
* /
public static void addLogRecipes ( )
{
Container tempContainer = new Container ( ) {
2015-03-18 00:16:36 +01:00
@Override
2014-01-14 03:43:36 +01:00
public boolean canInteractWith ( EntityPlayer player )
{
return false ;
}
} ;
InventoryCrafting tempCrafting = new InventoryCrafting ( tempContainer , 3 , 3 ) ;
ArrayList recipeList = ( ArrayList ) CraftingManager . getInstance ( ) . getRecipeList ( ) ;
for ( int i = 1 ; i < 9 ; i + + )
{
tempCrafting . setInventorySlotContents ( i , null ) ;
}
ArrayList registeredOres = OreDictionary . getOres ( " logWood " ) ;
for ( int i = 0 ; i < registeredOres . size ( ) ; i + + )
{
ItemStack logEntry = ( ItemStack ) registeredOres . get ( i ) ;
if ( logEntry . getItemDamage ( ) = = OreDictionary . WILDCARD_VALUE )
{
for ( int j = 0 ; j < 16 ; j + + )
{
2014-05-29 20:01:43 +02:00
ItemStack log = new ItemStack ( logEntry . getItem ( ) , 1 , j ) ;
2014-01-14 03:43:36 +01:00
tempCrafting . setInventorySlotContents ( 0 , log ) ;
ItemStack resultEntry = MekanismUtils . findMatchingRecipe ( tempCrafting , null ) ;
if ( resultEntry ! = null )
{
2014-09-04 05:26:55 +02:00
RecipeHandler . addPrecisionSawmillRecipe ( log , StackUtils . size ( resultEntry , 6 ) , new ItemStack ( MekanismItems . Sawdust ) , 1 ) ;
2014-01-14 03:43:36 +01:00
}
}
}
else {
ItemStack log = StackUtils . size ( logEntry , 1 ) ;
tempCrafting . setInventorySlotContents ( 0 , log ) ;
ItemStack resultEntry = MekanismUtils . findMatchingRecipe ( tempCrafting , null ) ;
if ( resultEntry ! = null )
{
2014-09-04 05:26:55 +02:00
RecipeHandler . addPrecisionSawmillRecipe ( log , StackUtils . size ( resultEntry , 6 ) , new ItemStack ( MekanismItems . Sawdust ) , 1 ) ;
2014-01-14 03:43:36 +01:00
}
}
}
}
2022-09-04 14:06:37 +02:00
public static void terralizationcompat ( ) {
if ( MekanismConfig . general . EnableQuartzCompat ) {
// Enrich quartz dust into quartz
for ( ItemStack ore : OreDictionary . getOres ( " dustQuartz " ) ) {
RecipeHelper . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( Items . quartz ) ) ;
}
for ( ItemStack ore : OreDictionary . getOres ( " dustNetherQuartz " ) ) {
RecipeHelper . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( Items . quartz ) ) ;
}
// Enrich quartz ore into 2 quartz dust
for ( ItemStack ore : OreDictionary . getOres ( " dustQuartz " ) ) {
RecipeHelper . addEnrichmentChamberRecipe ( new ItemStack ( Blocks . quartz_ore ) , StackUtils . size ( ore , 2 ) ) ;
}
for ( ItemStack ore : OreDictionary . getOres ( " dustNetherQuartz " ) ) {
RecipeHelper . addEnrichmentChamberRecipe ( new ItemStack ( Blocks . quartz_ore ) , StackUtils . size ( ore , 2 ) ) ;
}
}
// Add gemdiamond oredict for compressed diamond
if ( MekanismConfig . general . EnableDiamondCompat ) {
for ( ItemStack ore : OreDictionary . getOres ( " gemDiamond " ) ) {
InfuseRegistry . registerInfuseObject ( ore , new InfuseObject ( InfuseRegistry . get ( " DIAMOND " ) , 10 ) ) ;
2022-09-04 14:10:52 +02:00
RecipeHelper . addEnrichmentChamberRecipe ( StackUtils . size ( ore , 1 ) , new ItemStack ( MekanismItems . CompressedDiamond ) ) ;
2022-09-04 14:06:37 +02:00
}
}
if ( MekanismConfig . general . EnablePoorOresCompat ) {
for ( ItemStack ore : OreDictionary . getOres ( " orePoorIron " ) ) {
for ( ItemStack ore2 : OreDictionary . getOres ( " clumpIron " ) ) {
RecipeHelper . addPurificationChamberRecipe ( ore , ore2 ) ;
}
}
for ( ItemStack ore : OreDictionary . getOres ( " orePoorGold " ) ) {
for ( ItemStack ore2 : OreDictionary . getOres ( " clumpGold " ) ) {
RecipeHelper . addPurificationChamberRecipe ( ore , ore2 ) ;
}
}
for ( ItemStack ore : OreDictionary . getOres ( " orePoorCopper " ) ) {
for ( ItemStack ore2 : OreDictionary . getOres ( " clumpCopper " ) ) {
RecipeHelper . addPurificationChamberRecipe ( ore , ore2 ) ;
}
}
for ( ItemStack ore : OreDictionary . getOres ( " orePoorTin " ) ) {
for ( ItemStack ore2 : OreDictionary . getOres ( " clumpTin " ) ) {
RecipeHelper . addPurificationChamberRecipe ( ore , ore2 ) ;
}
}
for ( ItemStack ore : OreDictionary . getOres ( " orePoorLead " ) ) {
for ( ItemStack ore2 : OreDictionary . getOres ( " clumpLead " ) ) {
RecipeHelper . addPurificationChamberRecipe ( ore , ore2 ) ;
}
}
}
}
2013-12-24 17:55:40 +01:00
}