Posted April 15, 201411 yr Hey guys a question here, is it possible at all to allow a custom furnace to run with for example 3 inputs 1 output, and in certain circumstances, accept 2 inputs and 1 output, i tried removing the null check in the tile entity and recipe files but it returned an error when loading up (which is understandable) but i have no idea how to do it, i thought i could find out a way by browsing how the crafting table works but there is no tile entity for it (that i found) in the folder as brewing stand furnace hopper etc anybody able to help out would be muchly appreciated (im happy to post any relevant code if needed) thanks in advance
April 15, 201411 yr Author when writing out my recipe how would i incorporate the null (is kinda my issue as well) as a regular recipe looks like this CoffeeMachineRecipes.instance().addRecipe(new ItemStack(ModItems.Whatever), new ItemStack(ModItems.Stuff), new ItemStack(ModItems.Cats), new ItemStack(ModItems.Whatever)); ive tried writing CoffeeMachineRecipes.instance().addRecipe(new ItemStack(ModItems.Whatever), null , new ItemStack(ModItems.Cats), new ItemStack(ModItems.Whatever)); also on a long shot CoffeeMachineRecipes.instance().addRecipe(new ItemStack(Blocks.air), new ItemStack(ModItems.Stuff), new ItemStack(ModItems.Cats), new ItemStack(ModItems.Whatever)); i just cant figure out how to write a recipe with a hole in it
April 15, 201411 yr Author what do you mean, ive written out a custom recipes class, would i need to modify the code here ? public void AddRecipe(ItemStack Input, ItemStack AnotherInput, ItemStack Output) { Recipes.put(Arrays.asList(Input.getItem().getIdFromItem(Input.getItem()), Input.getItemDamage(), AnotherInput.getItem().getIdFromItem(AnotherInput.getItem()), AnotherInput.getItemDamage()), Output); } public ItemStack GetResult(ItemStack item_1, ItemStack item_2, ItemStack item_3) { if(item_1 == null || item_2 == null || item_3 == null) { return null; } if(item_1.getItem() instanceof ModItemEmpty_Mug){ ItemStack result = (ItemStack)Recipes.get(Arrays.asList(item_2.getItem().getIdFromItem(item_2.getItem()), item_2.getItemDamage(), item_3.getItem().getIdFromItem(item_3.getItem()), item_3.getItemDamage())); return result; } return null; }
April 15, 201411 yr Author how can it be done more efficiently? and how would you add nulls to the list ?
April 15, 201411 yr Author do you have an example of a trove or links to documentations and i think im getting confused by what you mean when saying list? are you refering to the array in the recipes class? public void AddRecipe(ItemStack Input, ItemStack AnotherInput, ItemStack Output) { Recipes.put(Arrays.asList(Input.getItem().getIdFromItem(Input.getItem()), Input.getItemDamage(), AnotherInput.getItem().getIdFromItem(AnotherInput.getItem()), AnotherInput.getItemDamage()), Output); } or the actual implementation of the crafting recipe (CoffeeMachineRecipes.instance().AddRecipe(new ItemStack(ModItems.CoffeeBean), new ItemStack(Items.sugar), new ItemStack(ModItems.CupOfCoffee)); )
April 15, 201411 yr I've Googled trove and found nothing at all could you write one in sudo http://java-performance.info/primitive-types-collections-trove-library/ Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
April 15, 201411 yr I have a 3-input furnace in my mod, It worked in 1.6.2, and i'm trying to get it to work in 1.7.2. if you want to see my old code, PM me, or just ask me to put it here. There's a lot of code...
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.