From e0bf1b737366a126e694c2a1112177642d19d6e3 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sun, 11 Jan 2015 12:10:56 +0800 Subject: [PATCH] Fixed copper and tin ingot generation --- .../resonantinduction/models/glassJar.png | Bin 0 -> 3594 bytes .../core/resource/AutoResourceFactory.scala | 51 ++++++++++-------- 2 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 src/main/resources/assets/resonantinduction/models/glassJar.png diff --git a/src/main/resources/assets/resonantinduction/models/glassJar.png b/src/main/resources/assets/resonantinduction/models/glassJar.png new file mode 100644 index 0000000000000000000000000000000000000000..368a6787b3d70cad0ab0e335b327a90b0951a1c2 GIT binary patch literal 3594 zcma)72~d;Q7XDdUlq%Zt-UF>95o$#(B&)ok&l0CK+v<(^DCcHvnMp=?qe03Ym>KLOw>NVeMxc zWcCPZ64pN2BNP?N@F!EKK^aVPRK@{fVn#}$Pm(I7Lhv3N8#Dcy<2a(IRiKxQQ}sSGxiPD2pk$t*gDnFuxRsDm*S1MSZwlh|}7 zkxoDUtcu|jI-Aa-&>0B-C{KiAG?kV_=dyM@u@4PJ2h&(=5-pJ&9Ducl5S*#hB(%4y z`yQ0Pmrvl{y-?Nny85{Jd;0i$dU$xdd+c%X3w-7qKu_ePl4@Qa>Um1v2TWh$ktdsjGAGS{3i9Z_?^qyjS%_LS&G}#{R9*&yFDV7`M-53w=Bn zKA8rooe9bMV3=Dp09Xox1N?~TiYa9mb12Bpf>9HAZ^1XFOi}c?z~lhN^1~q?#>n^H z%;B4-YzD3Am$&Trspg+xl$R8L?`Fu9VQ@Uj?OI`2f7>-|Z_wt_rAw!U6?3^F0hm?! zM@PO_&Hd^7_e&JGb^i0)ly~lUIu%AHD-3B{@_#|1n~T3o&g`sHG!GvCAt$WbP$uB= zFYSJKU8Oe^+5z~6J6nynAJ_<8+ZPrw%OimEFhY_!GBHuEfHjGT+u`!Md4Z~06p=}^ zkSS^T{qPP429Gz$=1a8{@GAT=Dadfv#1?`v2LN9P@WrLz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8l|~+N2QmiotT(YJ62b~wI04+C761@ZT7cEKFVGS_$@CB zNOuGpMIui3;fsU@Fsr_5T*upT$?lfBMmat^PO&Szvv|7BOqeX@Ei?#{-`cq7{_tFL zVr7?pK4P-%XVYsP4!3KC2kS;|^qkdJiTYhkhQBu#7Ydih*Xqa6rr|g%%fd{WZZ1Ye zgsrvR=GAnYe?pRT?Y)Atdv5sImIYjxP5;b0gN(z@jbF*ZSAgKcqxhn|L6nvc<+IL$~_66{2v5&NO1rF literal 0 HcmV?d00001 diff --git a/src/main/scala/resonantinduction/core/resource/AutoResourceFactory.scala b/src/main/scala/resonantinduction/core/resource/AutoResourceFactory.scala index 79111b282..9ed2bba83 100644 --- a/src/main/scala/resonantinduction/core/resource/AutoResourceFactory.scala +++ b/src/main/scala/resonantinduction/core/resource/AutoResourceFactory.scala @@ -50,9 +50,6 @@ object AutoResourceFactory def init() { - //Add vanilla ores - registerMaterial("gold") - registerMaterial("iron") //Register resource types ResourceFactory.registerResourceItem("rubble", classOf[ItemRubble]) @@ -68,35 +65,28 @@ object AutoResourceFactory ResourceFactory.requestItem("ingot", "tin") ResourceFactory.registerMaterialColor("tin", 0xAFBFB2) - //Add vanilla ore processing recipes OreDictionary.initVanillaEntries() + + //Add vanilla ingots to auto generate + registerAutoMaterial("gold") + registerAutoMaterial("iron") + registerAutoMaterial("copper") + registerAutoMaterial("tin") + } + + def postInit() + { + //Add vanilla ore processing recipes MachineRecipes.instance.addRecipe(RecipeType.SMELTER.name, new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(Blocks.stone)) MachineRecipes.instance.addRecipe(RecipeType.CRUSHER.name, Blocks.cobblestone, Blocks.gravel) MachineRecipes.instance.addRecipe(RecipeType.CRUSHER.name, Blocks.stone, Blocks.cobblestone) MachineRecipes.instance.addRecipe(RecipeType.SAWMILL.name, Blocks.log, new ItemStack(Blocks.planks, 7, 0)) MachineRecipes.instance.addRecipe(RecipeType.GRINDER.name, Blocks.gravel, Blocks.sand) MachineRecipes.instance.addRecipe(RecipeType.GRINDER.name, Blocks.glass, Blocks.sand) - } - def registerMaterial(material: String) - { - if (!materials.contains(material) && OreDictionary.getOres("ore" + material.capitalizeFirst).size > 0) - { - Settings.config.load() - val allowMaterial = Settings.config.get("Resource-Generator", "Enable " + material, true).getBoolean(true) - Settings.config.save() - - if (allowMaterial && !blackList.contains(material)) - { - materials += material - } - } - } - - def postInit() - { //Call generate() on all materials materials.foreach(generate) + Reference.logger.fine("Resource Factory generated " + materials.size + " resources.") } @@ -157,7 +147,22 @@ object AutoResourceFactory { val oreDictName = evt.Name.replace("ingot", "") val materialName = oreDictName.decapitalizeFirst - registerMaterial(materialName) + registerAutoMaterial(materialName) + } + } + + def registerAutoMaterial(material: String) + { + if (!materials.contains(material) && OreDictionary.getOres("ore" + material.capitalizeFirst).size > 0) + { + Settings.config.load() + val allowMaterial = Settings.config.get("Resource-Generator", "Enable " + material, true).getBoolean(true) + Settings.config.save() + + if (allowMaterial && !blackList.contains(material)) + { + materials += material + } } }