Small update mainmenu. Cleanup and fixes

This commit is contained in:
MoNTE48 2019-06-25 01:00:18 +02:00
parent aa4c3bf5ea
commit a78bb6cbd6
37 changed files with 119 additions and 165 deletions

View File

@ -514,6 +514,9 @@ function core.item_drop(itemstack, dropper, pos)
local dropper_is_player = dropper and dropper:is_player() local dropper_is_player = dropper and dropper:is_player()
local p = table.copy(pos) local p = table.copy(pos)
local cnt = itemstack:get_count() local cnt = itemstack:get_count()
if not core.is_valid_pos(p) then
return
end
if dropper_is_player then if dropper_is_player then
p.y = p.y + 1.2 p.y = p.y + 1.2
if dropper:get_player_control().sneak then if dropper:get_player_control().sneak then

View File

@ -162,7 +162,7 @@ end
-- Checks if specified volume intersects a protected volume -- Checks if specified volume intersects a protected volume
-- Backport from Minetest 5.0 -- Backport from Minetest 5.0
function core.intersects_protection(minp, maxp, player_name, interval) function core.is_area_protected(minp, maxp, player_name, interval)
-- 'interval' is the largest allowed interval for the 3D lattice of checks. -- 'interval' is the largest allowed interval for the 3D lattice of checks.
-- Compute the optimal float step 'd' for each axis so that all corners and -- Compute the optimal float step 'd' for each axis so that all corners and
@ -175,14 +175,18 @@ function core.intersects_protection(minp, maxp, player_name, interval)
local d = {} local d = {}
for _, c in pairs({"x", "y", "z"}) do for _, c in pairs({"x", "y", "z"}) do
if minp[c] > maxp[c] then
-- Repair positions: 'minp' > 'maxp'
local tmp = maxp[c]
maxp[c] = minp[c]
minp[c] = tmp
end
if maxp[c] > minp[c] then if maxp[c] > minp[c] then
d[c] = (maxp[c] - minp[c]) / d[c] = (maxp[c] - minp[c]) /
math.ceil((maxp[c] - minp[c]) / interval) - 1e-4 math.ceil((maxp[c] - minp[c]) / interval) - 1e-4
elseif maxp[c] == minp[c] then else
d[c] = 1 -- Any value larger than 0 to avoid division by zero d[c] = 1 -- Any value larger than 0 to avoid division by zero
else -- maxp[c] < minp[c], print error and treat as protection intersected
core.log("error", "maxp < minp in 'minetest.intersects_protection()'")
return true
end end
end end
@ -192,13 +196,13 @@ function core.intersects_protection(minp, maxp, player_name, interval)
local y = math.floor(yf + 0.5) local y = math.floor(yf + 0.5)
for xf = minp.x, maxp.x, d.x do for xf = minp.x, maxp.x, d.x do
local x = math.floor(xf + 0.5) local x = math.floor(xf + 0.5)
if core.is_protected({x = x, y = y, z = z}, player_name) then local pos = {x = x, y = y, z = z}
return true if core.is_protected(pos, player_name) then
return pos
end end
end end
end end
end end
return false return false
end end

View File

@ -21,7 +21,7 @@ local breath_bar_definition =
hud_elem_type = "statbar", hud_elem_type = "statbar",
position = {x = 0.5, y = 1}, position = {x = 0.5, y = 1},
alignment = {x = -1, y = -1}, alignment = {x = -1, y = -1},
offset = {x = 10, y = -134}, offset = {x = 8, y = -134},
size = {x = 24, y = 24}, size = {x = 24, y = 24},
text = "bubble.png", text = "bubble.png",
number = 20, number = 20,

View File

