Random heights for islands, default max stack capacity to 100

This commit is contained in:
Kimapr 2019-10-25 13:54:40 +05:00
parent 0ec00d9ac7
commit e2a0171d99
2 changed files with 9 additions and 1 deletions

View File

@ -42,6 +42,14 @@ setmetatable(nodecore, {
end end
}) })
local rawregitem = minetest.register_item
function minetest.register_item(name,item)
if type(item) == "table" and item.stack_max == nil then
item.stack_max = 100
end
rawregitem(name,item)
end
include("issue7020") include("issue7020")
include("util_misc") include("util_misc")

View File

@ -99,7 +99,7 @@ local function gen_island_pos(name)
end end
store:set_string(pid(x,z),name) store:set_string(pid(x,z),name)
local range = {min={x=x*128-64,y=256-64,z=z*128-64},max={x=x*128+64,y=256+64,z=z*128+64}} local range = {min={x=x*128-64,y=256-64,z=z*128-64},max={x=x*128+64,y=256+64,z=z*128+64}}
local ip = {x=x*128+math.random(-32,32),y=256,z=z*128+math.random(-32,32)} local ip = {x=x*128+math.random(-32,32),y=256+math.random(-32,32),z=z*128+math.random(-32,32)}
spawn_island(name,ip) spawn_island(name,ip)
return pid(x,z),ip,range return pid(x,z),ip,range
end end