Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

3 input furnace?


Eastonium
 Share

Recommended Posts

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Sry i had to much todo with my Modular Machine that i had forgot the thing here^^"

I am really sorry! xD this machine is so hard to code! Its to much for a lonly person^^

But back to reallity^^

Now to the code

 

And i do know how it works! Only thing is its always a ShapedRecipe!

If you want to add a shapless recipe then you had to make it manually!

 

You only need to make a the furnace as normal. Everything as normal!

The only things what you have to change that he consumes all 3 inputs and the Recipe list!

 

I show you how that works!

Here the code:

 

public class FurnaceList
{
      private static FurnaceList recipes = new FurnaceList();

      public static FurnaceList smelting()
      {
           return recipes;
      }



      //RecipList i do not make a exp Bar. But its easy too
      private HashMap<List<Integer>, ItemStack> recipeList = new HashMap<List<Integer>, ItemStack>();
      //Why Do i make a Forge Meta Recipe list ?
     // Because its the Easiest way! 

    // Now The Tricky Part and do not say its a little bit big! I know that but Its working!
    public void addSmelting(ItemStack output, ItemStack input1, ItemStack input2, ItemStack input3)
    {
         int item1 = 0;
         int damage1 = 0;
         int item2 = 0;
         int damage2 = 0;
         int item3 = 0;
         int damage3 = 0;
         
         if(input1 != null)
         {
              item1 = input1.itemID;
              damage1 = input1.getItemDamage();
         }

         if(input2 != null)
         {
             item2 = input2.itemID;
             damage2 = input2.getItemDamage();
         }

         if(input3 != null)
         {
               item3 = input3.itemID;
               damage3 = input3.getItemDamage();
         }
         recipeList.put(Arrays.asList(item1, damage1, item2, damage2, item3, damage3), output);

    }
      
    public Map<List<Integer>, ItemStack> getRecipeList()
    {
        return recipeList;
    }

    public ItemStack getRecipeOutput(ItemStack input1, ItemStack input2, ItemStack input3)
    {
         int item1 = 0;
         int damage1 = 0;
         int item2 = 0;
         int damage2 = 0;
         int item3 = 0;
         int damage3 = 0;
         
         if(input1 != null)
         {
              item1 = input1.itemID;
              damage1 = input1.getItemDamage();
         }

         if(input2 != null)
         {
             item2 = input2.itemID;
             damage2 = input2.getItemDamage();
         }

         if(input3 != null)
         {
               item3 = input3.itemID;
               damage3 = input3.getItemDamage();
         }
         return recipeList.get(Arrays.asList(item1, damage1, item2, damage2, item3, damage3));
    }
}

 

I know its a lot of code.

Now to explaining.

 

When you add a recipe than it will safed as a list:

[item1, damage1, item2, damage2, item3, damage3];

so and if you want to get it then he looks at the rcipes list with the same informations.

So you can extend the code as much as you want. So long you make it as list^^

But this way you had to add every combination by yourself! Its always a shaped recipe!

So if you want to add a 1 item recipe than you had to add 3 recipes xD

 

And i think thats what you are looking for.

I hope it helps^^ xD

Link to comment
Share on other sites

It works! I had to modify quite a few things in my TileEntity, but it works great! But right now I'm wondering if it would be possible to use the Arrays.sort method to arrange the recipes before comparing them. Could the Arrays for the arraylist be written something like (item1, item2, item3, meta1, meta2, meta 3) or something of that sorts, or if that doesn't work, maybe 2 arrays inside of one array being something like: recipelist(ArrayItems[], ArrayMeta[])??? I really want the shapeless stuffs....

Link to comment
Share on other sites

xD Here a way to add a shaplessRecipe^^

 

//Your Add smelting function out of my old post. I do not want write everything doube

public void addSmelting(ItemStack output, ItemStack input1, ItemStack input2, ItemStack input3)
{};

public void addShaplessSmelting(ItemStack output, ItemStack in1, ItemStack in2, ItemStack in3)
{
      addSmelting(output, in1, in2, in3);
      addSmelting(output, in1, in3, in2);
      addSmelting(output, in2, in1, in3);
      addSmelting(output, in2, in3, in1);
      addSmelting(output, in3, in1, in2);
      addSmelting(output, in3, in2, in1);
}

