Posted November 22, 20177 yr Good day fellow Modders, after some succesfull days of coding, I have run into a new problem: For my new Mod, I have created ores using variants, meaning I haven't initialized every specific ore from a basic ore-class. I just initialized a ore for the overworld and nether. The specific ores are then generated using variants. This works perfectly, the problem is about the smelting: the addSmelting method (for block) needs a block input. I have no idea how I can correctly specify my ore variant inside the method, so that it gets accepted. Maybe using the getBlockbyID method?
November 22, 20177 yr Author Case closed, after 13(250ml) cups of coffee I realised, that I can use the .getBlock() to after the reference, to "convert" from BlockState to Block
November 22, 20177 yr Author REWIND! Well, I'm now able to successfully reference my variant and Eclipse doesnt show any errors, but inGame it still doesnt work. So far I have been using the addSmelting() of the GameRegistry. FurnaceRecipes::addSmeltingRecipe(ItemStack, ItemStack, float) doesnt work
November 22, 20177 yr Show more of your code. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
November 22, 20177 yr Author Here is an example: GameRegistry.addSmelting(BlockInit.ore_world.getDefaultState().withProperty(BlockOres.VARIANT, EnumHandler.EnumType.tin).getBlock(), new ItemStack(ItemInit.tiningot), 1.0f);
November 22, 20177 yr 18 minutes ago, TestBaker said: Here is an example: GameRegistry.addSmelting(BlockInit.ore_world.getDefaultState().withProperty(BlockOres.VARIANT, EnumHandler.EnumType.tin).getBlock(), new ItemStack(ItemInit.tiningot), 1.0f); withVariant() and getBlock() are counter to each other. withVariant() defines which variant (and thus metadata) to use. getBlock() strips metadata information. If you want to register a variant block as a recipe, you need to get the item stack of that variant. Presumably you have a getDrops() or getPickBlock() method overridden in your block class that will do that. Also, this button is for inline code: Edited November 22, 20177 yr by Draco18s Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
November 22, 20177 yr Author 13 minutes ago, Draco18s said: withVariant() and getBlock() are counter to each other. withVariant() defines which variant (and thus metadata) to use. getBlock() strips metadata information. If you want to register a variant block as a recipe, you need to get the item stack of that variant. Presumably you have a getDrops() or getPickBlock() method overridden in your block class that will do that. Also, this button is for inline code: Thank you for the answer and explanation. I'll try it my getPickBlock() method of the base class and report in later.
November 23, 20177 yr Author After multiple tries I started using vanilla items to see if the problem is with the registration. Have a look at it: vanilla in- and output, written directly inside the Init of the Main class. It doesn't work.
November 23, 20177 yr Author 3 minutes ago, TestBaker said: After multiple tries I started using vanilla items to see if the problem is with the registration. Have a look at it: vanilla in- and output, written directly inside the Init of the Main class. It doesn't work. Well, seppuku is the only way to go for me now... I realized, that I forgot the EventHandler for Init...
November 23, 20177 yr Author Case closed. Thank u for the help. The only problem was the missing @EventHandler over Init. @Draco18sgetBlock() doesn't strip of the metadata, it works perfectly fine now .
November 23, 20177 yr 3 hours ago, TestBaker said: Case closed. Thank u for the help. The only problem was the missing @EventHandler over Init. @Draco18sgetBlock() doesn't strip of the metadata, it works perfectly fine now . If it doesn't, then why does IBlockState exist? And why would getStateFromMeta exist? Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
November 30, 20177 yr After creating my own thread and looking through this one, I still have not figured out a clear answer to my problem. NO matter what I do with the code I cant give my separate Block Ore Variants smelting recipes that work. I just need an example that works because I cant get it to work despite my numerous hours of research and attempts. Edited November 30, 20177 yr by landocchi
November 30, 20177 yr Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.