summaryrefslogtreecommitdiff
path: root/homedecor
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-02-22 17:40:52 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-02-22 17:40:52 -0500
commit7ec609f647139aa44bd0ef8c7d908476379cc24f (patch)
tree34aa6fcf193e51260d7cbba2457ea604f1748925 /homedecor
parent0aefae28c513b8ab2357d9f92dbf7f79bd7517e6 (diff)
downloaddreambuilder_modpack-7ec609f647139aa44bd0ef8c7d908476379cc24f.tar
dreambuilder_modpack-7ec609f647139aa44bd0ef8c7d908476379cc24f.tar.gz
dreambuilder_modpack-7ec609f647139aa44bd0ef8c7d908476379cc24f.tar.bz2
dreambuilder_modpack-7ec609f647139aa44bd0ef8c7d908476379cc24f.tar.xz
dreambuilder_modpack-7ec609f647139aa44bd0ef8c7d908476379cc24f.zip
updated homedecor (duh :D )
Diffstat (limited to 'homedecor')
-rw-r--r--homedecor/gastronomy.lua20
1 files changed, 19 insertions, 1 deletions
diff --git a/homedecor/gastronomy.lua b/homedecor/gastronomy.lua
index e780926..911d151 100644
--- a/homedecor/gastronomy.lua
+++ b/homedecor/gastronomy.lua
@@ -177,7 +177,25 @@ homedecor.register("beer_mug", {
walkable = false,
sounds = default.node_sound_glass_defaults(),
selection_box = beer_cbox,
- on_use = minetest.item_eat(2)
+ on_use = function(itemstack, user, pointed_thing)
+ local inv = user:get_inventory()
+ if not creative.is_enabled_for(user:get_player_name()) then
+ if inv:room_for_item("main", "vessels:drinking_glass 1") then
+ inv:add_item("main", "vessels:drinking_glass 1")
+ else
+ local pos = user:get_pos()
+ local dir = user:get_look_dir()
+ local fdir = minetest.dir_to_facedir(dir)
+ local pos_fwd = { x = pos.x + homedecor.fdir_to_fwd[fdir+1][1],
+ y = pos.y + 1,
+ z = pos.z + homedecor.fdir_to_fwd[fdir+1][2] }
+ minetest.add_item(pos_fwd, "vessels:drinking_glass 1")
+ end
+ minetest.item_eat(2)
+ itemstack:take_item()
+ return itemstack
+ end
+ end
})
local svm_cbox = {