aboutsummaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
authorWilliam Breathitt Gray <vilhelm.gray@gmail.com>2019-11-16 13:14:24 -0500
committerrubenwardy <rw@rubenwardy.com>2019-12-31 21:39:16 +0000
commit5e4739b4607e2867783c71c0301e1aa3df16529a (patch)
tree4cf97bfa02db4389117b8cf216b360a1d242b36b /src/inventory.h
parent0d8f598df214f9464baa939f2a7ce1d1750101a9 (diff)
downloadminetest-5e4739b4607e2867783c71c0301e1aa3df16529a.tar.gz
minetest-5e4739b4607e2867783c71c0301e1aa3df16529a.tar.bz2
minetest-5e4739b4607e2867783c71c0301e1aa3df16529a.zip
Fix find_path for newer jsoncpp installations
The upstream JsonCpp project has renamed the `json/features.h` file to `json/json_features.h`. This patch fixes the JsonCpp installation search by looking for `json/allocator.h` which has not been renamed on newer versions of JsonCpp. Fixes: https://github.com/minetest/minetest/issues/9119
Diffstat (limited to 'src/inventory.h')
0 files changed, 0 insertions, 0 deletions
minetest.register_alias("bucket_water", "bucket:bucket_water") minetest.register_alias("bucket_lava", "bucket:bucket_lava") minetest.register_craft({ output = 'bucket:bucket_empty 1', recipe = { {'default:steel_ingot', '', 'default:steel_ingot'}, {'', 'default:steel_ingot', ''}, } }) bucket = {} bucket.liquids = {} -- Register a new liquid -- source = name of the source node -- flowing = name of the flowing node -- itemname = name of the new bucket item (or nil if liquid is not takeable) -- inventory_image = texture of the new bucket item (ignored if itemname == nil) -- This function can be called from any mod (that depends on bucket). function bucket.register_liquid(source, flowing, itemname, inventory_image) bucket.liquids[source] = { source = source, flowing = flowing, itemname = itemname, } bucket.liquids[flowing] = bucket.liquids[source] if itemname ~= nil then minetest.register_craftitem(itemname, { inventory_image = inventory_image, stack_max = 1, liquids_pointable = true, on_use = function(itemstack, user, pointed_thing) -- Must be pointing to node if pointed_thing.type ~= "node" then return end -- Check if pointing to a liquid n = minetest.env:get_node(pointed_thing.under) if bucket.liquids[n.name] == nil then -- Not a liquid minetest.env:add_node(pointed_thing.above, {name=source}) elseif n.name ~= source then -- It's a liquid minetest.env:add_node(pointed_thing.under, {name=source}) end return {name="bucket:bucket_empty"} end }) end end minetest.register_craftitem("bucket:bucket_empty", { inventory_image = "bucket.png", stack_max = 1, liquids_pointable = true, on_use = function(itemstack, user, pointed_thing) -- Must be pointing to node if pointed_thing.type ~= "node" then return end -- Check if pointing to a liquid source n = minetest.env:get_node(pointed_thing.under) liquiddef = bucket.liquids[n.name] if liquiddef ~= nil and liquiddef.source == n.name and liquiddef.itemname ~= nil then minetest.env:add_node(pointed_thing.under, {name="air"}) return {name=liquiddef.itemname} end end, }) bucket.register_liquid( "default:water_source", "default:water_flowing", "bucket:bucket_water", "bucket_water.png" ) bucket.register_liquid( "default:lava_source", "default:lava_flowing", "bucket:bucket_lava", "bucket_lava.png" ) minetest.register_craft({ type = "fuel", recipe = "bucket:bucket_lava", burntime = 60, })