@ -35,7 +35,7 @@ common_update_cached_supp_proto()
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
local function render_client_count(n) local function render_client_count(n)
if n > 99 then return '99+' if n > 999 then return '999'
elseif n >= 0 then return tostring(n) elseif n >= 0 then return tostring(n)
else return '?' end else return '?' end
end end
@ -54,14 +54,16 @@ end
function image_column(tooltip, flagname) function image_column(tooltip, flagname)
return "image,tooltip=" .. core.formspec_escape(tooltip) .. "," .. return "image,tooltip=" .. core.formspec_escape(tooltip) .. "," ..
"0=" .. core.formspec_escape(defaulttexturedir .. "blank.png") .. "," .. "0=" .. core.formspec_escape(defaulttexturedir .. "blank.png") .. "," ..
"1=" .. core.formspec_escape(defaulttexturedir .. "1=" .. core.formspec_escape(defaulttexturedir .. "server_flags_favorite.png") .. "," ..
(flagname and "server_flags_" .. flagname .. ".png" or "blank.png")) .. "," .. "2=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mc.png") .. "," ..
"2=" .. core.formspec_escape(defaulttexturedir .. "server_ping_4.png") .. "," .. "3=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mt.png") .. "," ..
"3=" .. core.formspec_escape(defaulttexturedir .. "server_ping_3.png") .. "," .. "4=" .. core.formspec_escape(defaulttexturedir .. "server_flags_damage.png") .. "," ..
"4=" .. core.formspec_escape(defaulttexturedir .. "server_ping_2.png") .. "," .. "5=" .. core.formspec_escape(defaulttexturedir .. "server_flags_creative.png") .. "," ..
"5=" .. core.formspec_escape(defaulttexturedir .. "server_ping_1.png") .. "," .. "6=" .. core.formspec_escape(defaulttexturedir .. "server_flags_pvp.png") .. "," ..
"6=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mc.png") .. "," .. "14=" .. core.formspec_escape(defaulttexturedir .. "server_ping_4.png") .. "," ..
"7=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mt.png") "13=" .. core.formspec_escape(defaulttexturedir .. "server_ping_3.png") .. "," ..
"12=" .. core.formspec_escape(defaulttexturedir .. "server_ping_2.png") .. "," ..
"11=" .. core.formspec_escape(defaulttexturedir .. "server_ping_1.png")
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -102,22 +104,22 @@ function render_serverlist_row(spec, is_favorite, is_approved)
details = "1," details = "1,"
else else
if is_approved then if is_approved then
details = "6," details = "2,"
else else
details = "7," details = "3,"
end end
end end
if spec.ping then if spec.ping then
local ping = spec.ping * 1000 local ping = spec.ping * 1000
if ping <= 50 then if ping <= 50 then
details = details .. "2," details = details .. "14,"
elseif ping <= 100 then elseif ping <= 100 then
details = details .. "3," details = details .. "13,"
elseif ping <= 250 then elseif ping <= 250 then
details = details .. "4," details = details .. "12,"
else else
details = details .. "5," details = details .. "11,"
end end
else else
details = details .. "0," details = details .. "0,"
@ -147,20 +149,14 @@ function render_serverlist_row(spec, is_favorite, is_approved)
details = details .. ',?,/,?,' details = details .. ',?,/,?,'
end end
if spec.creative then
details = details .. "1,"
else
details = details .. "0,"
end
if spec.damage then if spec.damage then
details = details .. "1," details = details .. "4,"
else else
details = details .. "0," details = details .. "5,"
end end
if spec.pvp then if spec.pvp then
details = details .. "1," details = details .. "6,"
else else
details = details .. "0," details = details .. "0,"
end end

View File

@ -56,13 +56,13 @@ local function create_world_formspec(dialogdata)
"size[11.5,3.75,false]" .. "size[11.5,3.75,false]" ..
"background[0,0;11.5,3;" .. core.formspec_escape(defaulttexturedir .. "background[0,0;11.5,3;" .. core.formspec_escape(defaulttexturedir ..
"bg_dialog.png") .. ";true]" .. "bg_dialog.png") .. ";true]" ..
"label[2,0;" .. fgettext("World name") .. "]".. "label[1.5,0;" .. fgettext("World name:") .. "]"..
"field[4.5,0.4;6,0.5;te_world_name;;]" .. "field[4.5,0.4;6,0.5;te_world_name;;]" ..
"label[2,1;" .. fgettext("Seed") .. "]".. "label[1.5,1;" .. fgettext("Seed:") .. "]"..
"field[4.5,1.4;6,0.5;te_seed;;".. current_seed .. "]" .. "field[4.5,1.4;6,0.5;te_seed;;".. current_seed .. "]" ..
"label[2,2;" .. fgettext("Mapgen") .. "]".. "label[1.5,2;" .. fgettext("Mapgen:") .. "]"..
"dropdown[4.2,2;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]" .. "dropdown[4.2,2;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]" ..
"dropdown[600.2,6;6.3;games;" .. gamemgr.gamelist() .. ";1]" .. "dropdown[600.2,6;6.3;games;" .. gamemgr.gamelist() .. ";1]" ..

View File

