Bucket preservation when using lava buckets as fuel

Post Reply
hdastwb
Member
Posts: 106
Joined: Tue Jan 01, 2013 18:47
GitHub: hdastwb
IRC: hdastwb
In-game: hdastwb
Location: United States

Bucket preservation when using lava buckets as fuel

by hdastwb » Post

One of the things that bugs me about using lava buckets in the furnace is that the bucket is always consumed in the process; it seems to me like a bit of a waste. I'm not sure what the "official" view of burning buckets along with the lava as fuel is, but in the mean time I managed to "fix" the issue and change the game's mods on my testing copy to consume only the lava and leave an empty bucket behind. I basically had to change two things:

1. I added support for craft formula replacements in the default mod by setting the output value of the fuel to the "decremented input" return value of get_craft_result rather than the input stack with one item removed:

Code: Select all

(around line 1500)

local fuel = nil
local cooked = nil
local fuellist = inv:get_list("fuel")
local srclist = inv:get_list("src")

--to--

local fuel = nil
local afterfuel
local cooked = nil
local fuellist = inv:get_list("fuel")
local srclist = inv:get_list("src")


fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})

--to--

fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})


local stack = inv:get_stack("fuel", 1)
stack:take_item()
inv:set_stack("fuel", 1, stack)

--to--

inv:set_stack("fuel", 1, afterfuel.items[1])
2. Then, I added a line to the fuel craft definition for the lava bucket in the bucket mod to replace the lava with an empty bucket:

Code: Select all

(line 103)

minetest.register_craft({
    type = "fuel",
    recipe = "bucket:bucket_lava",
    burntime = 60,
})

--to--

minetest.register_craft({
    type = "fuel",
    recipe = "bucket:bucket_lava",
    burntime = 60,
    replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}},
})
In any case, something along the lines of the changes that I made to the default mod should probably be implemented in the official version so that other mods will be able to supply fuel to furnaces without using up containers. In this case, I'm not seeing any reason for burning the buckets along with the lava when smelting, but then the changes were easy enough to make that I wonder why no-one else seems to have made them yet…

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

Can someone make a pull request flyer this
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

Before I knew the bucket was consumed I used it as fuel on a server went to the furnace no fuel I asked a friend if they moved it and they said they didn't touch it I was so confused
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

User avatar
InfinityProject
Member
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Post

+1 for this.

User avatar
Obiewan1111
Member
Posts: 198
Joined: Fri Dec 14, 2012 20:30
Location: Salisbury, Wiltshire, England

by Obiewan1111 » Post

When you place a bucket of lava into the furnace, it should turn into a lava source and then you should get the bucket added to your inventory. And yeah.. That bugs me too.
Youtube Channel; Minetest Gaming Videos

Is suggesting the Offtopic Section and getting it added an achievement? I guess it is!

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

+32767 internetz
I hate this too
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

rarkenin
Member
Posts: 668
Joined: Tue Nov 20, 2012 20:48

by rarkenin » Post

Very nice!
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.

hdastwb
Member
Posts: 106
Joined: Tue Jan 01, 2013 18:47
GitHub: hdastwb
IRC: hdastwb
In-game: hdastwb
Location: United States

by hdastwb » Post

The pull request has been submitted; a response on GitHub should be forthcoming…

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

And I thought that was natural for iron to melt in the lava... That's before I read about lava temperature on Wiki...
Well, immortal bucket is not that bad after all ;)
+1

User avatar
0gb.us
Member
Posts: 841
Joined: Sun Sep 16, 2012 01:55
Location: 0gb.us:30000
Contact:

by 0gb.us » Post

Nice. I always thought using lave as a furnace fuel was a waste of precious iron. If this is included upstream, it won't have to be.

If it isn't implemented upstream, I might have to add it to my custom game ....

User avatar
Johnny Joy
Member
Posts: 56
Joined: Fri Sep 05, 2014 20:26
GitHub: johnnyjoy
In-game: jjb

Re: Bucket preservation when using lava buckets as fuel

by Johnny Joy » Post

If multiple buckets are used as fuel will all the empty buckets be returned?

hdastwb
Member
Posts: 106
Joined: Tue Jan 01, 2013 18:47
GitHub: hdastwb
IRC: hdastwb
In-game: hdastwb
Location: United States

Re: Bucket preservation when using lava buckets as fuel

by hdastwb » Post

Johnny Joy wrote:If multiple buckets are used as fuel will all the empty buckets be returned?
This was brought up in the pull request discussion too: https://github.com/minetest/minetest_game/pull/105

Basically, there's no correct behavior in that case since there's only one fuel slot and there's two different types of things that would need to go in it (remaining fuel and spent fuel). However, this isn't much of an issue since it is not possible to use multiple buckets because buckets are non-stackable (or at least they weren't back when I was keeping closer track of Minetest; I haven't been paying as much attention to recent developments). However, if buckets are stackable now and you have an idea about what should happen to a stack of buckets when you put it in a furnace, you can always try implementing a different solution (the information on this thread and the pull request should give you a good idea where the fuel-consuming logic resides), submitting a pull request, and waiting two months like I did for someone to finally decide to merge it.

User avatar
Johnny Joy
Member
Posts: 56
Joined: Fri Sep 05, 2014 20:26
GitHub: johnnyjoy
In-game: jjb

Re: Bucket preservation when using lava buckets as fuel

by Johnny Joy » Post

I'm looking at the ethanol fuel in the Farming Redo mod by tenplus1. The ethanol fuel is crafted using a glass bottle and corn. The resulting ethanol bottles can be stacked as fuel, but after the burn is over only one empty bottle remains. This renders the ethanol fuel moot.

Would there is a simple method to either just try and return the empty bottles to the player's inventory, or capture the number of bottles burned and replace with the correct number at the end of the burn?

I'm a long time programer, but no too experienced with minetest or loa, however loa does appear to be easy to get. With a few pointers I should be able to experiment effectively.

Thanks.

User avatar
Johnny Joy
Member
Posts: 56
Joined: Fri Sep 05, 2014 20:26
GitHub: johnnyjoy
In-game: jjb

Re: Bucket preservation when using lava buckets as fuel

by Johnny Joy » Post

Seems to me that the furnace has 3 different inventories, fuel, src, and dst. Couldn't we just add a third for replacement items? I'm also going to look into dropping the replacements into dst, if I can.

Thanks, again.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests