forked from VoxeLibre/VoxeLibre
Fix placing fishbuckets to actually replace buildable_to
This commit is contained in:
parent
12727a6a0a
commit
0a47814383
|
@ -18,14 +18,21 @@ local function on_place_fish(itemstack, placer, pointed_thing)
|
|||
return new_stack
|
||||
end
|
||||
|
||||
local pos = pointed_thing.above or pointed_thing.under
|
||||
if not pos then return end
|
||||
local n = minetest.get_node_or_nil(pos)
|
||||
local def = minetest.registered_nodes[n.name]
|
||||
if def and def.buildable_to or n.name == "mcl_portals:portal" then
|
||||
if pointed_thing.type ~= "node" then return end
|
||||
|
||||
local pos = pointed_thing.above
|
||||
local n = minetest.get_node(pointed_thing.above)
|
||||
local def = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name]
|
||||
|
||||
if ( def and def.buildable_to ) or n.name == "mcl_portals:portal" then
|
||||
pos = pointed_thing.under
|
||||
n = minetest.get_node(pointed_thing.under)
|
||||
end
|
||||
|
||||
local fish = itemstack:get_name():gsub(fishbucket_prefix,"")
|
||||
if fish_names[fish] then
|
||||
local o = minetest.add_entity(pos, "mobs_mc:" .. fish)
|
||||
if o and o:get_pos() then
|
||||
local props = itemstack:get_meta():get_string("properties")
|
||||
if props ~= "" then
|
||||
o:set_properties(minetest.deserialize(props))
|
||||
|
|
Loading…
Reference in New Issue