mirror of
https://github.com/BenjieFiftysix/sponge.git
synced 2024-10-04 00:33:05 +02:00
fixed placing bugs
Could not open chest while holding a sponge, would not replace replaceable nodes and would take an item in creative mode.
This commit is contained in:
parent
8c85bcd1f6
commit
0db129e3de
12
init.lua
12
init.lua
@ -51,8 +51,7 @@ minetest.register_node("sponge:sponge", { -- dry sponge
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pos = minetest.get_pointed_thing_position(pointed_thing, pointed_thing.above)
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
local name = placer:get_player_name()
|
||||
|
||||
if not minetest.is_protected(pos, name) then
|
||||
@ -75,18 +74,13 @@ minetest.register_node("sponge:sponge", { -- dry sponge
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if count > 3 then -- only turns soggy if it removed more than 3 nodes
|
||||
if count > 3 then -- turns soggy if it removed more than 3 nodes
|
||||
minetest.set_node(pos, {name="sponge:soggy_sponge"})
|
||||
else
|
||||
minetest.set_node(pos, {name="sponge:sponge"})
|
||||
end
|
||||
itemstack:take_item(1)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
|
||||
on_destruct = destruct
|
||||
after_dig_node = destruct
|
||||
})
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user