misc adjustments

master
Brandon 2014-05-26 00:49:03 -05:00
parent 2ff52c68fd
commit 46b914e842
3 changed files with 11 additions and 6 deletions

View File

@ -5,7 +5,7 @@ docfarming?
diet? diet?
farming? farming?
farming_plus? farming_plus?
hud? hud
intllib? intllib?
jkanimals? jkanimals?
jkfarming? jkfarming?

View File

@ -15,7 +15,7 @@ function hud.update_stamina(p,name)
end end
local anim = default.player_get_animation(p) local anim = default.player_get_animation(p)
local adj = 0.25 + ( 0.2 * ( skills.player_levels[name].level / 5 ) ) local adj = 0.2 + ( 0.2 * ( skills.player_levels[name].level / 5 ) )
if anim.animation == "lay" then if anim.animation == "lay" then
adj = adj + 0.75 adj = adj + 0.75
if math.random(0,4) == 1 then if math.random(0,4) == 1 then

View File

@ -662,7 +662,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
mg_generate(minp, maxp, emin, emax, vm) mg_generate(minp, maxp, emin, emax, vm)
end) end)
local function mg_regenerate(pos, name) function mg_regenerate(pos, name)
local minp = {x = 80*math.floor((pos.x+32)/80)-32, local minp = {x = 80*math.floor((pos.x+32)/80)-32,
y = 80*math.floor((pos.y+32)/80)-32, y = 80*math.floor((pos.y+32)/80)-32,
z = 80*math.floor((pos.z+32)/80)-32} z = 80*math.floor((pos.z+32)/80)-32}
@ -676,8 +676,9 @@ local function mg_regenerate(pos, name)
vm:set_data(data) vm:set_data(data)
vm:write_to_map() vm:write_to_map()
mg_generate(minp, maxp, emin, emax, vm) mg_generate(minp, maxp, emin, emax, vm)
if name ~= nil then
minetest.chat_send_player(name, "Regenerating done, fixing lighting. This may take a while...") minetest.chat_send_player(name, "Regenerating done, fixing lighting. This may take a while...")
end
-- Fix lighting -- Fix lighting
local nodes = minetest.find_nodes_in_area(minp, maxp, "air") local nodes = minetest.find_nodes_in_area(minp, maxp, "air")
local nnodes = #nodes local nnodes = #nodes
@ -686,10 +687,14 @@ local function mg_regenerate(pos, name)
for _, pos in ipairs(nodes) do for _, pos in ipairs(nodes) do
dig_node(pos) dig_node(pos)
if _%p == 0 then if _%p == 0 then
if name ~= nil then
minetest.chat_send_player(name, math.floor(_/nnodes*100).."%") minetest.chat_send_player(name, math.floor(_/nnodes*100).."%")
end
end end
end end
minetest.chat_send_player(name, "Done") if name ~= nil then
minetest.chat_send_player(name, "Done")
end
end end
minetest.register_chatcommand("mg_regenerate", { minetest.register_chatcommand("mg_regenerate", {