@ -21,8 +21,7 @@ local function delete_world_formspec(dialogdata)
"size[11.5,3.75,false]" .. "size[11.5,3.75,false]" ..
"background[0,0;11.5,3;" .. core.formspec_escape(defaulttexturedir .. "background[0,0;11.5,3;" .. core.formspec_escape(defaulttexturedir ..
"bg_dialog.png") .. ";true]" .. "bg_dialog.png") .. ";true]" ..
"label[5,1.4;" .. "label[5,1.4;" .. fgettext("Delete World") .. "]" ..
fgettext("Delete World") .. "]" ..
"label[5,1.8;" .. fgettext("\"$1\"?", dialogdata.delete_name) .. "]" .. "label[5,1.8;" .. fgettext("\"$1\"?", dialogdata.delete_name) .. "]" ..
"button[3.25,3.4;2.5,0.5;world_delete_confirm;" .. fgettext("Delete") .. "]" .. "button[3.25,3.4;2.5,0.5;world_delete_confirm;" .. fgettext("Delete") .. "]" ..
"button[5.75,3.4;2.5,0.5;world_delete_cancel;" .. fgettext("Cancel") .. "]" "button[5.75,3.4;2.5,0.5;world_delete_cancel;" .. fgettext("Cancel") .. "]"

View File

@ -36,11 +36,13 @@ dofile(basepath .. DIR_DELIM .. "fstk" .. DIR_DELIM .. "ui.lua")
dofile(menupath .. DIR_DELIM .. "common.lua") dofile(menupath .. DIR_DELIM .. "common.lua")
dofile(menupath .. DIR_DELIM .. "gamemgr.lua") dofile(menupath .. DIR_DELIM .. "gamemgr.lua")
dofile(menupath .. DIR_DELIM .. "textures.lua") dofile(menupath .. DIR_DELIM .. "textures.lua")
dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua") dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua")
--dofile(menupath .. DIR_DELIM .. "dlg_delete_mod.lua") --dofile(menupath .. DIR_DELIM .. "dlg_delete_mod.lua")
dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua") dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua")
--dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua") --dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua")
dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua") dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
if not use_simple_menu then if not use_simple_menu then
dofile(menupath .. DIR_DELIM .. "modmgr.lua") dofile(menupath .. DIR_DELIM .. "modmgr.lua")
-- dofile(menupath .. DIR_DELIM .. "store.lua") -- dofile(menupath .. DIR_DELIM .. "store.lua")
@ -88,14 +90,11 @@ local function init_globals()
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic) menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
menudata.worldlist:set_sortmode("alphabetic") menudata.worldlist:set_sortmode("alphabetic")
local default_game = "default"
mm_texture.init() mm_texture.init()
-- Create main tabview -- Create main tabview
local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0}) local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0})
tv_main:set_autosave_tab(true)
tv_main:add(tabs.local_game) tv_main:add(tabs.local_game)
tv_main:add(tabs.play_online) tv_main:add(tabs.play_online)
@ -107,15 +106,19 @@ local function init_globals()
--tv_main:add(tabs.mods) --tv_main:add(tabs.mods)
tv_main:add(tabs.credits) tv_main:add(tabs.credits)
tv_main:set_autosave_tab(true)
tv_main:set_global_event_handler(main_event_handler) tv_main:set_global_event_handler(main_event_handler)
tv_main:set_fixed_size(false) tv_main:set_fixed_size(false)
tv_main:set_tab(core.settings:get("maintab_LAST")) local last_tab = core.settings:get("maintab_LAST")
if last_tab and tv_main.current_tab ~= last_tab then
tv_main:set_tab(last_tab)
end
ui.set_default("maintab") ui.set_default("maintab")
tv_main:show() tv_main:show()
-- Create modstore ui -- Create modstore ui
--if PLATFORM == "Android" then --if use_simple_menu then
-- modstore.init({x = 12, y = 6}, 3, 2) -- modstore.init({x = 12, y = 6}, 3, 2)
--else --else
-- modstore.init({x = 12, y = 8}, 4, 3) -- modstore.init({x = 12, y = 8}, 4, 3)

View File

@ -81,8 +81,7 @@ local function get_formspec(tabview, name, tabdata)
"text,align=right;" .. -- clients "text,align=right;" .. -- clients
"text,align=center,padding=0.25;" .. -- "/" "text,align=center,padding=0.25;" .. -- "/"
"text,align=right,padding=0.25;" .. -- clients_max "text,align=right,padding=0.25;" .. -- clients_max
image_column(fgettext("Creative mode"), "creative") .. ",padding=0.25;" .. image_column(fgettext("Server mode"), "damage") .. ",padding=0.25;" ..
image_column(fgettext("Damage enabled"), "damage") .. ",padding=0.25;" ..
image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" .. image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" ..
"color,span=1;" .. "color,span=1;" ..
"text,padding=0.25]" .. "text,padding=0.25]" ..

View File

@ -73,7 +73,7 @@ local Formatter = {
end end
} }
local widths = { 55, 9, 9, 9, 5, 5, 5 } local widths = { 50, 8, 8, 8, 5, 5, 5 }
local txt_row_format = sprintf(" %%-%ds | %%%ds | %%%ds | %%%ds | %%%ds | %%%ds | %%%ds", unpack(widths)) local txt_row_format = sprintf(" %%-%ds | %%%ds | %%%ds | %%%ds | %%%ds | %%%ds | %%%ds", unpack(widths))
local HR = {} local HR = {}

View File

@ -42,6 +42,12 @@ minetest.register_node("mesecons_button:button_stone_off", {
minetest.sound_play("mesecons_button_push", {pos=pos}) minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.get_node_timer(pos):start(1) minetest.get_node_timer(pos):start(1)
end, end,
on_rightclick = function (pos, node)
minetest.swap_node(pos, {name = "mesecons_button:button_stone_on", param2=node.param2})
mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.get_node_timer(pos):start(1)
end,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = { mesecons = {receptor = {
state = mesecon.state.off, state = mesecon.state.off,
@ -105,6 +111,12 @@ minetest.register_node("mesecons_button:button_wood_off", {
minetest.sound_play("mesecons_button_push", {pos=pos}) minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.get_node_timer(pos):start(1) minetest.get_node_timer(pos):start(1)
end, end,
on_rightclick = function (pos, node)
minetest.swap_node(pos, {name = "mesecons_button:button_wood_on", param2=node.param2})
mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.get_node_timer(pos):start(1)
end,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
mesecons = {receptor = { mesecons = {receptor = {
state = mesecon.state.off, state = mesecon.state.off,

View File

@ -36,9 +36,9 @@ end
for i = 1, 4 do for i = 1, 4 do
local groups = {} local groups = {}
if i == 1 then if i == 1 then
groups = {bendy = 2, snappy = 1, dig_immediate = 2} groups = {bendy = 2, snappy = 1, dig_immediate = 2, attached_node = 1}
else else
groups = {bendy = 2, snappy = 1, dig_immediate = 2, not_in_creative_inventory = 1} groups = {bendy = 2, snappy = 1, dig_immediate = 2, attached_node = 1, not_in_creative_inventory = 1}
end end
local delaytime local delaytime

View File

@ -3,6 +3,7 @@ minetest.register_node("mesecons_noteblock:noteblock", {
tiles = {"mesecons_noteblock.png"}, tiles = {"mesecons_noteblock.png"},
is_ground_content = false, is_ground_content = false,
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2}, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2},
stack_max = 1,
on_punch = function (pos, node) -- change sound when punched on_punch = function (pos, node) -- change sound when punched
node.param2 = (node.param2+1)%12 node.param2 = (node.param2+1)%12
mesecon.noteblock_play(pos, node.param2) mesecon.noteblock_play(pos, node.param2)

View File

@ -174,6 +174,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
"mesecons_piston_pusher_front.png" "mesecons_piston_pusher_front.png"
}, },
groups = {cracky = 3}, groups = {cracky = 3},
stack_max = 1,
paramtype2 = "facedir", paramtype2 = "facedir",
after_place_node = piston_orientate, after_place_node = piston_orientate,
mesecons_piston = pistonspec_normal, mesecons_piston = pistonspec_normal,
@ -253,6 +254,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
"mesecons_piston_pusher_front_sticky.png" "mesecons_piston_pusher_front_sticky.png"
}, },
groups = {cracky = 3}, groups = {cracky = 3},
stack_max = 1,
paramtype2 = "facedir", paramtype2 = "facedir",
after_place_node = piston_orientate, after_place_node = piston_orientate,
mesecons_piston = pistonspec_sticky, mesecons_piston = pistonspec_sticky,

View File

@ -93,7 +93,7 @@ mesecon.register_pressure_plate(
{"default_wood.png"}, {"default_wood.png"},
{"default_wood.png"}, {"default_wood.png"},
{{"default:wood", "default:wood"}}, {{"default:wood", "default:wood"}},
{ choppy = 3, oddly_breakable_by_hand = 3 }, { choppy = 3, oddly_breakable_by_hand = 3, attached_node = 1 },
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
mesecon.register_pressure_plate( mesecon.register_pressure_plate(
@ -102,5 +102,5 @@ mesecon.register_pressure_plate(
{"default_stone.png"}, {"default_stone.png"},
{"default_stone.png"}, {"default_stone.png"},
{{"default:cobble", "default:cobble"}}, {{"default:cobble", "default:cobble"}},
{ cracky = 3, oddly_breakable_by_hand = 3 }, { cracky = 3, oddly_breakable_by_hand = 3, attached_node = 1 },
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())

View File

@ -14,7 +14,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_on", {
wall_side = { -2/16, -8/16, -8/16, -8/16, 8/16, 8/16 }, wall_side = { -2/16, -8/16, -8/16, -8/16, 8/16, 8/16 },
}, },
drop = "mesecons_solarpanel:solar_panel_off", drop = "mesecons_solarpanel:solar_panel_off",
groups = {dig_immediate=3, not_in_creative_inventory = 1}, groups = {dig_immediate = 3, attached_node = 1, not_in_creative_inventory = 1},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
mesecons = {receptor = { mesecons = {receptor = {
state = mesecon.state.on, state = mesecon.state.on,
@ -38,7 +38,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", {
wall_top = { -8/16, 2/16, -8/16, 8/16, 8/16, 8/16 }, wall_top = { -8/16, 2/16, -8/16, 8/16, 8/16, 8/16 },
wall_side = { -2/16, -8/16, -8/16, -8/16, 8/16, 8/16 }, wall_side = { -2/16, -8/16, -8/16, -8/16, 8/16, 8/16 },
}, },
groups = {dig_immediate=3}, groups = {dig_immediate = 3, attached_node = 1},
description="Solar Panel", description="Solar Panel",
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
mesecons = {receptor = { mesecons = {receptor = {

View File

@ -58,7 +58,7 @@ local torch_selectionbox =
walkable = false, walkable = false,
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
selection_box = torch_selectionbox, selection_box = torch_selectionbox,
groups = {dig_immediate = 3, not_in_creative_inventory = 1}, groups = {dig_immediate = 3, attached_node = 1, not_in_creative_inventory = 1},
drop = "mesecons_torch:mesecon_torch_on", drop = "mesecons_torch:mesecon_torch_on",
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
mesecons = {receptor = { mesecons = {receptor = {

View File

@ -24,7 +24,6 @@ minetest.register_alias("glass", "default:glass")
minetest.register_alias("wooden_fence", "default:fence_wood") minetest.register_alias("wooden_fence", "default:fence_wood")
minetest.register_alias("ladder", "default:ladder") minetest.register_alias("ladder", "default:ladder")
minetest.register_alias("wood", "default:wood") minetest.register_alias("wood", "default:wood")
minetest.register_alias("cloud", "default:cloud")
minetest.register_alias("water_flowing", "default:water_flowing") minetest.register_alias("water_flowing", "default:water_flowing")
minetest.register_alias("water_source", "default:water_source") minetest.register_alias("water_source", "default:water_source")
minetest.register_alias("lava_flowing", "default:lava_flowing") minetest.register_alias("lava_flowing", "default:lava_flowing")

View File

@ -228,14 +228,12 @@ minetest.register_craftitem("default:glowstone_dust", {
minetest.register_craftitem("default:fish_raw", { minetest.register_craftitem("default:fish_raw", {
description = "Raw Fish", description = "Raw Fish",
groups = {},
inventory_image = "default_fish.png", inventory_image = "default_fish.png",
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
}) })
minetest.register_craftitem("default:fish", { minetest.register_craftitem("default:fish", {
description = "Cooked Fish", description = "Cooked Fish",
groups = {},
inventory_image = "default_fish_cooked.png", inventory_image = "default_fish_cooked.png",
on_use = minetest.item_eat(4), on_use = minetest.item_eat(4),
}) })

View File

@ -872,10 +872,11 @@ minetest.register_node("default:cactus", {
}) })
minetest.register_abm({ minetest.register_abm({
label = "Cactus damage",
nodenames = {"default:cactus"}, nodenames = {"default:cactus"},
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos)
local players = minetest.get_objects_inside_radius(pos, 1) local players = minetest.get_objects_inside_radius(pos, 1)
for i, player in ipairs(players) do for i, player in ipairs(players) do
player:set_hp(player:get_hp() - 2) player:set_hp(player:get_hp() - 2)
@ -1393,7 +1394,7 @@ minetest.register_node("default:ladder_wood", {
--wall_bottom = = <default> --wall_bottom = = <default>
--wall_side = = <default> --wall_side = = <default>
}, },
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2}, groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2, attached_node = 1},
legacy_wallmounted = true, legacy_wallmounted = true,
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
@ -1538,18 +1539,6 @@ minetest.register_node("default:quartz_pillar", {
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
--
-- Misc
--
minetest.register_node("default:cloud", {
description = "Cloud",
tiles = {"default_cloud.png"},
is_ground_content = false,
sounds = default.node_sound_defaults(),
groups = {not_in_creative_inventory = 1},
})
-- --
-- register trees for leafdecay -- register trees for leafdecay
-- --

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 B

View File

@ -489,7 +489,7 @@ function default.sapling_on_place(itemstack, placer, pointed_thing,
return itemstack return itemstack
end end
-- Check tree volume for protection -- Check tree volume for protection
if core.intersects_protection( if minetest.is_area_protected(
vector.add(pos, minp_relative), vector.add(pos, minp_relative),
vector.add(pos, maxp_relative), vector.add(pos, maxp_relative),
player_name, player_name,

View File

@ -43,8 +43,8 @@ minetest.register_node("fire:basic_flame", {
name = "fire_basic_flame_animated.png", name = "fire_basic_flame_animated.png",
animation = { animation = {
type = "vertical_frames", type = "vertical_frames",
aspect_w = 16, aspect_w = 32,
aspect_h = 16, aspect_h = 32,
length = 1 length = 1
}, },
}, },
@ -103,7 +103,7 @@ minetest.register_node("fire:permanent_flame", {
sunlight_propagates = true, sunlight_propagates = true,
floodable = true, floodable = true,
damage_per_second = 4, damage_per_second = 4,
groups = {igniter = 2, dig_immediate = 3}, groups = {igniter = 2, dig_immediate = 3, not_in_creative_inventory = 1},
drop = "", drop = "",
on_flood = flood_flame, on_flood = flood_flame,

View File

@ -122,7 +122,7 @@ minetest.register_node("itemframes:frame",{
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
groups = {choppy = 2, dig_immediate = 2}, groups = {choppy = 2, dig_immediate = 2, attached_node = 1},
legacy_wallmounted = true, legacy_wallmounted = true,
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer, itemstack) after_place_node = function(pos, placer, itemstack)

View File

@ -94,10 +94,8 @@ mobs:spawn({
name = "mobs_animal:bear", name = "mobs_animal:bear",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"},
min_light = 0, min_light = 0,
interval = 30, chance = 30000,
chance = 15000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })

View File

@ -104,10 +104,8 @@ mobs:spawn({
name = "mobs_animal:bunny", name = "mobs_animal:bunny",
nodes = {"default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, nodes = {"default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"},
min_light = 10, min_light = 10,
interval = 30, chance = 20000,
chance = 8000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })

View File

@ -77,10 +77,8 @@ mobs:spawn({
name = "mobs_animal:chicken", name = "mobs_animal:chicken",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},
min_light = 5, min_light = 5,
interval = 30, chance = 20000,
chance = 8000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })

View File

@ -129,10 +129,8 @@ mobs:spawn({
name = "mobs_animal:cow", name = "mobs_animal:cow",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_dry_grass", "default:dirt_with_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_dry_grass", "default:dirt_with_grass"},
min_light = 5, min_light = 5,
interval = 30, chance = 20000,
chance = 10000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })

View File

@ -62,10 +62,8 @@ mobs:spawn({
name = "mobs_animal:wolf", name = "mobs_animal:wolf",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"},
min_light = 0, min_light = 0,
interval = 30, chance = 20000,
chance = 15000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })

View File

@ -55,10 +55,8 @@ mobs:spawn({
name = "mobs_animal:kitten", name = "mobs_animal:kitten",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"},
min_light = 10, min_light = 10,
interval = 30, chance = 20000,
chance = 10000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })

View File

@ -59,10 +59,8 @@ mobs:spawn({
name = "mobs_animal:pig", name = "mobs_animal:pig",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"},
min_light = 5, min_light = 5,
interval = 30, chance = 20000,
chance = 15000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })

View File

@ -158,10 +158,8 @@ mobs:spawn({
name = "mobs_animal:sheep_white", name = "mobs_animal:sheep_white",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},
min_light = 7, min_light = 7,
interval = 30, chance = 100000,
chance = 40000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })
@ -169,10 +167,8 @@ mobs:spawn({
name = "mobs_animal:sheep_grey", name = "mobs_animal:sheep_grey",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},
min_light = 7, min_light = 7,
interval = 30, chance = 100000,
chance = 40000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })
@ -180,10 +176,8 @@ mobs:spawn({
name = "mobs_animal:sheep_dark_grey", name = "mobs_animal:sheep_dark_grey",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"},
min_light = 7, min_light = 7,
interval = 30, chance = 100000,
chance = 40000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })
@ -191,10 +185,8 @@ mobs:spawn({
name = "mobs_animal:sheep_black", name = "mobs_animal:sheep_black",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:dirt_with_dry_grass", "default:dirt_with_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:dirt_with_dry_grass", "default:dirt_with_grass"},
min_light = 7, min_light = 7,
interval = 30, chance = 100000,
chance = 40000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })
@ -202,9 +194,7 @@ mobs:spawn({
name = "mobs_animal:sheep_brown", name = "mobs_animal:sheep_brown",
nodes = {"default:dirt", "default:sand", "default:redsand", "default:dirt_with_dry_grass", "default:dirt_with_grass"}, nodes = {"default:dirt", "default:sand", "default:redsand", "default:dirt_with_dry_grass", "default:dirt_with_grass"},
min_light = 7, min_light = 7,
interval = 30, chance = 100000,
chance = 40000,
min_height = 0, min_height = 0,
max_height = 31000,
day_toggle = true, day_toggle = true,
}) })

View File

@ -52,11 +52,9 @@ mobs:register_mob("mobs_monster:skeleton", {
mobs:spawn({ mobs:spawn({
name = "mobs_monster:skeleton", name = "mobs_monster:skeleton",
nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"}, nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"},
min_light = 0,
max_light = 10, max_light = 10,
chance = 7000, chance = 15000,
min_height = -50, min_height = -64,
max_height = 31000,
}) })
mobs:register_egg("mobs_monster:skeleton", "Skeleton egg", "mobs_chicken_egg.png^default_bone.png", 1) mobs:register_egg("mobs_monster:skeleton", "Skeleton egg", "mobs_chicken_egg.png^default_bone.png", 1)

View File

@ -62,12 +62,9 @@ mobs:register_mob("mobs_monster:spider", {
mobs:spawn({ mobs:spawn({
name = "mobs_monster:spider", name = "mobs_monster:spider",
nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:redsand", "default:stone", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"}, nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:redsand", "default:stone", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"},
min_light = 0,
max_light = 12, max_light = 12,
interval = 30, chance = 20000,
chance = 10000, min_height = -64,
min_height = -50,
max_height = 31000,
}) })
mobs:register_egg("mobs_monster:spider", "Spider egg", "mobs_chicken_egg.png^mobs_cobweb.png", 1) mobs:register_egg("mobs_monster:spider", "Spider egg", "mobs_chicken_egg.png^mobs_cobweb.png", 1)
@ -138,12 +135,8 @@ mobs:register_mob("mobs_monster:small_spider", {
mobs:spawn({ mobs:spawn({
name = "mobs_monster:small_spider", name = "mobs_monster:small_spider",
nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:redsand", "default:stone", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"}, nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:redsand", "default:stone", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"},
min_light = 0, chance = 20000,
max_light = 15, min_height = -64,
interval = 30,
chance = 10000,
min_height = -50,
max_height = 31000,
}) })
minetest.register_craft({ minetest.register_craft({

View File

@ -52,11 +52,9 @@ mobs:register_mob("mobs_monster:zombie", {
mobs:spawn({ mobs:spawn({
name = "mobs_monster:zombie", name = "mobs_monster:zombie",
nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"}, nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"},
min_light = 0,
max_light = 10, max_light = 10,
chance = 7000, chance = 15000,
min_height = -50, min_height = -64,
max_height = 31000,
}) })
mobs:register_egg("mobs_monster:zombie", "Zombie Head", "zombie_head.png", 0) mobs:register_egg("mobs_monster:zombie", "Zombie Head", "zombie_head.png", 0)

View File

@ -37,7 +37,6 @@ end
-- Load settings -- Load settings
local damage_enabled = minetest.settings:get_bool("enable_damage")
local mobs_spawn = minetest.settings:get_bool("mobs_spawn") ~= false local mobs_spawn = minetest.settings:get_bool("mobs_spawn") ~= false
local peaceful_only = minetest.settings:get_bool("only_peaceful_mobs") local peaceful_only = minetest.settings:get_bool("only_peaceful_mobs")
local disable_blood = minetest.settings:get_bool("mobs_disable_blood") ~= true local disable_blood = minetest.settings:get_bool("mobs_disable_blood") ~= true
@ -48,8 +47,14 @@ local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= fa
local remove_far = minetest.settings:get_bool("remove_far_mobs") ~= false local remove_far = minetest.settings:get_bool("remove_far_mobs") ~= false
local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0 local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0
local show_health = minetest.settings:get_bool("mob_show_health") ~= true local show_health = minetest.settings:get_bool("mob_show_health") ~= true
local max_per_block = tonumber(minetest.settings:get("max_objects_per_block") or 99) local max_per_block = tonumber(minetest.settings:get("max_objects_per_block"))
local mob_chance_multiplier = tonumber(minetest.settings:get("mob_chance_multiplier") or 1) local mob_chance_multiplier = tonumber(minetest.settings:get("mob_chance_multiplier") or 1)
local lifetime = 1200 -- 20 min
local spawn_interval = 10
if not minetest.is_singleplayer() then
lifetime = 300 -- 5 min
spawn_interval = 60
end
-- Peaceful mode message so players will know there are no monsters -- Peaceful mode message so players will know there are no monsters
if peaceful_only then if peaceful_only then
@ -74,10 +79,6 @@ local node_ice = "default:ice"
local node_snowblock = "default:snowblock" local node_snowblock = "default:snowblock"
local node_snow = "default:snow" local node_snow = "default:snow"
mobs.fallback_node = minetest.registered_aliases["mapgen_dirt"] or "default:dirt" mobs.fallback_node = minetest.registered_aliases["mapgen_dirt"] or "default:dirt"
local lifetime = 1200 -- 20 min
if not minetest.is_singleplayer() then
lifetime = 300 -- 5 min
end
local mob_class = { local mob_class = {
stepheight = 1.1, -- was 0.6 stepheight = 1.1, -- was 0.6
@ -900,16 +901,15 @@ function mob_class:do_env_damage()
if self.light_damage ~= 0 then if self.light_damage ~= 0 then
local light = minetest.get_node_light(pos) or 0 local light = minetest.get_node_light(pos) or 0
if light >= self.light_damage_min if light >= self.light_damage_min
and light <= self.light_damage_max then and light <= self.light_damage_max then
self.health = self.health - self.light_damage self.health = self.health - self.light_damage
pos.y = pos.y + 0.75 -- for particle effect position pos.y = pos.y + 0.75 -- for particle effect position
effect(pos, 5, "heart.png") effect(pos, 5, "heart.png")
if show_health then
self.nametag = "Health: " .. self.health .. " / " .. self.hp_max self.nametag = "Health: " .. self.health .. " / " .. self.hp_max
self:update_tag() self:update_tag()
end
if self:check_for_death({type = "light"}) then return end if self:check_for_death({type = "light"}) then return end
end end
end end
@ -2707,22 +2707,6 @@ end
-- only play hit sound and show blood effects if damage is 1 or over -- only play hit sound and show blood effects if damage is 1 or over
if damage >= 1 then if damage >= 1 then
-- weapon sounds
--[[ if weapon_def.sounds then
local s = random(0, #weapon_def.sounds)
minetest.sound_play(weapon_def.sounds[s], {
object = self.object,
max_hear_distance = 8
})
else
minetest.sound_play("default_punch", {
object = self.object,
max_hear_distance = 5
})
end ]]
-- blood_particles -- blood_particles
if not disable_blood and self.blood_amount > 0 then if not disable_blood and self.blood_amount > 0 then
@ -3584,7 +3568,7 @@ function mobs:spawn(def)
def.neighbors or {"air"}, def.neighbors or {"air"},
def.min_light or 0, def.min_light or 0,
def.max_light or 15, def.max_light or 15,
def.interval or 30, def.interval or spawn_interval,
def.chance or 5000, def.chance or 5000,
def.active_object_count or 1, def.active_object_count or 1,
def.min_height or -31000, def.min_height or -31000,
@ -4166,7 +4150,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
end end
-- make sound when fed so many times -- make sound when fed so many times
--self:mob_sound(self.sounds.random) self:mob_sound(self.sounds.random)
end end
return true return true