Add things

This commit is contained in:
Signal 2025-10-27 22:05:23 -04:00
parent 4d8312b79d
commit 00e1fd985d
28 changed files with 395 additions and 31 deletions

View file

@ -20,9 +20,11 @@ minetest.register_entity(":red_glazed_terracotta:chest_display", {
e._pos = minetest.deserialize(data)
ns.chests[vector.to_string(e._pos)] = e
e.users = {}
e.object:set_animation({x=0,y=0}, 1, 0.1, false)
end,
on_deactivate = function(e)
ns.chests[vector.to_string(e._pos)] = nil
e.object:set_animation({x=0,y=0}, 1, 0.1, false)
end,
get_staticdata = function(e)
return minetest.serialize(e._pos)
@ -44,8 +46,10 @@ rgt.register_node("chest", {
paramtype2 = "4dir",
mesh = "rgt_chest.gltf",
tiles = {"rgt_chest.png"},
on_place = function(s, p, pt)
return minetest.item_place_node(ItemStack("real_chest"), p, pt)
on_construct = function(pos)
local node = minetest.get_node(pos)
node.name = "real_chest"
minetest.set_node(pos, node)
end
})
@ -103,7 +107,7 @@ rgt.register_node("real_chest", {
for i = 1, inv:get_size("inv") do
local item = minetest.add_item(pos, inv:get_stack("inv", i))
if item then
item:set_velocity(vector.random_direction() *math.random(1, 3))
item:set_velocity(vector.random_direction() *math.random(2, 3))
end
end
e.object:remove()