mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-23 16:30:19 +01:00
Implementation of multiple buckets handler
- Uncommented and changed a bit the lines of Casimir's redefinition of bucket:bucket_empty in ./minetestforfun_game/mods/bucket/init.lua to implement multiple buckets handle system, commented in an old commit (it was buggy, or something). The system has been modified a bit to prevent bugs from incompatibility between carbone's api (which the definition has been copied from) and minetestforfun_game's one.
This commit is contained in:
parent
5af89270ec
commit
a638096ce3
@ -135,11 +135,10 @@ minetest.register_craftitem(":bucket:bucket_empty", {
|
|||||||
-- Stacked buckets: add a filled bucket, replace stack.
|
-- Stacked buckets: add a filled bucket, replace stack.
|
||||||
local inv = user:get_inventory()
|
local inv = user:get_inventory()
|
||||||
if inv:room_for_item("main", liquiddef.itemname) then
|
if inv:room_for_item("main", liquiddef.itemname) then
|
||||||
minetest.add_node(pointed_thing.under, {name="air"})
|
count = count - 1
|
||||||
--count = count - 1
|
itemstack:set_count(count)
|
||||||
--itemstack:set_count(count)
|
inv:add_item("main", liquiddef.itemname)
|
||||||
return ItemStack(liquiddef.itemname)
|
return ItemStack(itemstack)
|
||||||
--inv:add_item("main", bucket_liquid)
|
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(user:get_player_name(), "Your inventory is full.")
|
minetest.chat_send_player(user:get_player_name(), "Your inventory is full.")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user