{"action":"created","issue":{"url":"https://api.github.com/repos/aidancbrady/Mekanism/issues/3673","repository_url":"https://api.github.com/repos/aidancbrady/Mekanism","labels_url":"https://api.github.com/repos/aidancbrady/Mekanism/issues/3673/labels{/name}","comments_url":"https://api.github.com/repos/aidancbrady/Mekanism/issues/3673/comments","events_url":"https://api.github.com/repos/aidancbrady/Mekanism/issues/3673/events","html_url":"https://github.com/aidancbrady/Mekanism/issues/3673","id":172184664,"number":3673,"title":"Adding Energized Smelter recipe","user":{"login":"TitaniumSapphire","id":7462892,"avatar_url":"https://avatars.githubusercontent.com/u/7462892?v=3","gravatar_id":"","url":"https://api.github.com/users/TitaniumSapphire","html_url":"https://github.com/TitaniumSapphire","followers_url":"https://api.github.com/users/TitaniumSapphire/followers","following_url":"https://api.github.com/users/TitaniumSapphire/following{/other_user}","gists_url":"https://api.github.com/users/TitaniumSapphire/gists{/gist_id}","starred_url":"https://api.github.com/users/TitaniumSapphire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TitaniumSapphire/subscriptions","organizations_url":"https://api.github.com/users/TitaniumSapphire/orgs","repos_url":"https://api.github.com/users/TitaniumSapphire/repos","events_url":"https://api.github.com/users/TitaniumSapphire/events{/privacy}","received_events_url":"https://api.github.com/users/TitaniumSapphire/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-19T17:50:47Z","updated_at":"2016-08-19T19:20:58Z","closed_at":"2016-08-19T19:20:58Z","body":"Hi,\r\n\r\nWith the Mekanism API, there seems to be no way to add Energized Smelter recipes using the RecipeHelper class. I attempted to write a method to do this using Java's reflection:\r\n\r\n    private static void addEnergizedSmelterRecipe(ItemStack input, ItemStack output) {\r\n\t\ttry {\r\n\t\t\tClass<?> itemInput = Class.forName(\"mekanism.common.recipe.input.ItemStackInput\");\r\n\t\t\tClass<?> itemOutput = Class.forName(\"mekanism.common.recipe.output.ItemStackOutput\");\r\n\t\t\tClass<?> recipeEnum = Class.forName(\"mekanism.common.recipe.RecipeHandler.Recipe\");\r\n\t\t\tClass<?> machineClass = Class.forName(\"mekanism.common.recipe.machines.MachineRecipe\");\r\n\t\t\tClass<?> recipeClass = Class.forName(\"mekanism.common.recipe.RecipeHandler\");\r\n\t\t\tClass<?> smeltingClass = Class.forName(\"mekanism.common.recipe.machines.SmeltingRecipe\");\r\n\r\n\t\t\tConstructor<?> inputConstructor = itemInput.getConstructor(ItemStack.class);\r\n\t\t\tConstructor<?> outputContructor = itemOutput.getConstructor(ItemStack.class);\r\n\t\t\tConstructor<?> smeltingConstructor = smeltingClass.getConstructor(itemInput, itemOutput);\r\n\r\n\t\t\tObject inputInstance = inputConstructor.newInstance(input);\r\n\t\t\tObject outputInstance = outputContructor.newInstance(output);\r\n\t\t\tObject smeltingInstance = smeltingConstructor.newInstance(inputInstance, outputInstance);\r\n\r\n\t\t\tMethod m = recipeClass.getMethod(\"addRecipe\", recipeEnum, machineClass);\r\n\t\t\tm.invoke(null, recipeEnum.getField(\"ENERGIZED_SMELTER\").get(null), smeltingInstance);\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.err.println(\"[Mekanism] Error while adding recipe: \" + e.getClass() + \": \" + e.getMessage());\r\n\t\t}\r\n\t}\r\n\r\nBut this causes an exception, which is caught and printed out as:\r\n`[Mekanism] Error while adding recipe: class java.lang.ClassNotFoundException: mekanism.common.recipe.input.ItemStackInput`\r\n\r\n(P.S. my mod is forced to load after Mekanism)\r\n\r\nWhat is the recommended way to add energized smelter recipes/way to fix this problem?"},"comment":{"url":"https://api.github.com/repos/aidancbrady/Mekanism/issues/comments/241111203","html_url":"https://github.com/aidancbrady/Mekanism/issues/3673#issuecomment-241111203","issue_url":"https://api.github.com/repos/aidancbrady/Mekanism/issues/3673","id":241111203,"user":{"login":"TitaniumSapphire","id":7462892,"avatar_url":"https://avatars.githubusercontent.com/u/7462892?v=3","gravatar_id":"","url":"https://api.github.com/users/TitaniumSapphire","html_url":"https://github.com/TitaniumSapphire","followers_url":"https://api.github.com/users/TitaniumSapphire/followers","following_url":"https://api.github.com/users/TitaniumSapphire/following{/other_user}","gists_url":"https://api.github.com/users/TitaniumSapphire/gists{/gist_id}","starred_url":"https://api.github.com/users/TitaniumSapphire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TitaniumSapphire/subscriptions","organizations_url":"https://api.github.com/users/TitaniumSapphire/orgs","repos_url":"https://api.github.com/users/TitaniumSapphire/repos","events_url":"https://api.github.com/users/TitaniumSapphire/events{/privacy}","received_events_url":"https://api.github.com/users/TitaniumSapphire/received_events","type":"User","site_admin":false},"created_at":"2016-08-19T19:20:58Z","updated_at":"2016-08-19T19:20:58Z","body":"Okay, it took several hours, but I fixed the problem. I had the packages wrong for ItemStackInput/ItemStackOutput. Also, `Class.forName(\"mekanism.common.recipe.RecipeHandler.Recipe\")` is not the correct way to get a static subclass. It would be, rather, `Class.forName(\"mekanism.common.recipe.RecipeHandler$Recipe\")`."}}
{"actor":{"display_login":"TitaniumSapphire"}}