1 local mod = railcorridors
4 -- Zufälliger Kisteninhalt
6 if mod.nextrandom(0,1) < 0.03 then
7 return "farming:bread "..mod.nextrandom(1,3)
8 elseif mod.nextrandom(0,1) < 0.05 then
9 if mod.nextrandom(0,1) < 0.3 then
10 return "farming:seed_cotton "..math
.floor(mod.nextrandom(1,4))
11 elseif mod.nextrandom(0,1) < 0.5 then
12 return "default:sapling "..math
.floor(mod.nextrandom(1,4))
14 return "farming:seed_wheat "..math
.floor(mod.nextrandom(1,4))
16 elseif mod.nextrandom(0,1) < 0.005 then
17 return "tnt:tnt "..mod.nextrandom(1,3)
18 elseif mod.nextrandom(0,1) < 0.003 then
19 if mod.nextrandom(0,1) < 0.8 then
20 return "default:mese_crystal "..math
.floor(mod.nextrandom(1,3))
22 return "default:diamond "..math
.floor(mod.nextrandom(1,3))
28 function mod.place_chest(pos
)
29 minetest
.set_node(pos
, {name
="default:chest"})
31 local meta
= minetest
.get_meta(pos
)
32 local meta_table
= meta
:to_table()
34 local inventory_main
= {}
36 inventory_main
[i
] = mod.rci()
39 if meta_table
~= nil then -- Makes the chest workable regardless of the chest's readiness
40 meta_table
.inventory
.main
= inventory_main
41 meta
:from_table(meta_table
)
42 meta
:set_string("infotext", "Chest");
54 local inv
= meta
:get_inventory()
55 inv
:set_size("main", 8*4) -- Fixes trimmed inventory space issue.