Jump to content

Crafting with liquids...


luisc99

Recommended Posts

Hey!

 

I am making a mod that involves quite advanced crafting recipes, one of which is done in a custom furnace type block. I was wondering if when using the forge liquid API, it would be possible to have the custom crafting table require water to smelt the item instead of fuel, and as well as creating the new item, it creates another custom liquid which I already have. Overall, something like the carpenter from Forestry, in the liquid transposer from Thermal Expansion, but to also produce a liquid after.

 

If there is an easy way to hold two different types of liquid in a container, and have them be used in the crafting I would love to know. I can post any code needed from my mod is necessary.

 

Thanks!

Luis  :)

 

 

Link to comment
Share on other sites

Holding two liquids is easy. My mod's mixer does this, you just need to define 2 LiquidTanks in your Tile Entity, similar to the way you define your Tile Entity's inventory.

 

public LiquidTank[] tanks = new LiquidTank[2];

tanks[0] is your first tank and tanks[1] is your second.

Link to comment
Share on other sites

Holding two liquids is easy. My mod's mixer does this, you just need to define 2 LiquidTanks in your Tile Entity, similar to the way you define your Tile Entity's inventory.

 

public LiquidTank[] tanks = new LiquidTank[2];

tanks[0] is your first tank and tanks[1] is your second.

 

Ok, how would I use these tanks in my crafting though? I don't have much experience with liquids or how they are stored as you might be able to see...

Link to comment
Share on other sites

I'm not good at explaining things, but I know Buildcraft makes use of Liquids, as it is where the Liquid part of Forge originally came from. BC is open source, so you could go look at the code for some good examples of LiquidTanks being used.

Here's the BC Github.

 

Yeah, I originally looked around on the BC code but didn't really find what I needed in it. Upon playing with your mod (which is great by the way!) your mixer seems very similar to what I want to do. Also I noticed in your copyright bit it says

This mod is provided freely and may be decompiled and modified for private use

and I was wondering if I could take a look at the mixer part of your code and see if it helps me at all. If not I understand!

 

Thanks for your help so far

Luis  :)

Link to comment
Share on other sites

Yeah, you can use something like jd-gui to quickly decompile some classes and take a peek. You might want to look at TileEntityMixer.class and maybe even MixerRecipes.class, but beware, my code is very messy and ugly and inefficient.

 

Thanks :)

Link to comment
Share on other sites

Quite off-topic, but is your mod planned to be open source? I'd love to see the source if that's ok with you; one of my mods I'm planning on something similar (An ore has to be refined to a liquid and pumped into a special crafting table in order to use it) and I'd love to see how you do it

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Link to comment
Share on other sites

Quite off-topic, but is your mod planned to be open source? I'd love to see the source if that's ok with you; one of my mods I'm planning on something similar (An ore has to be refined to a liquid and pumped into a special crafting table in order to use it) and I'd love to see how you do it

 

Whose mod, mine or vroominators? I tried to get mine open source but my laptop does not seem to like git being installed...

Link to comment
Share on other sites

Quite off-topic, but is your mod planned to be open source? I'd love to see the source if that's ok with you; one of my mods I'm planning on something similar (An ore has to be refined to a liquid and pumped into a special crafting table in order to use it) and I'd love to see how you do it

 

Whose mod, mine or vroominators? I tried to get mine open source but my laptop does not seem to like git being installed...

 

Yours if that's alright. Are you using the old git command line thing, or Git for windows? The latter is really easy to use but if your laptop doesn't like it obviously you can't get that far. Any chance you could email me a .zip?

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Link to comment
Share on other sites

Quite off-topic, but is your mod planned to be open source? I'd love to see the source if that's ok with you; one of my mods I'm planning on something similar (An ore has to be refined to a liquid and pumped into a special crafting table in order to use it) and I'd love to see how you do it

 

Whose mod, mine or vroominators? I tried to get mine open source but my laptop does not seem to like git being installed...

 

Yours if that's alright. Are you using the old git command line thing, or Git for windows? The latter is really easy to use but if your laptop doesn't like it obviously you can't get that far. Any chance you could email me a .zip?

 

I tried installing git for windows but it failed to install every time and the command line thing did not work either. I could email you the mod if you like but I would have to fix up some things with the liquids first.

Link to comment
Share on other sites

Upon looking at your code for the mixer, quite a large amount of it was obfuscated and made it difficult to find which methods you used for different things. If you could maybe send me the .java files for the mixer block so I could have a look at them in more detail? If not then I understand...

 

Thanks again!

Luis  :)

Link to comment
Share on other sites

I could email you the mod if you like but I would have to fix up some things with the liquids first.

 

If you could that'd be great :) Either PM me on here or send to flenix@silvania.co.uk

 

Upon looking at your code for the mixer, quite a large amount of it was obfuscated and made it difficult to find which methods you used for different things. If you could maybe send me the .java files for the mixer block so I could have a look at them in more detail? If not then I understand...

 

Thanks again!

Luis  :)

 

Was this supposed to be for me? If so, no idea what you're on about. The block that I want to make using liquid crafting isn't even made yet; all I have is a stub basic block with the name etc, ready to be made.

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Link to comment
Share on other sites

Upon looking at your code for the mixer, quite a large amount of it was obfuscated and made it difficult to find which methods you used for different things. If you could maybe send me the .java files for the mixer block so I could have a look at them in more detail? If not then I understand...

 

Thanks again!

Luis  :)

 

Was this supposed to be for me? If so, no idea what you're on about. The block that I want to make using liquid crafting isn't even made yet; all I have is a stub basic block with the name etc, ready to be made.

 

No sorry, I ment vroominators mod.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.