-
-
Save Andrey2470T/63cf365e5057ede739580eb127882d7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minetest.register_node("medicine:medical_bag", { | |
description = "Medical Bag", | |
visual_scale = 0.5, | |
mesh = "medicine_bag.obj", | |
tiles = {"medical_bag.png"}, | |
paramtype = "light", | |
paramtype2 = "facedir", | |
groups = {snappy = 2}, | |
drawtype = "mesh", | |
collision_box = { | |
type = "fixed", | |
fixed = {-0.5, -0.52, -0.24, 0.5, 0.23, 0.24} | |
}, | |
selection_box = { | |
type = "fixed", | |
fixed = {-0.5, -0.52, -0.24, 0.5, 0.23, 0.24} | |
}, | |
sounds = default.node_sound_leaves_defaults(), | |
on_construct = function (pos) | |
local meta = minetest.get_meta(pos) | |
meta:set_string("medical_bag_formspec", | |
"size[6, 5]" .. | |
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0, 1;6, 3]") | |
local inv = meta:get_inventory() | |
inv:set_size("main", 6*3) | |
end, | |
on_rightclick = function (pos, node, player, itemstack, pointed_thing) | |
minetest.show_formspec(player:get_player_name(), "medical_bag_inventory", minetest.get_meta(pos):get_string("medical_bag_formspec")) | |
end | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment