From a78bb6cbd6d03f1bf73ce212016150b593ebd3ff Mon Sep 17 00:00:00 2001 From: MoNTE48 Date: Tue, 25 Jun 2019 01:00:18 +0200 Subject: [PATCH] Small update mainmenu. Cleanup and fixes --- builtin/game/item.lua | 3 ++ builtin/game/misc.lua | 20 +++++--- builtin/game/statbars.lua | 2 +- builtin/mainmenu/common.lua | 46 ++++++++---------- builtin/mainmenu/dlg_create_world.lua | 6 +-- builtin/mainmenu/dlg_delete_world.lua | 3 +- builtin/mainmenu/init.lua | 13 +++-- builtin/mainmenu/tab_online.lua | 3 +- builtin/profiler/reporter.lua | 2 +- .../files/bluestone/mesecons_button/init.lua | 12 +++++ .../files/bluestone/mesecons_delayer/init.lua | 4 +- .../bluestone/mesecons_lightstone/init.lua | 2 +- .../bluestone/mesecons_noteblock/init.lua | 1 + .../files/bluestone/mesecons_pistons/init.lua | 4 +- .../mesecons_pressureplates/init.lua | 4 +- .../bluestone/mesecons_solarpanel/init.lua | 4 +- .../files/bluestone/mesecons_torch/init.lua | 2 +- .../bluestone/mesecons_walllever/init.lua | 6 +-- games/default/files/default/aliases.lua | 1 - games/default/files/default/craftitems.lua | 2 - games/default/files/default/nodes.lua | 17 ++----- .../files/default/textures/default_cloud.png | Bin 83 -> 0 bytes games/default/files/default/trees.lua | 2 +- games/default/files/fire/init.lua | 6 +-- games/default/files/itemframes/init.lua | 2 +- games/default/files/mobs_animal/bear.lua | 4 +- games/default/files/mobs_animal/bunny.lua | 4 +- games/default/files/mobs_animal/chicken.lua | 4 +- games/default/files/mobs_animal/cow.lua | 4 +- games/default/files/mobs_animal/dog.lua | 4 +- games/default/files/mobs_animal/kitten.lua | 4 +- games/default/files/mobs_animal/pig.lua | 4 +- games/default/files/mobs_animal/sheep.lua | 20 ++------ games/default/files/mobs_monster/skeleton.lua | 6 +-- games/default/files/mobs_monster/spider.lua | 15 ++---- games/default/files/mobs_monster/zombie.lua | 6 +-- games/default/files/mobs_redo/api.lua | 42 +++++----------- 37 files changed, 119 insertions(+), 165 deletions(-) delete mode 100644 games/default/files/default/textures/default_cloud.png diff --git a/builtin/game/item.lua b/builtin/game/item.lua index 42fc8b0d7..f2d454032 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -514,6 +514,9 @@ function core.item_drop(itemstack, dropper, pos) local dropper_is_player = dropper and dropper:is_player() local p = table.copy(pos) local cnt = itemstack:get_count() + if not core.is_valid_pos(p) then + return + end if dropper_is_player then p.y = p.y + 1.2 if dropper:get_player_control().sneak then diff --git a/builtin/game/misc.lua b/builtin/game/misc.lua index b68bb4c06..ea142aa1e 100644 --- a/builtin/game/misc.lua +++ b/builtin/game/misc.lua @@ -162,7 +162,7 @@ end -- Checks if specified volume intersects a protected volume -- 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. -- 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 = {} 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 d[c] = (maxp[c] - minp[c]) / 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 - 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 @@ -192,13 +196,13 @@ function core.intersects_protection(minp, maxp, player_name, interval) local y = math.floor(yf + 0.5) for xf = minp.x, maxp.x, d.x do local x = math.floor(xf + 0.5) - if core.is_protected({x = x, y = y, z = z}, player_name) then - return true + local pos = {x = x, y = y, z = z} + if core.is_protected(pos, player_name) then + return pos end end end end - return false end diff --git a/builtin/game/statbars.lua b/builtin/game/statbars.lua index aa97361bf..136abe911 100644 --- a/builtin/game/statbars.lua +++ b/builtin/game/statbars.lua @@ -21,7 +21,7 @@ local breath_bar_definition = hud_elem_type = "statbar", position = {x = 0.5, y = 1}, alignment = {x = -1, y = -1}, - offset = {x = 10, y = -134}, + offset = {x = 8, y = -134}, size = {x = 24, y = 24}, text = "bubble.png", number = 20, diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index 072ac5b64..6fadb95cb 100644 --- a/builtin/mainmenu/common.lua +++ b/builtin/mainmenu/common.lua @@ -35,7 +35,7 @@ common_update_cached_supp_proto() -------------------------------------------------------------------------------- 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) else return '?' end end @@ -54,14 +54,16 @@ end function image_column(tooltip, flagname) return "image,tooltip=" .. core.formspec_escape(tooltip) .. "," .. "0=" .. core.formspec_escape(defaulttexturedir .. "blank.png") .. "," .. - "1=" .. core.formspec_escape(defaulttexturedir .. - (flagname and "server_flags_" .. flagname .. ".png" or "blank.png")) .. "," .. - "2=" .. core.formspec_escape(defaulttexturedir .. "server_ping_4.png") .. "," .. - "3=" .. core.formspec_escape(defaulttexturedir .. "server_ping_3.png") .. "," .. - "4=" .. core.formspec_escape(defaulttexturedir .. "server_ping_2.png") .. "," .. - "5=" .. core.formspec_escape(defaulttexturedir .. "server_ping_1.png") .. "," .. - "6=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mc.png") .. "," .. - "7=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mt.png") + "1=" .. core.formspec_escape(defaulttexturedir .. "server_flags_favorite.png") .. "," .. + "2=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mc.png") .. "," .. + "3=" .. core.formspec_escape(defaulttexturedir .. "server_flags_mt.png") .. "," .. + "4=" .. core.formspec_escape(defaulttexturedir .. "server_flags_damage.png") .. "," .. + "5=" .. core.formspec_escape(defaulttexturedir .. "server_flags_creative.png") .. "," .. + "6=" .. core.formspec_escape(defaulttexturedir .. "server_flags_pvp.png") .. "," .. + "14=" .. core.formspec_escape(defaulttexturedir .. "server_ping_4.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 -------------------------------------------------------------------------------- @@ -102,22 +104,22 @@ function render_serverlist_row(spec, is_favorite, is_approved) details = "1," else if is_approved then - details = "6," + details = "2," else - details = "7," + details = "3," end end if spec.ping then local ping = spec.ping * 1000 if ping <= 50 then - details = details .. "2," + details = details .. "14," elseif ping <= 100 then - details = details .. "3," + details = details .. "13," elseif ping <= 250 then - details = details .. "4," + details = details .. "12," else - details = details .. "5," + details = details .. "11," end else details = details .. "0," @@ -134,7 +136,7 @@ function render_serverlist_row(spec, is_favorite, is_approved) elseif clients_percent <= 60 then clients_color = '#a1e587' -- 0-60%: green elseif clients_percent <= 90 then clients_color = '#ffdc97' -- 60-90%: yellow elseif clients_percent == 100 then clients_color = '#dd5b5b' -- full server: red (darker) - else clients_color = '#ffba97' -- 90-100%: orange + else clients_color = '#ffba97' -- 90-100%: orange end details = details .. clients_color .. ',' .. @@ -147,20 +149,14 @@ function render_serverlist_row(spec, is_favorite, is_approved) details = details .. ',?,/,?,' end - if spec.creative then - details = details .. "1," - else - details = details .. "0," - end - if spec.damage then - details = details .. "1," + details = details .. "4," else - details = details .. "0," + details = details .. "5," end if spec.pvp then - details = details .. "1," + details = details .. "6," else details = details .. "0," end diff --git a/builtin/mainmenu/dlg_create_world.lua b/builtin/mainmenu/dlg_create_world.lua index d8059936a..af3470ebe 100644 --- a/builtin/mainmenu/dlg_create_world.lua +++ b/builtin/mainmenu/dlg_create_world.lua @@ -56,13 +56,13 @@ local function create_world_formspec(dialogdata) "size[11.5,3.75,false]" .. "background[0,0;11.5,3;" .. core.formspec_escape(defaulttexturedir .. "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;;]" .. - "label[2,1;" .. fgettext("Seed") .. "]".. + "label[1.5,1;" .. fgettext("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[600.2,6;6.3;games;" .. gamemgr.gamelist() .. ";1]" .. diff --git a/builtin/mainmenu/dlg_delete_world.lua b/builtin/mainmenu/dlg_delete_world.lua index 8ab68912c..06751b905 100644 --- a/builtin/mainmenu/dlg_delete_world.lua +++ b/builtin/mainmenu/dlg_delete_world.lua @@ -21,8 +21,7 @@ local function delete_world_formspec(dialogdata) "size[11.5,3.75,false]" .. "background[0,0;11.5,3;" .. core.formspec_escape(defaulttexturedir .. "bg_dialog.png") .. ";true]" .. - "label[5,1.4;" .. - fgettext("Delete World") .. "]" .. + "label[5,1.4;" .. fgettext("Delete World") .. "]" .. "label[5,1.8;" .. fgettext("\"$1\"?", dialogdata.delete_name) .. "]" .. "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") .. "]" diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua index 6981416d8..3eb9afba0 100644 --- a/builtin/mainmenu/init.lua +++ b/builtin/mainmenu/init.lua @@ -36,11 +36,13 @@ dofile(basepath .. DIR_DELIM .. "fstk" .. DIR_DELIM .. "ui.lua") dofile(menupath .. DIR_DELIM .. "common.lua") dofile(menupath .. DIR_DELIM .. "gamemgr.lua") dofile(menupath .. DIR_DELIM .. "textures.lua") + dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua") --dofile(menupath .. DIR_DELIM .. "dlg_delete_mod.lua") dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua") --dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua") dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua") + if not use_simple_menu then dofile(menupath .. DIR_DELIM .. "modmgr.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:set_sortmode("alphabetic") - local default_game = "default" - mm_texture.init() -- Create main tabview 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.play_online) @@ -107,15 +106,19 @@ local function init_globals() --tv_main:add(tabs.mods) tv_main:add(tabs.credits) + tv_main:set_autosave_tab(true) tv_main:set_global_event_handler(main_event_handler) 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") tv_main:show() -- Create modstore ui - --if PLATFORM == "Android" then + --if use_simple_menu then -- modstore.init({x = 12, y = 6}, 3, 2) --else -- modstore.init({x = 12, y = 8}, 4, 3) diff --git a/builtin/mainmenu/tab_online.lua b/builtin/mainmenu/tab_online.lua index 27d0a7cd3..1424c9b9c 100644 --- a/builtin/mainmenu/tab_online.lua +++ b/builtin/mainmenu/tab_online.lua @@ -81,8 +81,7 @@ local function get_formspec(tabview, name, tabdata) "text,align=right;" .. -- clients "text,align=center,padding=0.25;" .. -- "/" "text,align=right,padding=0.25;" .. -- clients_max - image_column(fgettext("Creative mode"), "creative") .. ",padding=0.25;" .. - image_column(fgettext("Damage enabled"), "damage") .. ",padding=0.25;" .. + image_column(fgettext("Server mode"), "damage") .. ",padding=0.25;" .. image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" .. "color,span=1;" .. "text,padding=0.25]" .. diff --git a/builtin/profiler/reporter.lua b/builtin/profiler/reporter.lua index 95b969d71..f06e7f117 100644 --- a/builtin/profiler/reporter.lua +++ b/builtin/profiler/reporter.lua @@ -73,7 +73,7 @@ local Formatter = { 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 HR = {} diff --git a/games/default/files/bluestone/mesecons_button/init.lua b/games/default/files/bluestone/mesecons_button/init.lua index 9e90abaf1..043831fcc 100644 --- a/games/default/files/bluestone/mesecons_button/init.lua +++ b/games/default/files/bluestone/mesecons_button/init.lua @@ -42,6 +42,12 @@ minetest.register_node("mesecons_button:button_stone_off", { minetest.sound_play("mesecons_button_push", {pos=pos}) minetest.get_node_timer(pos):start(1) 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(), mesecons = {receptor = { 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.get_node_timer(pos):start(1) 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(), mesecons = {receptor = { state = mesecon.state.off, diff --git a/games/default/files/bluestone/mesecons_delayer/init.lua b/games/default/files/bluestone/mesecons_delayer/init.lua index 02f17f628..4eafe3eec 100644 --- a/games/default/files/bluestone/mesecons_delayer/init.lua +++ b/games/default/files/bluestone/mesecons_delayer/init.lua @@ -36,9 +36,9 @@ end for i = 1, 4 do local groups = {} if i == 1 then - groups = {bendy = 2, snappy = 1, dig_immediate = 2} + groups = {bendy = 2, snappy = 1, dig_immediate = 2, attached_node = 1} 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 local delaytime diff --git a/games/default/files/bluestone/mesecons_lightstone/init.lua b/games/default/files/bluestone/mesecons_lightstone/init.lua index 630c54aaa..7cb52a68f 100644 --- a/games/default/files/bluestone/mesecons_lightstone/init.lua +++ b/games/default/files/bluestone/mesecons_lightstone/init.lua @@ -32,7 +32,7 @@ minetest.register_node("mesecons_lightstone:lightstone_off", { minetest.register_node("mesecons_lightstone:lightstone_on", { tiles = {"jeija_lightstone_gray_on.png"}, is_ground_content = false, - groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2}, + groups = {cracky=2, not_in_creative_inventory=1, mesecon = 2}, drop = "mesecons_lightstone:lightstone_off", light_source = minetest.LIGHT_MAX - 2, sounds = default.node_sound_glass_defaults(), diff --git a/games/default/files/bluestone/mesecons_noteblock/init.lua b/games/default/files/bluestone/mesecons_noteblock/init.lua index d7aa135bf..0fb8d6bd5 100644 --- a/games/default/files/bluestone/mesecons_noteblock/init.lua +++ b/games/default/files/bluestone/mesecons_noteblock/init.lua @@ -3,6 +3,7 @@ minetest.register_node("mesecons_noteblock:noteblock", { tiles = {"mesecons_noteblock.png"}, is_ground_content = false, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2}, + stack_max = 1, on_punch = function (pos, node) -- change sound when punched node.param2 = (node.param2+1)%12 mesecon.noteblock_play(pos, node.param2) diff --git a/games/default/files/bluestone/mesecons_pistons/init.lua b/games/default/files/bluestone/mesecons_pistons/init.lua index e9ebb54b4..c1cb23fa2 100644 --- a/games/default/files/bluestone/mesecons_pistons/init.lua +++ b/games/default/files/bluestone/mesecons_pistons/init.lua @@ -65,7 +65,7 @@ local piston_remove_pusher = function (pos, node) return end - minetest.remove_node(pusherpos) + minetest.remove_node(pusherpos) minetest.sound_play("piston_retract", { pos = pos, max_hear_distance = 20, @@ -174,6 +174,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", { "mesecons_piston_pusher_front.png" }, groups = {cracky = 3}, + stack_max = 1, paramtype2 = "facedir", after_place_node = piston_orientate, mesecons_piston = pistonspec_normal, @@ -253,6 +254,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", { "mesecons_piston_pusher_front_sticky.png" }, groups = {cracky = 3}, + stack_max = 1, paramtype2 = "facedir", after_place_node = piston_orientate, mesecons_piston = pistonspec_sticky, diff --git a/games/default/files/bluestone/mesecons_pressureplates/init.lua b/games/default/files/bluestone/mesecons_pressureplates/init.lua index bbb7d930d..5116873ff 100644 --- a/games/default/files/bluestone/mesecons_pressureplates/init.lua +++ b/games/default/files/bluestone/mesecons_pressureplates/init.lua @@ -93,7 +93,7 @@ mesecon.register_pressure_plate( {"default_wood.png"}, {"default_wood.png"}, {{"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()) mesecon.register_pressure_plate( @@ -102,5 +102,5 @@ mesecon.register_pressure_plate( {"default_stone.png"}, {"default_stone.png"}, {{"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()) diff --git a/games/default/files/bluestone/mesecons_solarpanel/init.lua b/games/default/files/bluestone/mesecons_solarpanel/init.lua index 09c5155c4..923af64a6 100644 --- a/games/default/files/bluestone/mesecons_solarpanel/init.lua +++ b/games/default/files/bluestone/mesecons_solarpanel/init.lua @@ -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 }, }, 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(), mesecons = {receptor = { 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_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", sounds = default.node_sound_glass_defaults(), mesecons = {receptor = { diff --git a/games/default/files/bluestone/mesecons_torch/init.lua b/games/default/files/bluestone/mesecons_torch/init.lua index f92853999..7f32eb3e3 100644 --- a/games/default/files/bluestone/mesecons_torch/init.lua +++ b/games/default/files/bluestone/mesecons_torch/init.lua @@ -58,7 +58,7 @@ local torch_selectionbox = walkable = false, paramtype2 = "wallmounted", 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", sounds = default.node_sound_defaults(), mesecons = {receptor = { diff --git a/games/default/files/bluestone/mesecons_walllever/init.lua b/games/default/files/bluestone/mesecons_walllever/init.lua index 4b35f7c5f..11a18a5c3 100644 --- a/games/default/files/bluestone/mesecons_walllever/init.lua +++ b/games/default/files/bluestone/mesecons_walllever/init.lua @@ -39,7 +39,7 @@ mesecon.register_node("mesecons_walllever:wall_lever", { }, node_box = { type = "fixed", - fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base + fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base { -1/16, -8/16, 7/16, 1/16, 0/16, 5/16 }} -- the lever itself. }, mesecons = {receptor = { @@ -58,8 +58,8 @@ mesecon.register_node("mesecons_walllever:wall_lever", { }, node_box = { type = "fixed", - fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base - { -1/16, 0/16, 7/16, 1/16, 8/16, 5/16 }} -- the lever itself. + fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base + { -1/16, 0/16, 7/16, 1/16, 8/16, 5/16 }} -- the lever itself. }, on_rotate = false, mesecons = {receptor = { diff --git a/games/default/files/default/aliases.lua b/games/default/files/default/aliases.lua index edf8c3a51..9dd6cd1c1 100644 --- a/games/default/files/default/aliases.lua +++ b/games/default/files/default/aliases.lua @@ -24,7 +24,6 @@ minetest.register_alias("glass", "default:glass") minetest.register_alias("wooden_fence", "default:fence_wood") minetest.register_alias("ladder", "default:ladder") minetest.register_alias("wood", "default:wood") -minetest.register_alias("cloud", "default:cloud") minetest.register_alias("water_flowing", "default:water_flowing") minetest.register_alias("water_source", "default:water_source") minetest.register_alias("lava_flowing", "default:lava_flowing") diff --git a/games/default/files/default/craftitems.lua b/games/default/files/default/craftitems.lua index 88abd3325..6d60d8903 100644 --- a/games/default/files/default/craftitems.lua +++ b/games/default/files/default/craftitems.lua @@ -228,14 +228,12 @@ minetest.register_craftitem("default:glowstone_dust", { minetest.register_craftitem("default:fish_raw", { description = "Raw Fish", - groups = {}, inventory_image = "default_fish.png", on_use = minetest.item_eat(2), }) minetest.register_craftitem("default:fish", { description = "Cooked Fish", - groups = {}, inventory_image = "default_fish_cooked.png", on_use = minetest.item_eat(4), }) diff --git a/games/default/files/default/nodes.lua b/games/default/files/default/nodes.lua index 3acaac368..3ed66d68a 100644 --- a/games/default/files/default/nodes.lua +++ b/games/default/files/default/nodes.lua @@ -872,10 +872,11 @@ minetest.register_node("default:cactus", { }) minetest.register_abm({ + label = "Cactus damage", nodenames = {"default:cactus"}, interval = 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) for i, player in ipairs(players) do player:set_hp(player:get_hp() - 2) @@ -1393,7 +1394,7 @@ minetest.register_node("default:ladder_wood", { --wall_bottom = = --wall_side = = }, - 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, sounds = default.node_sound_wood_defaults(), }) @@ -1538,18 +1539,6 @@ minetest.register_node("default:quartz_pillar", { 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 -- diff --git a/games/default/files/default/textures/default_cloud.png b/games/default/files/default/textures/default_cloud.png deleted file mode 100644 index 8529fa89ed664ab9358a77a9047ed98deb4e4c4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 83 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;bAV5X>;M1%mmiTn0pxOfx;TbZ c#3d^T0yzc@jEx@4T!1VFPgg&ebxsLQ0E_bx;{X5v diff --git a/games/default/files/default/trees.lua b/games/default/files/default/trees.lua index de6c04e7d..82cc8bf1f 100644 --- a/games/default/files/default/trees.lua +++ b/games/default/files/default/trees.lua @@ -489,7 +489,7 @@ function default.sapling_on_place(itemstack, placer, pointed_thing, return itemstack end -- Check tree volume for protection - if core.intersects_protection( + if minetest.is_area_protected( vector.add(pos, minp_relative), vector.add(pos, maxp_relative), player_name, diff --git a/games/default/files/fire/init.lua b/games/default/files/fire/init.lua index ebf3ba03d..f3d904d5d 100644 --- a/games/default/files/fire/init.lua +++ b/games/default/files/fire/init.lua @@ -43,8 +43,8 @@ minetest.register_node("fire:basic_flame", { name = "fire_basic_flame_animated.png", animation = { type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, + aspect_w = 32, + aspect_h = 32, length = 1 }, }, @@ -103,7 +103,7 @@ minetest.register_node("fire:permanent_flame", { sunlight_propagates = true, floodable = true, damage_per_second = 4, - groups = {igniter = 2, dig_immediate = 3}, + groups = {igniter = 2, dig_immediate = 3, not_in_creative_inventory = 1}, drop = "", on_flood = flood_flame, diff --git a/games/default/files/itemframes/init.lua b/games/default/files/itemframes/init.lua index 90d3d41ad..7823abb13 100644 --- a/games/default/files/itemframes/init.lua +++ b/games/default/files/itemframes/init.lua @@ -122,7 +122,7 @@ minetest.register_node("itemframes:frame",{ paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, - groups = {choppy = 2, dig_immediate = 2}, + groups = {choppy = 2, dig_immediate = 2, attached_node = 1}, legacy_wallmounted = true, sounds = default.node_sound_wood_defaults(), after_place_node = function(pos, placer, itemstack) diff --git a/games/default/files/mobs_animal/bear.lua b/games/default/files/mobs_animal/bear.lua index cdef7e07f..d9398b375 100644 --- a/games/default/files/mobs_animal/bear.lua +++ b/games/default/files/mobs_animal/bear.lua @@ -94,10 +94,8 @@ mobs:spawn({ 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"}, min_light = 0, - interval = 30, - chance = 15000, + chance = 30000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/games/default/files/mobs_animal/bunny.lua b/games/default/files/mobs_animal/bunny.lua index afe4f019f..ec54eeb2d 100644 --- a/games/default/files/mobs_animal/bunny.lua +++ b/games/default/files/mobs_animal/bunny.lua @@ -104,10 +104,8 @@ mobs:spawn({ name = "mobs_animal:bunny", nodes = {"default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, min_light = 10, - interval = 30, - chance = 8000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/games/default/files/mobs_animal/chicken.lua b/games/default/files/mobs_animal/chicken.lua index f900d0936..f7627e0c6 100644 --- a/games/default/files/mobs_animal/chicken.lua +++ b/games/default/files/mobs_animal/chicken.lua @@ -77,10 +77,8 @@ mobs:spawn({ name = "mobs_animal:chicken", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, min_light = 5, - interval = 30, - chance = 8000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/games/default/files/mobs_animal/cow.lua b/games/default/files/mobs_animal/cow.lua index 73c0e2496..2864498c6 100644 --- a/games/default/files/mobs_animal/cow.lua +++ b/games/default/files/mobs_animal/cow.lua @@ -129,10 +129,8 @@ mobs:spawn({ name = "mobs_animal:cow", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_dry_grass", "default:dirt_with_grass"}, min_light = 5, - interval = 30, - chance = 10000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/games/default/files/mobs_animal/dog.lua b/games/default/files/mobs_animal/dog.lua index f3e6baeb7..7fc7bf7c9 100644 --- a/games/default/files/mobs_animal/dog.lua +++ b/games/default/files/mobs_animal/dog.lua @@ -62,10 +62,8 @@ mobs:spawn({ 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"}, min_light = 0, - interval = 30, - chance = 15000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/games/default/files/mobs_animal/kitten.lua b/games/default/files/mobs_animal/kitten.lua index 51264ef22..bdb0eee35 100644 --- a/games/default/files/mobs_animal/kitten.lua +++ b/games/default/files/mobs_animal/kitten.lua @@ -55,10 +55,8 @@ mobs:spawn({ 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"}, min_light = 10, - interval = 30, - chance = 10000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/games/default/files/mobs_animal/pig.lua b/games/default/files/mobs_animal/pig.lua index 8a355a617..56409908b 100644 --- a/games/default/files/mobs_animal/pig.lua +++ b/games/default/files/mobs_animal/pig.lua @@ -59,10 +59,8 @@ mobs:spawn({ 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"}, min_light = 5, - interval = 30, - chance = 15000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/games/default/files/mobs_animal/sheep.lua b/games/default/files/mobs_animal/sheep.lua index 82a4e4265..35edde022 100644 --- a/games/default/files/mobs_animal/sheep.lua +++ b/games/default/files/mobs_animal/sheep.lua @@ -158,10 +158,8 @@ mobs:spawn({ name = "mobs_animal:sheep_white", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, min_light = 7, - interval = 30, - chance = 40000, + chance = 100000, min_height = 0, - max_height = 31000, day_toggle = true, }) @@ -169,10 +167,8 @@ mobs:spawn({ name = "mobs_animal:sheep_grey", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, min_light = 7, - interval = 30, - chance = 40000, + chance = 100000, min_height = 0, - max_height = 31000, day_toggle = true, }) @@ -180,10 +176,8 @@ mobs:spawn({ 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"}, min_light = 7, - interval = 30, - chance = 40000, + chance = 100000, min_height = 0, - max_height = 31000, day_toggle = true, }) @@ -191,10 +185,8 @@ mobs:spawn({ name = "mobs_animal:sheep_black", nodes = {"default:dirt", "default:sand", "default:redsand", "default:dirt_with_dry_grass", "default:dirt_with_grass"}, min_light = 7, - interval = 30, - chance = 40000, + chance = 100000, min_height = 0, - max_height = 31000, day_toggle = true, }) @@ -202,9 +194,7 @@ mobs:spawn({ name = "mobs_animal:sheep_brown", nodes = {"default:dirt", "default:sand", "default:redsand", "default:dirt_with_dry_grass", "default:dirt_with_grass"}, min_light = 7, - interval = 30, - chance = 40000, + chance = 100000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/games/default/files/mobs_monster/skeleton.lua b/games/default/files/mobs_monster/skeleton.lua index 4978a3f28..9e3fba3e0 100644 --- a/games/default/files/mobs_monster/skeleton.lua +++ b/games/default/files/mobs_monster/skeleton.lua @@ -52,11 +52,9 @@ mobs:register_mob("mobs_monster:skeleton", { mobs:spawn({ 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"}, - min_light = 0, max_light = 10, - chance = 7000, - min_height = -50, - max_height = 31000, + chance = 15000, + min_height = -64, }) mobs:register_egg("mobs_monster:skeleton", "Skeleton egg", "mobs_chicken_egg.png^default_bone.png", 1) diff --git a/games/default/files/mobs_monster/spider.lua b/games/default/files/mobs_monster/spider.lua index 5b8eeb791..3d03ed2a4 100644 --- a/games/default/files/mobs_monster/spider.lua +++ b/games/default/files/mobs_monster/spider.lua @@ -62,12 +62,9 @@ mobs:register_mob("mobs_monster:spider", { mobs:spawn({ 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"}, - min_light = 0, max_light = 12, - interval = 30, - chance = 10000, - min_height = -50, - max_height = 31000, + chance = 20000, + min_height = -64, }) 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({ 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"}, - min_light = 0, - max_light = 15, - interval = 30, - chance = 10000, - min_height = -50, - max_height = 31000, + chance = 20000, + min_height = -64, }) minetest.register_craft({ diff --git a/games/default/files/mobs_monster/zombie.lua b/games/default/files/mobs_monster/zombie.lua index f1c7d118d..5bef20165 100644 --- a/games/default/files/mobs_monster/zombie.lua +++ b/games/default/files/mobs_monster/zombie.lua @@ -52,11 +52,9 @@ mobs:register_mob("mobs_monster:zombie", { mobs:spawn({ 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"}, - min_light = 0, max_light = 10, - chance = 7000, - min_height = -50, - max_height = 31000, + chance = 15000, + min_height = -64, }) mobs:register_egg("mobs_monster:zombie", "Zombie Head", "zombie_head.png", 0) diff --git a/games/default/files/mobs_redo/api.lua b/games/default/files/mobs_redo/api.lua index 879cf0660..2d35bf6b2 100644 --- a/games/default/files/mobs_redo/api.lua +++ b/games/default/files/mobs_redo/api.lua @@ -37,7 +37,6 @@ end -- Load settings -local damage_enabled = minetest.settings:get_bool("enable_damage") local mobs_spawn = minetest.settings:get_bool("mobs_spawn") ~= false local peaceful_only = minetest.settings:get_bool("only_peaceful_mobs") 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 difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0 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 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 if peaceful_only then @@ -74,10 +79,6 @@ local node_ice = "default:ice" local node_snowblock = "default:snowblock" local node_snow = "default:snow" 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 = { stepheight = 1.1, -- was 0.6 @@ -900,16 +901,15 @@ function mob_class:do_env_damage() if self.light_damage ~= 0 then local light = minetest.get_node_light(pos) or 0 - if light >= self.light_damage_min and light <= self.light_damage_max then - self.health = self.health - self.light_damage pos.y = pos.y + 0.75 -- for particle effect position effect(pos, 5, "heart.png") - self.nametag = "Health: " .. self.health .. " / " .. self.hp_max - self:update_tag() - + if show_health then + self.nametag = "Health: " .. self.health .. " / " .. self.hp_max + self:update_tag() + end if self:check_for_death({type = "light"}) then return end end end @@ -2707,22 +2707,6 @@ end -- only play hit sound and show blood effects if damage is 1 or over 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 if not disable_blood and self.blood_amount > 0 then @@ -3584,7 +3568,7 @@ function mobs:spawn(def) def.neighbors or {"air"}, def.min_light or 0, def.max_light or 15, - def.interval or 30, + def.interval or spawn_interval, def.chance or 5000, def.active_object_count or 1, def.min_height or -31000, @@ -4166,7 +4150,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame) end -- make sound when fed so many times - --self:mob_sound(self.sounds.random) + self:mob_sound(self.sounds.random) end return true