with this function you make shaplessRecipes  XD So you can have both.
There might be easier ways but i do not know them!

Link to comment
Share on other sites

  • 1 year later...

This thread is 1 and a half year old. Don't hijack threads! Make your own thread.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share




  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • https://www.mediafire.com/file/hs6o5snxiwpk1j5/latest.log/file
    • Alright Thanks! So that's why alone what i wrote wasn't enough.
    • Hello,  So i was trying to run forge 1.18 with some mods but it just crashes and gives a -1 error code whenever I click Play World or Create New World. I tried to launch Forge alone without any mods and it worked, so there is some issue with the mod loading.  But in the crash report, it doesn't mention any issues with the mod loading at all, instead it says all mods have loaded. I've attached the crash log with this, it says there's an issue with the render thread? I hope that will help narrow down the issue.   Thanks   Crash file:  
    • How can i make the transparency of an block work just like the SlimeBlock, as shown in the image: By now i'm setting the RenderLayer of the block to RenderType.translucent() and also extending the HalfTransparentBlock in my block.
    • [11:22:34] [main/INFO]: ModLauncher running: args [--username, Amaru782, --version, forge-36.2.19, --gameDir, C:\Users\usuario\curseforge\minecraft\Instances\Better Minecraft [FORGE] - 1.16.5, --assetsDir, C:\Users\usuario\curseforge\minecraft\Install\assets, --assetIndex, 1.16, --uuid, dc27f25f4a0349eca32fbd0abdd36c7c, --accessToken, ????????, --userType, msa, --versionType, release, --width, 1366, --height, 768, --launchTarget, fmlclient, --fml.forgeVersion, 36.2.19, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20210115.111550] [11:22:34] [main/INFO]: ModLauncher 8.0.9+86+master.3cf110c starting: java version 1.8.0_51 by Oracle Corporation [11:22:35] [main/WARN]: LEGACY JDK DETECTED, SECURED JAR HANDLING DISABLED [11:22:36] [main/INFO]: Added Lets Encrypt root certificates as additional trust [11:22:36] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.4 Source=file:/C:/Users/usuario/curseforge/minecraft/Install/libraries/org/spongepowered/mixin/0.8.4/mixin-0.8.4.jar Service=ModLauncher Env=CLIENT [11:22:36] [main/WARN]: Configuration file C:\Users\usuario\curseforge\minecraft\Instances\Better Minecraft [FORGE] - 1.16.5\config\fml.toml is not correct. Correcting [11:22:36] [main/WARN]: Incorrect key [defaultConfigPath] was corrected from null to defaultconfigs [11:22:37] [main/FATAL]: Failed to find Minecraft resource version 1.16.5-20210115.111550 at C:\Users\usuario\curseforge\minecraft\Install\libraries\net\minecraftforge\forge\1.16.5-36.2.19\forge-1.16.5-36.2.19-client.jar [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.RuntimeException: Missing minecraft resource! [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraftforge.fml.loading.FMLCommonLaunchHandler.lambda$validatePaths$4(FMLCommonLaunchHandler.java:124) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraftforge.fml.loading.FMLCommonLaunchHandler$$Lambda$170/292641216.accept(Unknown Source) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraftforge.fml.loading.FMLCommonLaunchHandler.validatePaths(FMLCommonLaunchHandler.java:121) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraftforge.fml.loading.FMLLoader.setupLaunchHandler(FMLLoader.java:202) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraftforge.fml.loading.FMLServiceProvider.initialize(FMLServiceProvider.java:94) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.TransformationServiceDecorator.onInitialize(TransformationServiceDecorator.java:68) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.TransformationServicesHandler.lambda$initialiseTransformationServices$7(TransformationServicesHandler.java:107) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.TransformationServicesHandler$$Lambda$92/30578394.accept(Unknown Source) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at java.util.HashMap$Values.forEach(HashMap.java:972) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.TransformationServicesHandler.initialiseTransformationServices(TransformationServicesHandler.java:107) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:59) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.Launcher.run(Launcher.java:76) [11:22:37] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66)  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.