diff options
| author | Alkalus <draknyte1@hotmail.com> | 2017-11-06 08:53:54 +1000 | 
|---|---|---|
| committer | Alkalus <draknyte1@hotmail.com> | 2017-11-06 08:53:54 +1000 | 
| commit | 60e6c5ae87f7b160d97f2a841d74efa932626602 (patch) | |
| tree | c795da8fd35f9d61cc9d48452809755be81a2340 /src | |
| parent | 453a3361a3998ea6d4f95e7ab6f2dd4738440d11 (diff) | |
| download | GT5-Unofficial-60e6c5ae87f7b160d97f2a841d74efa932626602.tar.gz GT5-Unofficial-60e6c5ae87f7b160d97f2a841d74efa932626602.tar.bz2 GT5-Unofficial-60e6c5ae87f7b160d97f2a841d74efa932626602.zip | |
$ Fixed a small recipe removal error, Mek recipes should now be removed as intended.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java | 47 | 
1 files changed, 28 insertions, 19 deletions
| diff --git a/src/Java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java b/src/Java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java index 607e0bc2fe..ce54ca024e 100644 --- a/src/Java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java +++ b/src/Java/gtPlusPlus/xmod/mekanism/HANDLER_Mekanism.java @@ -28,6 +28,9 @@ public class HANDLER_Mekanism {  	public static void postInit(){  		if (LoadedMods.Mekanism){ +			 +			Utils.LOG_INFO("Performing GT recipe balance for Mek. now that it's Osmium is useless."); +			  			//Steel Casing  			ItemStack tSteelCasing = ItemUtils.simpleMetaStack("Mekanism:BasicBlock:8", 8, 1);  			addNewRecipe( @@ -41,7 +44,7 @@ public class HANDLER_Mekanism {  			NBTUtils.setString(tAdvancedEnergyCube, "tier", "Advanced");  			ItemStack tBasicEnergyCube = ItemUtils.simpleMetaStack("Mekanism:EnergyCube", 0, 1);  			NBTUtils.setString(tBasicEnergyCube, "tier", "Basic"); -			 +  			//Gas tanks  			ItemStack tBasicGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1);  			NBTUtils.setInteger(tBasicGasTank, "tier", 0); @@ -51,7 +54,7 @@ public class HANDLER_Mekanism {  			NBTUtils.setInteger(tEliteGasTank, "tier", 2);  			ItemStack tMasterGasTank = ItemUtils.simpleMetaStack("Mekanism:GasTank", 0, 1);  			NBTUtils.setInteger(tMasterGasTank, "tier", 3); -			 +  			//Machines that use Osmium  			ItemStack tMachineBlock_Basic = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:5", 5, 1);  			ItemStack tMachineBlock = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:6", 6, 1); @@ -96,26 +99,26 @@ public class HANDLER_Mekanism {  			NBTUtils.setInteger(tMachineBlock_7_Basic, "recipeType", 7);  			ItemStack tMachineBlock_7 = tMachineBlock;  			NBTUtils.setInteger(tMachineBlock_7, "recipeType", 7); -			 +  			//Infuser  			ItemStack tMachineBlock_8 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:8", 8, 1);  			//Purification  			ItemStack tMachineBlock_9 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:9", 9, 1);  			//Pump  			ItemStack tMachineBlock_12 = ItemUtils.simpleMetaStack("Mekanism:MachineBlock:12", 12, 1); -			 +  			//<Mekanism:ElectrolyticCore>  			ItemStack tItem_1 = ItemUtils.simpleMetaStack("Mekanism:ElectrolyticCore", 0, 1);  			//<Mekanism:FactoryInstaller:1>  			ItemStack tItem_2 = ItemUtils.simpleMetaStack("Mekanism:FactoryInstaller:1", 1, 1);  			//<Mekanism:SpeedUpgrade>  			ItemStack tItem_3 = ItemUtils.simpleMetaStack("Mekanism:SpeedUpgrade", 0, 1); -			 +  			//MiscItems  			String tAdvancedAlloy = "alloyAdvanced";  			String tCircuitAdvanced = "circuitAdvanced";  			ItemStack tMekBatterySimple = ItemUtils.simpleMetaStack("Mekanism:EnergyTablet", 0, 1); -			 +  			//Items  			addNewRecipe(  					tAdvancedAlloy, "plateTitanium", tAdvancedAlloy,  @@ -132,14 +135,14 @@ public class HANDLER_Mekanism {  					tAdvancedAlloy, "plateTungsten", tAdvancedAlloy,   					null, "blockGlass", null,   					tItem_3); -			 +  			//Power Storage  			addNewRecipe(  					tAdvancedAlloy, tMekBatterySimple, tAdvancedAlloy,   					"plateAluminium", tBasicEnergyCube, "plateAluminium",   					tAdvancedAlloy, tMekBatterySimple, tAdvancedAlloy,   					tAdvancedEnergyCube); -			 +  			//Blocks  			addNewRecipe(  					"plateSteel", "craftingFurnace", "plateSteel",  @@ -156,7 +159,7 @@ public class HANDLER_Mekanism {  					tAdvancedAlloy, tSteelCasing, tAdvancedAlloy,   					"plateStainlessSteel", "plateStainlessSteel", "plateStainlessSteel",   					tMachineBlock_12); -			 +  			//Machines  			addNewRecipe(  					tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,  @@ -198,7 +201,7 @@ public class HANDLER_Mekanism {  					"plateStainlessSteel", tMachineBlock_7_Basic, "plateStainlessSteel",   					tAdvancedAlloy, tCircuitAdvanced, tAdvancedAlloy,    					tMachineBlock_7);	 -			 +  			//Gas Tanks  			addNewRecipe(  					"plateRedstone", "plateAluminium", "plateRedstone", @@ -222,22 +225,27 @@ public class HANDLER_Mekanism {  					tMasterGasTank);			  		}  	} -	 +  	private static boolean addNewRecipe(  			final Object InputItem1, final Object InputItem2, final Object InputItem3,  			final Object InputItem4, final Object InputItem5, final Object InputItem6,  			final Object InputItem7, final Object InputItem8, final Object InputItem9,  			final ItemStack OutputItem){ -		 -		if (removeRecipe(OutputItem)){ + +		/*if (removeRecipe(OutputItem)){  			return RecipeUtils.recipeBuilder(  					InputItem1, InputItem2, InputItem3,   					InputItem4, InputItem5, InputItem6,   					InputItem7, InputItem8, InputItem9,   					OutputItem); -		} -		return false; -		 +		}*/ + +		removeRecipe(OutputItem); +		return RecipeUtils.recipeBuilder( +				InputItem1, InputItem2, InputItem3,  +				InputItem4, InputItem5, InputItem6,  +				InputItem7, InputItem8, InputItem9,  +				OutputItem);  	}  	private static boolean removeRecipe(ItemStack item){ @@ -248,9 +256,9 @@ public class HANDLER_Mekanism {  			if (mekUtils != null){  				Method mRemoveRecipe = mekUtils.getDeclaredMethod("removeRecipes", ItemStack.class);  				if (mRemoveRecipe != null){ -					removed = (boolean) mRemoveRecipe.invoke(mekUtils, ItemUtils.simpleMetaStack("Mekanism:BasicBlock:8", 8, 1)); +					removed = (boolean) mRemoveRecipe.invoke(null, item);  					if (!removed) { -						removed = (boolean) mRemoveRecipe.invoke(null, ItemUtils.simpleMetaStack("Mekanism:BasicBlock:8", 8, 1)); +						removed = (boolean) mRemoveRecipe.invoke(mekUtils, item);  					}  				}  			}		 @@ -258,8 +266,9 @@ public class HANDLER_Mekanism {  			Utils.LOG_INFO("[Mek] Failed to use the built-in recipe remover from Mekanism.");  		}  		if (!removed){ -			removed = GT_ModHandler.removeRecipeByOutput(ItemUtils.simpleMetaStack("Mekanism:BasicBlock:8", 8, 1)); +			removed = GT_ModHandler.removeRecipeByOutput(item);  		} +		Utils.LOG_INFO("[Mek] Successfully removed the recipe for "+item.getDisplayName()+".");  		return removed;  	} | 
