From 6eb810339b284a3b96c0c4e031fe9d1e48143611 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sun, 26 Jul 2020 17:42:38 -0400 Subject: [PATCH 001/152] Cleanup potion functions - check for player effects at login to ensure no holdovers exist --- mods/ITEMS/mcl_potions/functions.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index dab87f506..0704093cd 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -276,6 +276,8 @@ function mcl_potions._reset_player_effects(player) if is_invisible[player] then mcl_potions.make_invisible(player, false) is_invisible[player] = nil + else --ensure player isn't invisible if he shouldn't be + mcl_potions.make_invisible(player, false) end if is_poisoned[player] then @@ -301,16 +303,22 @@ function mcl_potions._reset_player_effects(player) if is_leaping[player] then is_leaping[player] = nil playerphysics.remove_physics_factor(player, "jump", "mcl_potions:leaping") + else -- ensure no effects are stuck from previous potions + playerphysics.remove_physics_factor(player, "jump", "mcl_potions:leaping") end if is_swift[player] then is_swift[player] = nil playerphysics.remove_physics_factor(player, "speed", "mcl_potions:swiftness") + else -- ensure no effects are stuck from previous potions + playerphysics.remove_physics_factor(player, "speed", "mcl_potions:swiftness") end if is_cat[player] then player:override_day_night_ratio(nil) is_cat[player] = nil + else -- ensure no effects are stuck from previous potions + player:override_day_night_ratio(nil) end if is_fire_proof[player] then @@ -321,6 +329,10 @@ end minetest.register_on_leaveplayer( function(player) mcl_potions._reset_player_effects(player) end) minetest.register_on_dieplayer( function(player) mcl_potions._reset_player_effects(player) end) +-- TODO It's not MC-like to remove all potion effects when a player leaves or returns, but...it keeps +-- the server from crashing when it loops for a player that isn't online and by resetting on join, it +-- avoids effects present that shouldn't be +minetest.register_on_joinplayer( function(player) mcl_potions._reset_player_effects(player) end) function mcl_potions.is_obj_hit(self, pos) @@ -350,6 +362,7 @@ function mcl_potions.make_invisible(player, toggle) local entity = player:get_luaentity() if toggle then -- hide player + if player:is_player() then is_invisible[player].old_size = player:get_properties().visual_size elseif entity then @@ -357,11 +370,15 @@ function mcl_potions.make_invisible(player, toggle) else -- if not a player or entity, do nothing return end + player:set_properties({visual_size = {x = 0, y = 0}}) player:set_nametag_attributes({color = {a = 0}}) - else -- show player + + elseif is_invisible[player] then -- show player + player:set_properties({visual_size = is_invisible[player].old_size}) player:set_nametag_attributes({color = {a = 255}}) + end end From c78270e70b47fc416f2be2e4116d84e8789e5494 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 27 Jul 2020 00:45:53 +0400 Subject: [PATCH 002/152] Bed occupation fix --- mods/ITEMS/mcl_beds/functions.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index d73154ee4..abf9683a2 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -115,13 +115,16 @@ local function lay_down(player, pos, bed_pos, state, skip) mcl_beds.player[name] = nil player_in_bed = player_in_bed - 1 end + mcl_beds.pos[name] = nil + mcl_beds.bed_pos[name] = nil + if p then + player:set_pos(p) + end + -- skip here to prevent sending player specific changes (used for leaving players) if skip then return false end - if p then - player:set_pos(p) - end -- physics, eye_offset, etc player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}) @@ -134,8 +137,6 @@ local function lay_down(player, pos, bed_pos, state, skip) player:get_meta():set_string("mcl_beds:sleeping", "false") hud_flags.wielditem = true mcl_player.player_set_animation(player, "stand" , 30) - mcl_beds.pos[name] = nil - mcl_beds.bed_pos[name] = nil -- lay down else @@ -360,7 +361,6 @@ end) minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() lay_down(player, nil, nil, false, true) - mcl_beds.player[name] = nil if check_in_beds() then minetest.after(5, function() if check_in_beds() then From 7d1f8ac314e92374642437e73edb95dfd3db6bc9 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 27 Jul 2020 01:12:10 +0400 Subject: [PATCH 003/152] Velocity check adjusted in mcl_beds --- mods/ITEMS/mcl_beds/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index abf9683a2..3bfe9e578 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -83,7 +83,7 @@ local function lay_down(player, pos, bed_pos, state, skip) end -- No sleeping while moving. Slightly different behaviour than in MC. - if vector.length(player:get_player_velocity()) > 0.001 then + if vector.length(player:get_player_velocity()) > 0.125 then minetest.chat_send_player(name, S("You have to stop moving before going to bed!")) return false end From 0cc179acc6b04c14589921a81c570491bb41db5e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 27 Jul 2020 07:46:11 +0200 Subject: [PATCH 004/152] Add warning about bed velocity --- mods/ITEMS/mcl_beds/functions.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index 3bfe9e578..de2b75662 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -83,6 +83,9 @@ local function lay_down(player, pos, bed_pos, state, skip) end -- No sleeping while moving. Slightly different behaviour than in MC. + -- FIXME: Velocity threshold should be 0.01 but Minetest 5.3.0 + -- sometimes reports incorrect Y speed. A velocity threshold + -- of 0.125 still seems good enough. if vector.length(player:get_player_velocity()) > 0.125 then minetest.chat_send_player(name, S("You have to stop moving before going to bed!")) return false From e85c00ea02c7732e7111e885e67784595e61535c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Mon, 27 Jul 2020 19:26:01 +0200 Subject: [PATCH 005/152] Show custom name in UI of Chest and Shulker Box --- mods/ITEMS/mcl_chests/init.lua | 64 +++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index a200d3d32..0b096e2cd 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -197,6 +197,9 @@ minetest.register_node("mcl_chests:"..basename, { minetest.swap_node(pos, { name = "mcl_chests:"..canonical_basename, param2 = param2 }) end end, + after_place_node = function(pos, placer, itemstack, pointed_thing) + minetest.get_meta(pos):set_string("name", itemstack:get_meta():get_string("name")) + end, after_dig_node = drop_items_chest, on_blast = on_chest_blast, allow_metadata_inventory_move = protection_check_move, @@ -224,10 +227,15 @@ minetest.register_node("mcl_chests:"..basename, { _mcl_hardness = 2.5, on_rightclick = function(pos, node, clicker) + local name = minetest.get_meta(pos):get_string("name") + if name == "" then + name = S("Chest") + end + minetest.show_formspec(clicker:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z, "size[9,8.75]".. - "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Chest"))).."]".. + "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]".. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,0.5,9,3).. "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. @@ -270,6 +278,9 @@ minetest.register_node("mcl_chests:"..basename.."_left", { minetest.swap_node(pos, n) end end, + after_place_node = function(pos, placer, itemstack, pointed_thing) + minetest.get_meta(pos):set_string("name", itemstack:get_meta():get_string("name")) + end, on_destruct = function(pos) local n = minetest.get_node(pos) if n.name == "mcl_chests:"..basename then @@ -345,11 +356,18 @@ minetest.register_node("mcl_chests:"..basename.."_left", { on_rightclick = function(pos, node, clicker) local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "left") + local name = minetest.get_meta(pos):get_string("name") + if name == "" then + name = minetest.get_meta(pos_other):get_string("name") + end + if name == "" then + name = S("Large Chest") + end minetest.show_formspec(clicker:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z, "size[9,11.5]".. - "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Large Chest"))).."]".. + "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]".. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,0.5,9,3).. "list[nodemeta:"..pos_other.x..","..pos_other.y..","..pos_other.z..";main;0,3.5;9,3;]".. @@ -393,6 +411,9 @@ minetest.register_node("mcl_chests:"..basename.."_right", { minetest.swap_node(pos, n) end end, + after_place_node = function(pos, placer, itemstack, pointed_thing) + minetest.get_meta(pos):set_string("name", itemstack:get_meta():get_string("name")) + end, on_destruct = function(pos) local n = minetest.get_node(pos) if n.name == "mcl_chests:"..basename then @@ -469,12 +490,19 @@ minetest.register_node("mcl_chests:"..basename.."_right", { on_rightclick = function(pos, node, clicker) local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "right") + local name = minetest.get_meta(pos_other):get_string("name") + if name == "" then + name = minetest.get_meta(pos):get_string("name") + end + if name == "" then + name = S("Large Chest") + end minetest.show_formspec(clicker:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z, "size[9,11.5]".. - "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Large Chest"))).."]".. + "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]".. "list[nodemeta:"..pos_other.x..","..pos_other.y..","..pos_other.z..";main;0,0.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,0.5,9,3).. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,3.5;9,3;]".. @@ -769,8 +797,12 @@ local shulker_mob_textures = { } local canonical_shulker_color = "violet" -local formspec_shulker_box = "size[9,8.75]".. - "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Shulker Box"))).."]".. +local function formspec_shulker_box(name) + if name == "" then + name = S("Shulker Box") + end + return "size[9,8.75]".. + "label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]".. "list[current_name;main;0,0.5;9,3;]".. mcl_formspec.get_itemslot_bg(0,0.5,9,3).. "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. @@ -780,6 +812,14 @@ local formspec_shulker_box = "size[9,8.75]".. mcl_formspec.get_itemslot_bg(0,7.74,9,1).. "listring[current_name;main]".. "listring[current_player;main]" +end + +local function set_shulkerbox_meta(nmeta, imeta) + local name = imeta:get_string("name") + nmeta:set_string("description", imeta:get_string("description")) + nmeta:set_string("name", name) + nmeta:set_string("formspec", formspec_shulker_box(name)) +end for color, desc in pairs(boxtypes) do local mob_texture = shulker_mob_textures[color] @@ -822,7 +862,7 @@ for color, desc in pairs(boxtypes) do -- on_place = minetest.rotate_node, on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_string("formspec", formspec_shulker_box) + meta:set_string("formspec", formspec_shulker_box(nil)) local inv = meta:get_inventory() inv:set_size("main", 9*3) end, @@ -835,12 +875,7 @@ for color, desc in pairs(boxtypes) do local iinv_main = minetest.deserialize(imetadata) ninv:set_list("main", iinv_main) ninv:set_size("main", 9*3) - - local imeta = stack:get_meta() - local nmeta = minetest.get_meta(droppos) - nmeta:set_string("description", imeta:get_string("description")) - nmeta:set_string("name", imeta:get_string("name")) - + set_shulkerbox_meta(minetest.get_meta(droppos), stack:get_meta()) stack:take_item() end return stack @@ -852,10 +887,7 @@ for color, desc in pairs(boxtypes) do local ninv = nmeta:get_inventory() ninv:set_list("main", iinv_main) ninv:set_size("main", 9*3) - - local imeta = itemstack:get_meta() - nmeta:set_string("description", imeta:get_string("description")) - nmeta:set_string("name", imeta:get_string("name")) + set_shulkerbox_meta(nmeta, itemstack:get_meta()) if minetest.is_creative_enabled(placer:get_player_name()) then if not ninv:is_empty("main") then From a8eca09822128235dfc26f14e10ee2e6cab755c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Mon, 27 Jul 2020 19:44:55 +0200 Subject: [PATCH 006/152] Fix on_blast for chorus flower crashing --- mods/ITEMS/mcl_end/chorus_plant.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_end/chorus_plant.lua b/mods/ITEMS/mcl_end/chorus_plant.lua index d9933bcae..f85fdcd82 100644 --- a/mods/ITEMS/mcl_end/chorus_plant.lua +++ b/mods/ITEMS/mcl_end/chorus_plant.lua @@ -111,7 +111,7 @@ mcl_end.check_detach_chorus_plant = function(pos, oldnode, oldmetadata, digger) end mcl_end.check_blast_chorus_plant = function(pos) - minetest.remove(pos) + minetest.remove_node(pos) mcl_end.detach_chorus_plant(pos) end From bdd92c6cdb4380c4301a23fb3f7c3617ce3087ed Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 27 Jul 2020 17:32:48 -0400 Subject: [PATCH 007/152] update poison to swap hudbar icons and remove old dead functions --- mods/ITEMS/mcl_potions/functions.lua | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 0704093cd..afe87c367 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -55,6 +55,9 @@ minetest.register_globalstep(function(dtime) if is_poisoned[player].timer >= is_poisoned[player].dur then is_poisoned[player] = nil + if is_player then + hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") + end end end @@ -282,6 +285,11 @@ function mcl_potions._reset_player_effects(player) if is_poisoned[player] then is_poisoned[player] = nil + + if player:is_player() then + hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") + end + end if is_regenerating[player] then @@ -383,19 +391,8 @@ function mcl_potions.make_invisible(player, toggle) end -function mcl_potions.poison(player, toggle) - if not player then return false end - is_poisoned[player:get_player_name()] = toggle -end - -function mcl_potions.regenerate(player, toggle) - - if not player then return false end - is_regenerating[player:get_player_name()] = toggle - -end function mcl_potions._use_potion(item, obj, color) local d = 0.1 @@ -558,6 +555,10 @@ function mcl_potions.poison_func(player, factor, duration) is_poisoned[player] = {step = factor, dur = duration, timer = 0} + if player:is_player() then + hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hbhunger_bar_health_poison.png") + end + else local victim = is_poisoned[player] From 9a32bdc967290e74326015685dbf016257c2c9cc Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 27 Jul 2020 19:17:04 -0400 Subject: [PATCH 008/152] Update HUD for poison/regen. --- mods/ITEMS/mcl_potions/functions.lua | 32 ++++++++++++++++-- .../textures/hbhunger_icon_regen_poison.png | Bin 0 -> 290 bytes .../textures/hudbars_icon_regenerate.png | Bin 0 -> 305 bytes 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 mods/ITEMS/mcl_potions/textures/hbhunger_icon_regen_poison.png create mode 100644 mods/ITEMS/mcl_potions/textures/hudbars_icon_regenerate.png diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index afe87c367..0c199697a 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -55,7 +55,9 @@ minetest.register_globalstep(function(dtime) if is_poisoned[player].timer >= is_poisoned[player].dur then is_poisoned[player] = nil - if is_player then + if is_regenerating[player] then + hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_regenerate.png", nil, "hudbars_bar_health.png") + else hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") end end @@ -89,6 +91,13 @@ minetest.register_globalstep(function(dtime) if is_regenerating[player].timer >= is_regenerating[player].dur then is_regenerating[player] = nil + if is_player then + if is_poisoned[player] then + hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hudbars_bar_health.png") + else + hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") + end + end end end @@ -284,6 +293,7 @@ function mcl_potions._reset_player_effects(player) end if is_poisoned[player] then + is_poisoned[player] = nil if player:is_player() then @@ -293,7 +303,13 @@ function mcl_potions._reset_player_effects(player) end if is_regenerating[player] then + is_regenerating[player] = nil + + if player:is_player() then + hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") + end + end if is_strong[player] then @@ -556,7 +572,11 @@ function mcl_potions.poison_func(player, factor, duration) is_poisoned[player] = {step = factor, dur = duration, timer = 0} if player:is_player() then - hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hbhunger_bar_health_poison.png") + if is_regenerating[player] then + hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_regen_poison.png", nil, "hudbars_bar_health.png") + else + hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hbhunger_bar_health_poison.png") + end end else @@ -577,6 +597,14 @@ function mcl_potions.regeneration_func(player, factor, duration) is_regenerating[player] = {step = factor, dur = duration, timer = 0} + if player:is_player() then + if is_poisoned[player] then + hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_regen_poison.png", nil, "hudbars_bar_health.png") + else + hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_regenerate.png", nil, "hudbars_bar_health.png") + end + end + else local victim = is_regenerating[player] diff --git a/mods/ITEMS/mcl_potions/textures/hbhunger_icon_regen_poison.png b/mods/ITEMS/mcl_potions/textures/hbhunger_icon_regen_poison.png new file mode 100644 index 0000000000000000000000000000000000000000..d4fe9b4e0783d7ddabcc749e79095e880c49af0d GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VjKx9jP7LeL$-D$|EK(yp(|mmy zw18|52FCVG1{RPKAeI7R1_q`DOmGp-1(_iP|F!_&nvL_#t-L4nDj>B=Ab z|NrbG-qx|P9aC~V_WxsmUBHCGg$l~t9*#e>_%}!ieB94}qMrAm{m!rR9@;x!uNRxK zWeB+sLQ1=cZow;M#cygxLU zHu_lZGHY#|xUffX4TlPMk%5n51mk(n4d)$-3S1LfGve4g8yOhhy|YV>ydJU;1|%O$WD@{VjKx9jP7LeL$-D$|EK(yp(|mmy zw18|52FCVG1{RPKAeI7R1_q`DOmGp-1(_iP}w+|$J|L_#t-L4nDj>B=Ab z|NrbG-qx|P9aC~V_WxsmUBHCGg$l~t9tThHuy2qO__&|{L_Fui`L+KiKD2kfUavMI z=f^*09wVhiJO-=^g^Fci8%$y@Uc3-6qsrp%yXW}^vs)Qo^!>iS&(L5`CGT_=!vjeH zf*pq&-@TZT&n6c1 Date: Mon, 27 Jul 2020 19:41:07 -0400 Subject: [PATCH 009/152] Cleanup HUD bar mechanics --- mods/ITEMS/mcl_potions/functions.lua | 44 +++++++++++++++------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 0c199697a..80ee46f6f 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -10,6 +10,22 @@ local is_cat = {} local is_fire_proof = {} +local function potions_set_hudbar(player) + + if is_poisoned[player] and is_regenerating[player] then + hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_regen_poison.png", nil, "hudbars_bar_health.png") + elseif is_poisoned[player] then + hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hudbars_bar_health.png") + elseif is_regenerating[player] then + hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_regenerate.png", nil, "hudbars_bar_health.png") + else + hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") + end + +end + + + local is_player, entity minetest.register_globalstep(function(dtime) @@ -55,10 +71,8 @@ minetest.register_globalstep(function(dtime) if is_poisoned[player].timer >= is_poisoned[player].dur then is_poisoned[player] = nil - if is_regenerating[player] then - hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_regenerate.png", nil, "hudbars_bar_health.png") - else - hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") + if is_player then + potions_set_hudbar(player) end end @@ -92,11 +106,7 @@ minetest.register_globalstep(function(dtime) if is_regenerating[player].timer >= is_regenerating[player].dur then is_regenerating[player] = nil if is_player then - if is_poisoned[player] then - hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hudbars_bar_health.png") - else - hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") - end + potions_set_hudbar(player) end end @@ -297,7 +307,7 @@ function mcl_potions._reset_player_effects(player) is_poisoned[player] = nil if player:is_player() then - hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") + potions_set_hudbar(player) end end @@ -307,7 +317,7 @@ function mcl_potions._reset_player_effects(player) is_regenerating[player] = nil if player:is_player() then - hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") + potions_set_hudbar(player) end end @@ -572,11 +582,7 @@ function mcl_potions.poison_func(player, factor, duration) is_poisoned[player] = {step = factor, dur = duration, timer = 0} if player:is_player() then - if is_regenerating[player] then - hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_regen_poison.png", nil, "hudbars_bar_health.png") - else - hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hbhunger_bar_health_poison.png") - end + potions_set_hudbar(player) end else @@ -598,11 +604,7 @@ function mcl_potions.regeneration_func(player, factor, duration) is_regenerating[player] = {step = factor, dur = duration, timer = 0} if player:is_player() then - if is_poisoned[player] then - hb.change_hudbar(player, "health", nil, nil, "hbhunger_icon_regen_poison.png", nil, "hudbars_bar_health.png") - else - hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_regenerate.png", nil, "hudbars_bar_health.png") - end + potions_set_hudbar(player) end else From 78bee21a82883fdbf07793d6c30d2a3978e71358 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 28 Jul 2020 17:02:43 -0400 Subject: [PATCH 010/152] Allow dragon's breath to stack to 64 --- mods/ITEMS/mcl_potions/potions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index bfbb7c124..402b9a1d4 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -111,7 +111,7 @@ local function register_potion(def) _tt_help = get_tt(def._tt, def.effect, dur), _doc_items_longdesc = def._longdesc, _doc_items_usagehelp = how_to_drink, - stack_max = 1, + stack_max = def.stack_max or 1, inventory_image = def.image or potion_image(def.color), wield_image = def.image or potion_image(def.color), groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0}, From 1563fc7b96f40909bce04ba08b36774bc41d9ae5 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 28 Jul 2020 17:13:54 -0400 Subject: [PATCH 011/152] comment sections of mcl_hunger that "poison" player. This is handled in mcl_potions. --- mods/PLAYER/mcl_hunger/hunger.lua | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mods/PLAYER/mcl_hunger/hunger.lua b/mods/PLAYER/mcl_hunger/hunger.lua index cff54b169..a13e2ae4a 100644 --- a/mods/PLAYER/mcl_hunger/hunger.lua +++ b/mods/PLAYER/mcl_hunger/hunger.lua @@ -98,15 +98,15 @@ local function poisonp(tick, time, time_left, damage, exhaustion, name) if time_left < time then minetest.after(tick, poisonp, tick, time, time_left, damage, exhaustion, name) else - if damage > 0 then - mcl_hunger.poison_damage[name] = mcl_hunger.poison_damage[name] - 1 - end + -- if damage > 0 then + -- mcl_hunger.poison_damage[name] = mcl_hunger.poison_damage[name] - 1 + -- end if exhaustion > 0 then mcl_hunger.poison_hunger [name] = mcl_hunger.poison_hunger[name] - 1 end - if mcl_hunger.poison_damage[name] <= 0 then - mcl_hunger.reset_bars_poison_damage(player) - end + -- if mcl_hunger.poison_damage[name] <= 0 then + -- mcl_hunger.reset_bars_poison_damage(player) + -- end if mcl_hunger.poison_hunger[name] <= 0 then mcl_hunger.reset_bars_poison_hunger(player) end @@ -225,10 +225,10 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso end if do_poison then -- Set poison bars - if poison and poison > 0 then - hb.change_hudbar(user, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hbhunger_bar_health_poison.png") - mcl_hunger.poison_damage[name] = mcl_hunger.poison_damage[name] + 1 - end + -- if poison and poison > 0 then + -- hb.change_hudbar(user, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hbhunger_bar_health_poison.png") + -- mcl_hunger.poison_damage[name] = mcl_hunger.poison_damage[name] + 1 + -- end if exhaust and exhaust > 0 then hb.change_hudbar(user, "hunger", nil, nil, "mcl_hunger_icon_foodpoison.png", nil, "mcl_hunger_bar_foodpoison.png") if mcl_hunger.debug then @@ -260,4 +260,3 @@ if mcl_hunger.active then mcl_hunger.exhaust(name, mcl_hunger.EXHAUST_DIG) end) end - From 92385364e5434f6f77d192fdfb9b6745507ff73f Mon Sep 17 00:00:00 2001 From: kay27 Date: Thu, 30 Jul 2020 02:01:15 +0400 Subject: [PATCH 012/152] Fix beds #798 attempt 5 --- mods/ITEMS/mcl_beds/functions.lua | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index de2b75662..d93b2b84d 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -202,8 +202,13 @@ local function lay_down(player, pos, bed_pos, state, skip) return true end -local function update_formspecs(finished) - local ges = #minetest.get_connected_players() +local function update_formspecs(finished, players) + local ges + if players then + ges = #players + else + ges = #minetest.get_connected_players() + end local form_n = "size[6,5;true]" local all_in_bed = ges == player_in_bed local night_skip = is_night_skip_enabled() @@ -364,7 +369,14 @@ end) minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() lay_down(player, nil, nil, false, true) - if check_in_beds() then + players = minetest.get_connected_players() + for n, player in ipairs(players) do + if player:get_player_name() == name then + players[n] = nil + break + end + end + if check_in_beds(players) then minetest.after(5, function() if check_in_beds() then update_formspecs(is_night_skip_enabled()) @@ -372,7 +384,7 @@ minetest.register_on_leaveplayer(function(player) end end) end - update_formspecs(false) + update_formspecs(false, players) end) minetest.register_on_player_receive_fields(function(player, formname, fields) From 64f9e39ebdf051f79f3df7ba89945eae52bc200e Mon Sep 17 00:00:00 2001 From: kay27 Date: Thu, 30 Jul 2020 03:59:30 +0400 Subject: [PATCH 013/152] slighty optimize the code --- mods/ITEMS/mcl_beds/functions.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index d93b2b84d..b1a0ce4fd 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -202,13 +202,8 @@ local function lay_down(player, pos, bed_pos, state, skip) return true end -local function update_formspecs(finished, players) - local ges - if players then - ges = #players - else - ges = #minetest.get_connected_players() - end +local function update_formspecs(finished, ges) + local ges = ges or #minetest.get_connected_players() local form_n = "size[6,5;true]" local all_in_bed = ges == player_in_bed local night_skip = is_night_skip_enabled() @@ -384,7 +379,7 @@ minetest.register_on_leaveplayer(function(player) end end) end - update_formspecs(false, players) + update_formspecs(false, #players) end) minetest.register_on_player_receive_fields(function(player, formname, fields) From 3b954980926ef6804fa3d43105313d2c84f532aa Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 31 Jul 2020 10:41:44 +0200 Subject: [PATCH 014/152] Clean up potion/arrow names --- mods/ITEMS/mcl_potions/init.lua | 5 +- mods/ITEMS/mcl_potions/potions.lua | 93 ++++++++++++++++++------------ 2 files changed, 59 insertions(+), 39 deletions(-) diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 13152653e..18df5b398 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -277,8 +277,9 @@ minetest.register_craftitem("mcl_potions:river_water", { }) -mcl_potions.register_splash("water", S("Splash Potion"), "#0022FF", {tt="No effect", potion_fun=function() end}) -mcl_potions.register_lingering("water", S("Lingering Potion"), "#0022FF", {tt="No effect", potion_fun=function() end}) +-- TODO: Extinguish fire, damage mobs +mcl_potions.register_splash("water", S("Splash Water Bottle"), "#0022FF", {tt="No effect", potion_fun=function() end}) +mcl_potions.register_lingering("water", S("Lingering Water Bottle"), "#0022FF", {tt="No effect", potion_fun=function() end}) minetest.register_craftitem("mcl_potions:speckled_melon", { description = S("Glistering Melon"), diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 402b9a1d4..227abd042 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -106,8 +106,15 @@ local function register_potion(def) return function() end end + local desc + if not def.no_potion then + desc = S("@1 Potion", def.description) + else + desc = def.description + end + minetest.register_craftitem("mcl_potions:"..def.name, { - description = S(def.description), + description = desc, _tt_help = get_tt(def._tt, def.effect, dur), _doc_items_longdesc = def._longdesc, _doc_items_usagehelp = how_to_drink, @@ -146,15 +153,17 @@ local function register_potion(def) potion_fun = get_arrow_fun(def.effect, dur/8.), } - if def.color and def.name ~= "dragon_breath" then -- dont' splash dragon's breath... - mcl_potions.register_splash(def.name, S("Splash "..def.description), def.color, splash_def) - mcl_potions.register_lingering(def.name, S("Lingering "..def.description), def.color, ling_def) - mcl_potions.register_arrow(def.name, S("Arrow of "..def.description), def.color, arrow_def) + if def.color and not def.no_throwable then + mcl_potions.register_splash(def.name, S("Splash @1 Potion", def.description), def.color, splash_def) + mcl_potions.register_lingering(def.name, S("Lingering @1 Potion", def.description), def.color, ling_def) + if not def.no_arrow then + mcl_potions.register_arrow(def.name, S("Arrow of @1", def.description), def.color, arrow_def) + end end if def.is_II then - local desc_mod = " II" + local desc_mod = S(" II") local effect_II if def.name == "healing" or def.name == "harming" then @@ -171,7 +180,7 @@ local function register_potion(def) if def.name == "slowness" then dur_2 = 20 effect_II = 0.40 - desc_mod = " IV" + desc_mod = S(" IV") end local on_use = function (itemstack, user, pointed_thing) @@ -182,7 +191,7 @@ local function register_potion(def) end minetest.register_craftitem("mcl_potions:"..def.name.."_2", { - description = S(def.description..desc_mod), + description = S("@1 Potion@2", def.description, desc_mod), _tt_help = get_tt(def._tt_2, effect_II, dur_2), _doc_items_longdesc = def._longdesc, _doc_items_usagehelp = how_to_drink, @@ -230,10 +239,12 @@ local function register_potion(def) potion_fun = get_arrow_fun(effect_II, dur_2/8.), } - if def.color then - mcl_potions.register_splash(def.name.."_2", S("Splash "..def.description..desc_mod), def.color, splash_def_2) - mcl_potions.register_lingering(def.name.."_2", S("Lingering "..def.description..desc_mod), def.color, ling_def_2) - mcl_potions.register_arrow(def.name.."_2", S("Arrow of "..def.description..desc_mod), def.color, arrow_def_2) + if def.color and not def.no_throwable then + mcl_potions.register_splash(def.name.."_2", S("Splash @1@2 Potion", def.description, desc_mod), def.color, splash_def_2) + mcl_potions.register_lingering(def.name.."_2", S("Lingering @1@2 Potion", def.description, desc_mod), def.color, ling_def_2) + if not def.no_arrow then + mcl_potions.register_arrow(def.name.."_2", S("Arrow of @1@2", def.description, desc_mod), def.color, arrow_def_2) + end end end @@ -253,7 +264,7 @@ local function register_potion(def) end minetest.register_craftitem("mcl_potions:"..def.name.."_plus", { - description = S(def.description.." +"), + description = S("@1 + Potion", def.description), _tt_help = get_tt(def._tt_plus, def.effect, dur_pl), _doc_items_longdesc = def._longdesc, _doc_items_usagehelp = how_to_drink, @@ -281,10 +292,12 @@ local function register_potion(def) tt = get_tt(def._tt_pl, def.effect, dur_pl/8.), potion_fun = get_arrow_fun(def.effect, dur_pl/8.), } - if def.color then - mcl_potions.register_splash(def.name.."_plus", S("Splash "..def.description.." +"), def.color, splash_def_pl) - mcl_potions.register_lingering(def.name.."_plus", S("Lingering "..def.description.." +"), def.color, ling_def_pl) - mcl_potions.register_arrow(def.name.."_plus", S("Arrow of"..def.description.." +"), def.color, arrow_def_pl) + if def.color and not def.no_throwable then + mcl_potions.register_splash(def.name.."_plus", S("Splash @1 + Potion", def.description), def.color, splash_def_pl) + mcl_potions.register_lingering(def.name.."_plus", S("Lingering @1 + Potion", def.description), def.color, ling_def_pl) + if not def.no_arrow then + mcl_potions.register_arrow(def.name.."_plus", S("Arrow of @1 +", def.description), def.color, arrow_def_pl) + end end end @@ -309,7 +322,8 @@ end local awkward_def = { name = "awkward", - description = "Awkward Potion", + description = S("Awkward"), + no_arrow = true, _tt = S("No effect"), _longdesc = S("Has an awkward taste and is used for brewing potions."), color = "#0000FF", @@ -319,7 +333,8 @@ local awkward_def = { local mundane_def = { name = "mundane", - description = "Mundane Potion", + description = S("Mundane"), + no_arrow = true, _tt = S("No effect"), longdesc = S("Has a terrible taste and is not useful for brewing potions."), color = "#0000FF", @@ -328,7 +343,8 @@ local mundane_def = { local thick_def = { name = "thick", - description = "Thick Potion", + description = S("Thick"), + no_arrow = true, _tt = S("No effect"), _longdesc = S("Has a bitter taste and is not useful for brewing potions."), color = "#0000FF", @@ -337,7 +353,10 @@ local thick_def = { local dragon_breath_def = { name = "dragon_breath", - description = "Dragon's Breath", + description = S("Dragon's Breath"), + no_arrow = true, + no_potion = true, + no_throwable = true, _tt = S("No effect"), _longdesc = S("Combine with Splash potions to create a Lingering effect"), color = "#BF4567", @@ -348,7 +367,7 @@ local dragon_breath_def = { local healing_def = { name = "healing", - description = "Healing Potion", + description = S("Healing"), _tt = S("+2 Hearts"), _tt_2 = S("+4 Hearts"), _longdesc = S("Drink to heal yourself"), @@ -361,7 +380,7 @@ local healing_def = { local harming_def = { name = "harming", - description = "Harming Potion", + description = S("Harming"), _tt = S("-3 Hearts"), _tt_II = S("-6 Hearts"), _longdesc = S("Drink to heal yourself"), @@ -374,7 +393,7 @@ local harming_def = { local night_vision_def = { name = "night_vision", - description = "Night Vision Potion", + description = S("Night Vision"), _tt = nil, _longdesc = S("Drink to see in the dark."), color = "#1010AA", @@ -386,7 +405,7 @@ local night_vision_def = { local swiftness_def = { name = "swiftness", - description = "Swiftness Potion", + description = S("Swiftness"), _tt = nil, _longdesc = S("Drink to increase your speed."), color = "#009999", @@ -399,7 +418,7 @@ local swiftness_def = { local slowness_def = { name = "slowness", - description = "Slowness Potion", + description = S("Slowness"), _tt = nil, _longdesc = S("Drink to become sluggish"), color = "#000080", @@ -413,7 +432,7 @@ local slowness_def = { local leaping_def = { name = "leaping", - description = "Leaping Potion", + description = S("Leaping"), _tt = nil, _longdesc = S("Drink to leap tall buildings in a single bound!"), color = "#00CC33", @@ -426,7 +445,7 @@ local leaping_def = { local poison_def = { name = "poison", - description = "Poison Potion", + description = S("Poison"), _tt = nil, _longdesc = S("Poison mobs or players with this dangerous potion."), color = "#447755", @@ -440,7 +459,7 @@ local poison_def = { local regeneration_def = { name = "regeneration", - description = "Regeneration Potion", + description = S("Regeneration"), _tt = nil, _longdesc = S("Regenerate mobs or players with this healing potion over time."), color = "#B52CC2", @@ -453,7 +472,7 @@ local regeneration_def = { local invisibility_def = { name = "invisibility", - description = "Invisibility Potion", + description = S("Invisibility"), _tt = nil, _longdesc = S("Drink and become invisibile to mobs and players."), color = "#B0B0B0", @@ -464,7 +483,7 @@ local invisibility_def = { local water_breathing_def = { name = "water_breathing", - description = "Water Breathing Potion", + description = S("Water Breathing"), _tt = nil, _longdesc = S("Drink and breath underwater."), color = "#0000AA", @@ -475,7 +494,7 @@ local water_breathing_def = { local fire_resistance_def = { name = "fire_resistance", - description = "Fire Resistance Potion", + description = S("Fire Resistance"), _tt = nil, _longdesc = S("Drink and resist fire damage."), color = "#D0A040", @@ -499,7 +518,7 @@ end -- minetest.register_craftitem("mcl_potions:weakness", { --- description = S("Weakness Potion"), +-- description = S("Weakness"), -- _tt_help = S("-4 HP damage | 1:30"), -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#6600AA"), @@ -523,7 +542,7 @@ end -- }) -- -- minetest.register_craftitem("mcl_potions:weakness_plus", { --- description = S("Weakness Potion +"), +-- description = S("Weakness +"), -- _tt_help = S("-4 HP damage | 4:00"), -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#7700BB"), @@ -547,7 +566,7 @@ end -- }) -- -- minetest.register_craftitem("mcl_potions:strength", { --- description = S("Strength Potion"), +-- description = S("Strength"), -- _tt_help = S("+3 HP damage | 3:00"), -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#D444D4"), @@ -571,7 +590,7 @@ end -- }) -- -- minetest.register_craftitem("mcl_potions:strength_2", { --- description = S("Strength Potion II"), +-- description = S("Strength II"), -- _tt_help = S("+6 HP damage | 1:30"), -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#D444E4"), @@ -595,7 +614,7 @@ end -- }) -- -- minetest.register_craftitem("mcl_potions:strength_plus", { --- description = S("Strength Potion +"), +-- description = S("Strength +"), -- _tt_help = S("+3 HP damage | 8:00"), -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#D444F4"), From 5af124d732c74f8f7e086235daa4dbcf228703c8 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 31 Jul 2020 10:43:42 +0200 Subject: [PATCH 015/152] Tweak potion tooltips --- mods/ITEMS/mcl_potions/potions.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 227abd042..c82d4ef1d 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -66,10 +66,10 @@ local function register_potion(def) if effect and def.is_dur then _tt = perc_string(effect).." | "..time_string(dur) if def.name == "poison" or def.name == "regeneration" then - _tt = "1/2 Heart/"..effect.."sec | "..time_string(dur) + _tt = "1/2 heart/"..effect.."s | "..time_string(dur) end elseif def.name == "healing" or def.name == "harming" then - _tt = (effect / 2).." Hearts" + _tt = (effect / 2).." hearts" else _tt = tt or time_string(dur) or S("No effect") end @@ -368,8 +368,8 @@ local dragon_breath_def = { local healing_def = { name = "healing", description = S("Healing"), - _tt = S("+2 Hearts"), - _tt_2 = S("+4 Hearts"), + _tt = S("+2 hearts"), + _tt_2 = S("+4 hearts"), _longdesc = S("Drink to heal yourself"), color = "#CC0000", effect = 4, @@ -381,8 +381,8 @@ local healing_def = { local harming_def = { name = "harming", description = S("Harming"), - _tt = S("-3 Hearts"), - _tt_II = S("-6 Hearts"), + _tt = S("-3 hearts"), + _tt_II = S("-6 hearts"), _longdesc = S("Drink to heal yourself"), color = "#660099", effect = -6, From eec9cd90120bb003caade00cb282ca780d060bd5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 31 Jul 2020 10:45:22 +0200 Subject: [PATCH 016/152] Mark night vision arrows as WIP --- mods/MISC/mcl_wip/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/MISC/mcl_wip/init.lua b/mods/MISC/mcl_wip/init.lua index c72907bd6..351714474 100644 --- a/mods/MISC/mcl_wip/init.lua +++ b/mods/MISC/mcl_wip/init.lua @@ -36,6 +36,8 @@ local wip_items = { -- "mcl_potions:strength_lingering", -- "mcl_potions:strength_plus_lingering", -- "mcl_potions:strength_2_lingering", + "mcl_potions:night_vision_arrow", + "mcl_potions:night_vision_plus_arrow", } local experimental_items = { } From 23dc977cec9d61d281485d8dc1efc8515b781fe1 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 31 Jul 2020 15:20:59 +0200 Subject: [PATCH 017/152] Add IRC channel --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d72daef03..cb74c5a35 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,3 +80,8 @@ Depending on what you add, the chances for inclusion vary: Report all bugs and missing Minecraft features here: + +## Direct discussion +We have an IRC channel! Join us on #mineclone2 in freenode.net. + + From c63c92f597f0ea67707bf2ff25f0d865dba0ea5b Mon Sep 17 00:00:00 2001 From: MysticTempest Date: Fri, 31 Jul 2020 08:35:40 -0500 Subject: [PATCH 018/152] Copy upstream's pathfinding out of water, then copy & rework the cliff check into a check for land mobs to avoid water. --- mods/ENTITIES/mcl_mobs/api.lua | 106 +++++++++++++++++++++++---------- 1 file changed, 76 insertions(+), 30 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index ec691c624..2d45bb257 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -724,6 +724,42 @@ local is_at_cliff_or_danger = function(self) end +-- copy the 'mob facing cliff_or_danger check' from above, and rework to avoid water +local is_at_water_danger = function(self) + + + if not self.object:get_luaentity() then + return false + end + local yaw = self.object:get_yaw() + local dir_x = -sin(yaw) * (self.collisionbox[4] + 0.5) + local dir_z = cos(yaw) * (self.collisionbox[4] + 0.5) + local pos = self.object:get_pos() + local ypos = pos.y + self.collisionbox[2] -- just above floor + + local free_fall, blocker = minetest.line_of_sight( + {x = pos.x + dir_x, y = ypos, z = pos.z + dir_z}, + {x = pos.x + dir_x, y = ypos - 3, z = pos.z + dir_z}) + if free_fall then + return true + else + local bnode = minetest.get_node(blocker) + local waterdanger = is_node_waterhazard(self, bnode.name) + if + waterdanger and (is_node_waterhazard(self, self.standing_in) or is_node_waterhazard(self, self.standing_on)) then + return false + elseif waterdanger and (is_node_waterhazard(self, self.standing_in) or is_node_waterhazard(self, self.standing_on)) == false then + return true + else + local def = minetest.registered_nodes[bnode.name] + return (not def and def.walkable) + end + end + + return false +end + + -- get node but use fallback for nil or unknown local node_ok = function(pos, fallback) @@ -2049,40 +2085,40 @@ local do_states = function(self, dtime) local is_in_danger = false if lp then - - local is_in_danger = false - - -- if mob is flying, only check for node it is currently in (no contact with node below) - if flight_check(self) then - is_in_danger = is_node_dangerous(self, self.standing_in) - elseif (is_node_dangerous(self, self.standing_in) or - is_node_dangerous(self, self.standing_on)) or (is_node_waterhazard(self, self.standing_in) or is_node_waterhazard(self, self.standing_on)) then - is_in_danger = true - end - -- If mob in or on dangerous block, look for land - if is_in_danger then - lp = minetest.find_node_near(s, 5, {"group:solid"}) + if (is_node_dangerous(self, self.standing_in) or + is_node_dangerous(self, self.standing_on)) or (is_node_waterhazard(self, self.standing_in) or is_node_waterhazard(self, self.standing_on)) and (not self.fly) then + is_in_danger = true - -- did we find land? - if lp then + -- If mob in or on dangerous block, look for land + if is_in_danger then + -- Better way to find shore - copied from upstream + lp = minetest.find_nodes_in_area_under_air( + {x = s.x - 5, y = s.y - 0.5, z = s.z - 5}, + {x = s.x + 5, y = s.y + 1, z = s.z + 5}, + {"group:solid"}) - local vec = { - x = lp.x - s.x, - z = lp.z - s.z - } + lp = #lp > 0 and lp[random(#lp)] + + -- did we find land? + if lp then - yaw = (atan(vec.z / vec.x) + pi / 2) - self.rotate + local vec = { + x = lp.x - s.x, + z = lp.z - s.z + } - if lp.x > s.x then yaw = yaw + pi end + yaw = (atan(vec.z / vec.x) + pi / 2) - self.rotate - -- look towards land and jump/move in that direction - yaw = set_yaw(self, yaw, 6) - do_jump(self) - set_velocity(self, self.walk_velocity) - else - yaw = yaw + random(-0.5, 0.5) - end + + if lp.x > s.x then yaw = yaw + pi end + + -- look towards land and move in that direction + yaw = set_yaw(self, yaw, 6) + set_velocity(self, self.walk_velocity) + + end + end -- A danger is near but mob is not inside else @@ -3218,8 +3254,6 @@ local mob_step = function(self, dtime) breed(self) - follow_flop(self) - if do_states(self, dtime) then return end @@ -3228,6 +3262,18 @@ local mob_step = function(self, dtime) runaway_from(self) + if is_at_water_danger(self) and self.state ~= "attack" then + if random(1, 10) <= 6 then + set_velocity(self, 0) + self.state = "stand" + set_animation(self, "stand") + yaw = yaw + random(-0.5, 0.5) + yaw = set_yaw(self, yaw, 8) + end + end + + follow_flop(self) + if is_at_cliff_or_danger(self) then set_velocity(self, 0) self.state = "stand" From fb3fade4eb563f42c8f67630c282a3eb80b50591 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 1 Aug 2020 02:15:19 +0200 Subject: [PATCH 019/152] Remove dead code in mcl_brewing --- mods/ITEMS/mcl_brewing/init.lua | 89 +++------------------------------ 1 file changed, 8 insertions(+), 81 deletions(-) diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index c796606b9..717e660e4 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -4,7 +4,6 @@ local function active_brewing_formspec(fuel_percent, brew_percent) return "size[9,8.75]".. "background[-0.19,-0.25;9.5,9.5;mcl_brewing_inventory.png]".. - -- "background[-0.19,-0.25;9.5,9.5;mcl_brewing_inventory_active.png]".. "label[4,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Brewing Stand"))).."]".. "label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]".. "list[current_player;main;0,4.5;9,3;9]".. @@ -375,7 +374,7 @@ minetest.register_node("mcl_brewing:stand_000", { _doc_items_longdesc = S("The stand allows you to brew potions!"), _doc_items_usagehelp = doc_string, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, brewitem=1, not_in_creative_inventory = 0, not_in_craft_guide = 0}, + groups = {pickaxey=1, falling_node=1, brewitem=1 }, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -392,32 +391,16 @@ minetest.register_node("mcl_brewing:stand_000", { {-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base {-3/16, -8/16, 2/16, 3/16, -6/16, 8/16}, -- base - -- {-7/16, -6/16 ,-7/16 , -6/16, 1/16, -6/16 }, -- bottle 1 - -- {-6/16, -6/16 ,-6/16 , -5/16, 3/16, -5/16 }, -- bottle 1 - -- {-5/16, -6/16 ,-5/16 , -4/16, 3/16, -4/16 }, -- bottle 1 - -- {-4/16, -6/16 ,-4/16 , -3/16, 3/16, -3/16 }, -- bottle 1 - -- {-3/16, -6/16 ,-3/16 , -2/16, 1/16, -2/16 }, -- bottle 1 - {-5/16, 3/16 ,-5/16 , -4/16, 7/16, -4/16 }, -- line 1 {-4/16, 6/16 ,-4/16 , -3/16, 8/16, -3/16 }, -- line 1 {-3/16, 7/16 ,-3/16 , -2/16, 8/16, -2/16 }, -- line 1 {-2/16, 7/16 ,-2/16 , -1/16, 8/16, -1/16 }, -- line 1 - - -- {7/16, -6/16 ,-7/16 , 6/16, 1/16, -6/16 }, -- bottle 2 - -- {6/16, -6/16 ,-6/16 , 5/16, 3/16, -5/16 }, -- bottle 2 - -- {5/16, -6/16 ,-5/16 , 4/16, 3/16, -4/16 }, -- bottle 2 - -- {4/16, -6/16 ,-4/16 , 3/16, 3/16, -3/16 }, -- bottle 2 - -- {3/16, -6/16 ,-3/16 , 2/16, 1/16, -2/16 }, -- bottle 2 - {5/16, 3/16 ,-5/16 ,4/16, 7/16, -4/16 }, -- line 2 {4/16, 6/16 ,-4/16 ,3/16, 8/16, -3/16 }, -- line 2 {3/16, 7/16 ,-3/16 ,2/16, 8/16, -2/16 }, -- line 2 {2/16, 7/16 ,-2/16 ,1/16, 8/16, -1/16 }, -- line 2 - -- {0/16, -6/16 , 2/16 , 1/16, 1/16, 7/16 }, -- bottle 3 - -- {0/16, 1/16 , 3/16 , 1/16, 3/16, 6/16 }, -- bottle 3 - {0/16, 7/16 , 1/16 , 1/16, 8/16, 3/16 }, -- line 3 {0/16, 6/16 , 3/16 , 1/16, 7/16, 5/16 }, -- line 3 {0/16, 3/16 , 4/16 , 1/16, 6/16, 5/16 }, -- line 3 @@ -427,7 +410,6 @@ minetest.register_node("mcl_brewing:stand_000", { _mcl_blast_resistance = 1, _mcl_hardness = 1, on_destruct = on_destruct, - -- after_dig_node = after_dig, allow_metadata_inventory_take = allow_take, allow_metadata_inventory_put = allow_put, on_metadata_inventory_put = on_put, @@ -458,7 +440,7 @@ minetest.register_node("mcl_brewing:stand_100", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, brewitem=0, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -486,21 +468,11 @@ minetest.register_node("mcl_brewing:stand_100", { {-3/16, 7/16 ,-3/16 , -2/16, 8/16, -2/16 }, -- line 1 {-2/16, 7/16 ,-2/16 , -1/16, 8/16, -1/16 }, -- line 1 - - -- {7/16, -6/16 ,-7/16 , 6/16, 1/16, -6/16 }, -- bottle 2 - -- {6/16, -6/16 ,-6/16 , 5/16, 3/16, -5/16 }, -- bottle 2 - -- {5/16, -6/16 ,-5/16 , 4/16, 3/16, -4/16 }, -- bottle 2 - -- {4/16, -6/16 ,-4/16 , 3/16, 3/16, -3/16 }, -- bottle 2 - -- {3/16, -6/16 ,-3/16 , 2/16, 1/16, -2/16 }, -- bottle 2 - {5/16, 3/16 ,-5/16 ,4/16, 7/16, -4/16 }, -- line 2 {4/16, 6/16 ,-4/16 ,3/16, 8/16, -3/16 }, -- line 2 {3/16, 7/16 ,-3/16 ,2/16, 8/16, -2/16 }, -- line 2 {2/16, 7/16 ,-2/16 ,1/16, 8/16, -1/16 }, -- line 2 - -- {0/16, -6/16 , 2/16 , 1/16, 1/16, 7/16 }, -- bottle 3 - -- {0/16, 1/16 , 3/16 , 1/16, 3/16, 6/16 }, -- bottle 3 - {0/16, 7/16 , 1/16 , 1/16, 8/16, 3/16 }, -- line 3 {0/16, 6/16 , 3/16 , 1/16, 7/16, 5/16 }, -- line 3 {0/16, 3/16 , 4/16 , 1/16, 6/16, 5/16 }, -- line 3 @@ -510,7 +482,6 @@ minetest.register_node("mcl_brewing:stand_100", { _mcl_blast_resistance = 1, _mcl_hardness = 1, on_destruct = on_destruct, - -- after_dig_node = after_dig, allow_metadata_inventory_take = allow_take, allow_metadata_inventory_put = allow_put, on_metadata_inventory_put = on_put, @@ -541,7 +512,7 @@ minetest.register_node("mcl_brewing:stand_010", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, brewitem=0, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -558,12 +529,6 @@ minetest.register_node("mcl_brewing:stand_010", { {-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base {-3/16, -8/16, 2/16, 3/16, -6/16, 8/16}, -- base - -- {-7/16, -6/16 ,-7/16 , -6/16, 1/16, -6/16 }, -- bottle 1 - -- {-6/16, -6/16 ,-6/16 , -5/16, 3/16, -5/16 }, -- bottle 1 - -- {-5/16, -6/16 ,-5/16 , -4/16, 3/16, -4/16 }, -- bottle 1 - -- {-4/16, -6/16 ,-4/16 , -3/16, 3/16, -3/16 }, -- bottle 1 - -- {-3/16, -6/16 ,-3/16 , -2/16, 1/16, -2/16 }, -- bottle 1 - {-5/16, 3/16 ,-5/16 , -4/16, 7/16, -4/16 }, -- line 1 {-4/16, 6/16 ,-4/16 , -3/16, 8/16, -3/16 }, -- line 1 {-3/16, 7/16 ,-3/16 , -2/16, 8/16, -2/16 }, -- line 1 @@ -581,9 +546,6 @@ minetest.register_node("mcl_brewing:stand_010", { {3/16, 7/16 ,-3/16 ,2/16, 8/16, -2/16 }, -- line 2 {2/16, 7/16 ,-2/16 ,1/16, 8/16, -1/16 }, -- line 2 - -- {0/16, -6/16 , 2/16 , 1/16, 1/16, 7/16 }, -- bottle 3 - -- {0/16, 1/16 , 3/16 , 1/16, 3/16, 6/16 }, -- bottle 3 - {0/16, 7/16 , 1/16 , 1/16, 8/16, 3/16 }, -- line 3 {0/16, 6/16 , 3/16 , 1/16, 7/16, 5/16 }, -- line 3 {0/16, 3/16 , 4/16 , 1/16, 6/16, 5/16 }, -- line 3 @@ -593,7 +555,6 @@ minetest.register_node("mcl_brewing:stand_010", { _mcl_blast_resistance = 1, _mcl_hardness = 1, on_destruct = on_destruct, - -- after_dig_node = after_dig, allow_metadata_inventory_take = allow_take, allow_metadata_inventory_put = allow_put, on_metadata_inventory_put = on_put, @@ -624,7 +585,7 @@ minetest.register_node("mcl_brewing:stand_001", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, brewitem=0, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -641,24 +602,11 @@ minetest.register_node("mcl_brewing:stand_001", { {-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base {-3/16, -8/16, 2/16, 3/16, -6/16, 8/16}, -- base - -- {-7/16, -6/16 ,-7/16 , -6/16, 1/16, -6/16 }, -- bottle 1 - -- {-6/16, -6/16 ,-6/16 , -5/16, 3/16, -5/16 }, -- bottle 1 - -- {-5/16, -6/16 ,-5/16 , -4/16, 3/16, -4/16 }, -- bottle 1 - -- {-4/16, -6/16 ,-4/16 , -3/16, 3/16, -3/16 }, -- bottle 1 - -- {-3/16, -6/16 ,-3/16 , -2/16, 1/16, -2/16 }, -- bottle 1 - {-5/16, 3/16 ,-5/16 , -4/16, 7/16, -4/16 }, -- line 1 {-4/16, 6/16 ,-4/16 , -3/16, 8/16, -3/16 }, -- line 1 {-3/16, 7/16 ,-3/16 , -2/16, 8/16, -2/16 }, -- line 1 {-2/16, 7/16 ,-2/16 , -1/16, 8/16, -1/16 }, -- line 1 - - -- {7/16, -6/16 ,-7/16 , 6/16, 1/16, -6/16 }, -- bottle 2 - -- {6/16, -6/16 ,-6/16 , 5/16, 3/16, -5/16 }, -- bottle 2 - -- {5/16, -6/16 ,-5/16 , 4/16, 3/16, -4/16 }, -- bottle 2 - -- {4/16, -6/16 ,-4/16 , 3/16, 3/16, -3/16 }, -- bottle 2 - -- {3/16, -6/16 ,-3/16 , 2/16, 1/16, -2/16 }, -- bottle 2 - {5/16, 3/16 ,-5/16 ,4/16, 7/16, -4/16 }, -- line 2 {4/16, 6/16 ,-4/16 ,3/16, 8/16, -3/16 }, -- line 2 {3/16, 7/16 ,-3/16 ,2/16, 8/16, -2/16 }, -- line 2 @@ -676,7 +624,6 @@ minetest.register_node("mcl_brewing:stand_001", { _mcl_blast_resistance = 1, _mcl_hardness = 1, on_destruct = on_destruct, - -- after_dig_node = after_dig, allow_metadata_inventory_take = allow_take, allow_metadata_inventory_put = allow_put, on_metadata_inventory_put = on_put, @@ -707,7 +654,7 @@ minetest.register_node("mcl_brewing:stand_110", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, brewitem=0, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -747,9 +694,6 @@ minetest.register_node("mcl_brewing:stand_110", { {3/16, 7/16 ,-3/16 ,2/16, 8/16, -2/16 }, -- line 2 {2/16, 7/16 ,-2/16 ,1/16, 8/16, -1/16 }, -- line 2 - -- {0/16, -6/16 , 2/16 , 1/16, 1/16, 7/16 }, -- bottle 3 - -- {0/16, 1/16 , 3/16 , 1/16, 3/16, 6/16 }, -- bottle 3 - {0/16, 7/16 , 1/16 , 1/16, 8/16, 3/16 }, -- line 3 {0/16, 6/16 , 3/16 , 1/16, 7/16, 5/16 }, -- line 3 {0/16, 3/16 , 4/16 , 1/16, 6/16, 5/16 }, -- line 3 @@ -759,7 +703,6 @@ minetest.register_node("mcl_brewing:stand_110", { _mcl_blast_resistance = 1, _mcl_hardness = 1, on_destruct = on_destruct, - -- after_dig_node = after_dig, allow_metadata_inventory_take = allow_take, allow_metadata_inventory_put = allow_put, on_metadata_inventory_put = on_put, @@ -790,7 +733,7 @@ minetest.register_node("mcl_brewing:stand_101", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, brewitem=0, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -818,13 +761,6 @@ minetest.register_node("mcl_brewing:stand_101", { {-3/16, 7/16 ,-3/16 , -2/16, 8/16, -2/16 }, -- line 1 {-2/16, 7/16 ,-2/16 , -1/16, 8/16, -1/16 }, -- line 1 - - -- {7/16, -6/16 ,-7/16 , 6/16, 1/16, -6/16 }, -- bottle 2 - -- {6/16, -6/16 ,-6/16 , 5/16, 3/16, -5/16 }, -- bottle 2 - -- {5/16, -6/16 ,-5/16 , 4/16, 3/16, -4/16 }, -- bottle 2 - -- {4/16, -6/16 ,-4/16 , 3/16, 3/16, -3/16 }, -- bottle 2 - -- {3/16, -6/16 ,-3/16 , 2/16, 1/16, -2/16 }, -- bottle 2 - {5/16, 3/16 ,-5/16 ,4/16, 7/16, -4/16 }, -- line 2 {4/16, 6/16 ,-4/16 ,3/16, 8/16, -3/16 }, -- line 2 {3/16, 7/16 ,-3/16 ,2/16, 8/16, -2/16 }, -- line 2 @@ -842,7 +778,6 @@ minetest.register_node("mcl_brewing:stand_101", { _mcl_blast_resistance = 1, _mcl_hardness = 1, on_destruct = on_destruct, - -- after_dig_node = after_dig, allow_metadata_inventory_take = allow_take, allow_metadata_inventory_put = allow_put, on_metadata_inventory_put = on_put, @@ -873,7 +808,7 @@ minetest.register_node("mcl_brewing:stand_011", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, brewitem=0, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -890,18 +825,11 @@ minetest.register_node("mcl_brewing:stand_011", { {-8/16, -8/16, -8/16, -2/16, -6/16, -2/16}, -- base {-3/16, -8/16, 2/16, 3/16, -6/16, 8/16}, -- base - -- {-7/16, -6/16 ,-7/16 , -6/16, 1/16, -6/16 }, -- bottle 1 - -- {-6/16, -6/16 ,-6/16 , -5/16, 3/16, -5/16 }, -- bottle 1 - -- {-5/16, -6/16 ,-5/16 , -4/16, 3/16, -4/16 }, -- bottle 1 - -- {-4/16, -6/16 ,-4/16 , -3/16, 3/16, -3/16 }, -- bottle 1 - -- {-3/16, -6/16 ,-3/16 , -2/16, 1/16, -2/16 }, -- bottle 1 - {-5/16, 3/16 ,-5/16 , -4/16, 7/16, -4/16 }, -- line 1 {-4/16, 6/16 ,-4/16 , -3/16, 8/16, -3/16 }, -- line 1 {-3/16, 7/16 ,-3/16 , -2/16, 8/16, -2/16 }, -- line 1 {-2/16, 7/16 ,-2/16 , -1/16, 8/16, -1/16 }, -- line 1 - {7/16, -6/16 ,-7/16 , 6/16, 1/16, -6/16 }, -- bottle 2 {6/16, -6/16 ,-6/16 , 5/16, 3/16, -5/16 }, -- bottle 2 {5/16, -6/16 ,-5/16 , 4/16, 3/16, -4/16 }, -- bottle 2 @@ -956,7 +884,7 @@ minetest.register_node("mcl_brewing:stand_111", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, brewitem=0, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -1008,7 +936,6 @@ minetest.register_node("mcl_brewing:stand_111", { _mcl_blast_resistance = 1, _mcl_hardness = 1, on_destruct = on_destruct, - -- after_dig_node = after_dig, allow_metadata_inventory_take = allow_take, allow_metadata_inventory_put = allow_put, on_metadata_inventory_put = on_put, From c63028801b0f802e11805935529905bd71828efc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 1 Aug 2020 03:20:52 +0200 Subject: [PATCH 020/152] Write potion help texts --- mods/ITEMS/mcl_potions/lingering.lua | 9 +++ mods/ITEMS/mcl_potions/potions.lua | 100 ++++++++++++++++-------- mods/ITEMS/mcl_potions/splash.lua | 9 +++ mods/ITEMS/mcl_potions/tipped_arrow.lua | 10 ++- 4 files changed, 94 insertions(+), 34 deletions(-) diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index 15e0f732a..318d51a68 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -69,9 +69,18 @@ end) function mcl_potions.register_lingering(name, descr, color, def) local id = "mcl_potions:"..name.."_lingering" + local longdesc = def.longdesc + if not def.no_effect then + longdesc = S("A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.") + if def.longdesc then + longdesc = longdesc .. "\n" .. def.longdesc + end + end minetest.register_craftitem(id, { description = descr, _tt_help = def.tt, + _doc_items_longdesc = longdesc, + _doc_items_usagehelp = S("Use the “Punch” key to throw it."), inventory_image = lingering_image(color), groups = {brewitem=1, not_in_creative_inventory=0}, on_use = function(item, placer, pointed_thing) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index c82d4ef1d..2f83a1c19 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -9,6 +9,7 @@ local potion_image = function(colorstring, opacity) end local how_to_drink = S("Use the “Place” key to drink it.") +local potion_intro = S("Drinking a potion gives you a particular effect.") local function time_string(dur) if not dur then return nil end @@ -112,16 +113,26 @@ local function register_potion(def) else desc = def.description end + local potion_longdesc = def._longdesc + if not def.no_effect then + potion_longdesc = potion_intro .. "\n" .. def._longdesc + end + local potion_usagehelp + local basic_potion_tt + if def.name ~= "dragon_breath" then + potion_usagehelp = how_to_drink + basic_potion_tt = get_tt(def._tt, def.effect, dur) + end minetest.register_craftitem("mcl_potions:"..def.name, { description = desc, - _tt_help = get_tt(def._tt, def.effect, dur), - _doc_items_longdesc = def._longdesc, - _doc_items_usagehelp = how_to_drink, + _tt_help = basic_potion_tt, + _doc_items_longdesc = potion_longdesc, + _doc_items_usagehelp = potion_usagehelp, stack_max = def.stack_max or 1, inventory_image = def.image or potion_image(def.color), wield_image = def.image or potion_image(def.color), - groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0}, + groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1 }, on_place = on_use, on_secondary_use = on_use, }) @@ -132,25 +143,33 @@ local function register_potion(def) local splash_def = { tt = get_tt(def._tt, def.effect, splash_dur), + longdesc = def._longdesc, potion_fun = get_splash_fun(def.effect, splash_dur), + no_effect = def.no_effect, } local ling_def if def.name == "healing" or def.name == "harming" then ling_def = { tt = get_tt(def._tt, def.effect*mcl_potions.LINGERING_FACTOR, ling_dur), + longdesc = def._longdesc, potion_fun = get_lingering_fun(def.effect*mcl_potions.LINGERING_FACTOR, ling_dur), + no_effect = def.no_effect, } else ling_def = { tt = get_tt(def._tt, def.effect, ling_dur), + longdesc = def._longdesc, potion_fun = get_lingering_fun(def.effect, ling_dur), + no_effect = def.no_effect, } end local arrow_def = { tt = get_tt(def._tt, def.effect, dur/8.), + longdesc = def._longdesc, potion_fun = get_arrow_fun(def.effect, dur/8.), + no_effect = def.no_effect, } if def.color and not def.no_throwable then @@ -193,12 +212,12 @@ local function register_potion(def) minetest.register_craftitem("mcl_potions:"..def.name.."_2", { description = S("@1 Potion@2", def.description, desc_mod), _tt_help = get_tt(def._tt_2, effect_II, dur_2), - _doc_items_longdesc = def._longdesc, - _doc_items_usagehelp = how_to_drink, + _doc_items_longdesc = potion_longdesc, + _doc_items_usagehelp = potion_usagehelp, stack_max = def.stack_max or 1, inventory_image = def.image or potion_image(def.color), wield_image = def.image or potion_image(def.color), - groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0}, + groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1}, on_place = on_use, on_secondary_use = on_use, }) @@ -211,12 +230,16 @@ local function register_potion(def) if def.name == "healing" then splash_def_2 = { tt = get_tt(def._tt_2, 7, splash_dur_2), + longdesc = def._longdesc, potion_fun = get_splash_fun(7, splash_dur_2), + no_effect = def.no_effect, } else splash_def_2 = { tt = get_tt(def._tt_2, effect_II, splash_dur_2), + longdesc = def._longdesc, potion_fun = get_splash_fun(effect_II, splash_dur_2), + no_effect = def.no_effect, } end @@ -225,18 +248,24 @@ local function register_potion(def) if def.name == "healing" or def.name == "harming" then ling_def_2 = { tt = get_tt(def._tt_2, effect_II*mcl_potions.LINGERING_FACTOR, ling_dur_2), + longdesc = def._longdesc, potion_fun = get_lingering_fun(effect_II*mcl_potions.LINGERING_FACTOR, ling_dur_2), + no_effect = def.no_effect, } else ling_def_2 = { tt = get_tt(def._tt_2, effect_II, ling_dur_2), + longdesc = def._longdesc, potion_fun = get_lingering_fun(effect_II, ling_dur_2), + no_effect = def.no_effect, } end local arrow_def_2 = { tt = get_tt(def._tt_2, effect_II, dur_2/8.), + longdesc = def._longdesc, potion_fun = get_arrow_fun(effect_II, dur_2/8.), + no_effect = def.no_effect, } if def.color and not def.no_throwable then @@ -266,12 +295,12 @@ local function register_potion(def) minetest.register_craftitem("mcl_potions:"..def.name.."_plus", { description = S("@1 + Potion", def.description), _tt_help = get_tt(def._tt_plus, def.effect, dur_pl), - _doc_items_longdesc = def._longdesc, - _doc_items_usagehelp = how_to_drink, + _doc_items_longdesc = potion_longdesc, + _doc_items_usagehelp = potion_usagehelp, stack_max = 1, inventory_image = def.image or potion_image(def.color), wield_image = def.image or potion_image(def.color), - groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0}, + groups = def.groups or {brewitem=1, food=3, can_eat_when_full=1}, on_place = on_use, on_secondary_use = on_use, }) @@ -282,15 +311,21 @@ local function register_potion(def) local splash_def_pl = { tt = get_tt(def._tt_plus, def.effect, splash_dur_pl), + longdesc = def._longdesc, potion_fun = get_splash_fun(def.effect, splash_dur_pl), + no_effect = def.no_effect, } local ling_def_pl = { tt = get_tt(def._tt_plus, def.effect, ling_dur_pl), + longdesc = def._longdesc, potion_fun = get_lingering_fun(def.effect, ling_dur_pl), + no_effect = def.no_effect, } local arrow_def_pl = { tt = get_tt(def._tt_pl, def.effect, dur_pl/8.), + longdesc = def._longdesc, potion_fun = get_arrow_fun(def.effect, dur_pl/8.), + no_effect = def.no_effect, } if def.color and not def.no_throwable then mcl_potions.register_splash(def.name.."_plus", S("Splash @1 + Potion", def.description), def.color, splash_def_pl) @@ -324,10 +359,11 @@ local awkward_def = { name = "awkward", description = S("Awkward"), no_arrow = true, + no_effect = true, _tt = S("No effect"), _longdesc = S("Has an awkward taste and is used for brewing potions."), color = "#0000FF", - groups = {brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0}, + groups = {brewitem=1, food=3, can_eat_when_full=1}, on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), } @@ -335,8 +371,9 @@ local mundane_def = { name = "mundane", description = S("Mundane"), no_arrow = true, + no_effect = true, _tt = S("No effect"), - longdesc = S("Has a terrible taste and is not useful for brewing potions."), + _longdesc = S("Has a terrible taste and is not useful for brewing potions."), color = "#0000FF", on_use = minetest.item_eat(0, "mcl_potions:glass_bottle"), } @@ -345,6 +382,7 @@ local thick_def = { name = "thick", description = S("Thick"), no_arrow = true, + no_effect = true, _tt = S("No effect"), _longdesc = S("Has a bitter taste and is not useful for brewing potions."), color = "#0000FF", @@ -357,10 +395,10 @@ local dragon_breath_def = { no_arrow = true, no_potion = true, no_throwable = true, - _tt = S("No effect"), - _longdesc = S("Combine with Splash potions to create a Lingering effect"), + no_effect = true, + _longdesc = S("This item is used in brewing and can be combined with splash potions to create lingering potions."), color = "#BF4567", - groups = { brewitem = 1, not_in_creative_inventory = 0 }, + groups = { brewitem = 1 }, on_use = nil, stack_max = 64, } @@ -370,7 +408,7 @@ local healing_def = { description = S("Healing"), _tt = S("+2 hearts"), _tt_2 = S("+4 hearts"), - _longdesc = S("Drink to heal yourself"), + _longdesc = S("Instantly heals."), color = "#CC0000", effect = 4, on_use = mcl_potions.healing_func, @@ -383,7 +421,7 @@ local harming_def = { description = S("Harming"), _tt = S("-3 hearts"), _tt_II = S("-6 hearts"), - _longdesc = S("Drink to heal yourself"), + _longdesc = S("Instantly deals damage."), color = "#660099", effect = -6, on_use = mcl_potions.healing_func, @@ -395,7 +433,7 @@ local night_vision_def = { name = "night_vision", description = S("Night Vision"), _tt = nil, - _longdesc = S("Drink to see in the dark."), + _longdesc = S("Grants the ability to see in darkness."), color = "#1010AA", effect = nil, is_dur = true, @@ -407,7 +445,7 @@ local swiftness_def = { name = "swiftness", description = S("Swiftness"), _tt = nil, - _longdesc = S("Drink to increase your speed."), + _longdesc = S("Increases walking speed."), color = "#009999", effect = 1.2, is_dur = true, @@ -420,7 +458,7 @@ local slowness_def = { name = "slowness", description = S("Slowness"), _tt = nil, - _longdesc = S("Drink to become sluggish"), + _longdesc = S("Decreases walking speed."), color = "#000080", effect = 0.85, is_dur = true, @@ -434,7 +472,7 @@ local leaping_def = { name = "leaping", description = S("Leaping"), _tt = nil, - _longdesc = S("Drink to leap tall buildings in a single bound!"), + _longdesc = S("Increases jump strength."), color = "#00CC33", effect = 1.15, is_dur = true, @@ -447,7 +485,7 @@ local poison_def = { name = "poison", description = S("Poison"), _tt = nil, - _longdesc = S("Poison mobs or players with this dangerous potion."), + _longdesc = S("Applies the poison effect which deals damage at a regular interval."), color = "#447755", effect = 2.5, is_dur = true, @@ -461,7 +499,7 @@ local regeneration_def = { name = "regeneration", description = S("Regeneration"), _tt = nil, - _longdesc = S("Regenerate mobs or players with this healing potion over time."), + _longdesc = S("Regenerates health over time."), color = "#B52CC2", effect = 2.5, is_dur = true, @@ -474,7 +512,7 @@ local invisibility_def = { name = "invisibility", description = S("Invisibility"), _tt = nil, - _longdesc = S("Drink and become invisibile to mobs and players."), + _longdesc = S("Grants invisibility."), color = "#B0B0B0", is_dur = true, on_use = mcl_potions.invisiblility_func, @@ -485,7 +523,7 @@ local water_breathing_def = { name = "water_breathing", description = S("Water Breathing"), _tt = nil, - _longdesc = S("Drink and breath underwater."), + _longdesc = S("Grants limitless breath underwater."), color = "#0000AA", is_dur = true, on_use = mcl_potions.water_breathing_func, @@ -496,7 +534,7 @@ local fire_resistance_def = { name = "fire_resistance", description = S("Fire Resistance"), _tt = nil, - _longdesc = S("Drink and resist fire damage."), + _longdesc = S("Grants immunity to damage from heat sources like fire."), color = "#D0A040", is_dur = true, on_use = mcl_potions.fire_resistance_func, @@ -523,7 +561,7 @@ end -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#6600AA"), -- inventory_image = potion_image("#6600AA"), --- groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 }, +-- groups = { brewitem=1, food=3, can_eat_when_full=1 }, -- stack_max = 1, -- -- on_place = function(itemstack, user, pointed_thing) @@ -547,7 +585,7 @@ end -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#7700BB"), -- inventory_image = potion_image("#7700BB"), --- groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 }, +-- groups = { brewitem=1, food=3, can_eat_when_full=1 }, -- stack_max = 1, -- -- on_place = function(itemstack, user, pointed_thing) @@ -571,7 +609,7 @@ end -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#D444D4"), -- inventory_image = potion_image("#D444D4"), --- groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 }, +-- groups = { brewitem=1, food=3, can_eat_when_full=1 }, -- stack_max = 1, -- -- on_place = function(itemstack, user, pointed_thing) @@ -595,7 +633,7 @@ end -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#D444E4"), -- inventory_image = potion_image("#D444E4"), --- groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 }, +-- groups = { brewitem=1, food=3, can_eat_when_full=1 }, -- stack_max = 1, -- -- on_place = function(itemstack, user, pointed_thing) @@ -619,7 +657,7 @@ end -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#D444F4"), -- inventory_image = potion_image("#D444F4"), --- groups = { brewitem=1, food=3, can_eat_when_full=1, not_in_creative_inventory=0 }, +-- groups = { brewitem=1, food=3, can_eat_when_full=1 }, -- stack_max = 1, -- -- on_place = function(itemstack, user, pointed_thing) diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 8fa205109..779c75ac3 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -11,9 +11,18 @@ end function mcl_potions.register_splash(name, descr, color, def) local id = "mcl_potions:"..name.."_splash" + local longdesc = def.longdesc + if not def.no_effect then + longdesc = S("A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.") + if def.longdesc then + longdesc = longdesc .. "\n" .. def.longdesc + end + end minetest.register_craftitem(id, { description = descr, _tt_help = def.tt, + _doc_items_longdesc = longdesc, + _doc_items_usagehelp = S("Use the “Punch” key to throw it."), inventory_image = splash_image(color), groups = {brewitem=1, not_in_creative_inventory=0}, on_use = function(item, placer, pointed_thing) diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index 3e935ab39..b338a18e1 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -27,19 +27,23 @@ local function arrow_image(colorstring, opacity) end +local how_to_shoot = minetest.registered_items["mcl_bows:arrow"]._doc_items_usagehelp local mod_awards = minetest.get_modpath("awards") and minetest.get_modpath("mcl_achievements") local mod_button = minetest.get_modpath("mesecons_button") function mcl_potions.register_arrow(name, desc, color, def) + local longdesc = def.longdesc or "" minetest.register_craftitem("mcl_potions:"..name.."_arrow", { description = desc, _tt_help = S("Ammunition").."\n"..S("Damage from bow: 1-10").."\n"..S("Damage from dispenser: 3").."\n"..def.tt, _doc_items_longdesc = S("Arrows are ammunition for bows and dispensers.").."\n".. - S("An arrow fired from a bow has a regular damage of 1-9. At full charge, there's a 20% chance of a critical hit dealing 10 damage instead. An arrow fired from a dispenser always deals 3 damage.").."\n".. - S("Arrows might get stuck on solid blocks and can be retrieved again. They are also capable of pushing wooden buttons."), - _doc_items_usagehelp = S("To use arrows as ammunition for a bow, just put them anywhere in your inventory, they will be used up automatically. To use arrows as ammunition for a dispenser, place them in the dispenser's inventory. To retrieve an arrow that sticks in a block, simply walk close to it."), + S("An arrow fired from a bow has a regular damage of 1-9. At full charge, there's a 20% chance of a critical hit dealing 10 damage instead. An arrow fired from a dispenser always deals 3 damage.").."\n".. + S("Arrows might get stuck on solid blocks and can be retrieved again. They are also capable of pushing wooden buttons.").."\n".. + S("This particular arrow is tipped and will give an effect when it hits a player or mob.").."\n".. + longdesc, + _doc_items_usagehelp = how_to_shoot, inventory_image = "mcl_bows_arrow_inv.png^(mcl_potions_arrow_inv.png^[colorize:"..color..":100)", groups = { ammo=1, ammo_bow=1, brewitem=1}, _on_dispense = function(itemstack, dispenserpos, droppos, dropnode, dropdir) From acea309564fa9bd206f3635212779ed953646194 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 1 Aug 2020 08:36:22 -0400 Subject: [PATCH 021/152] Add poison effect for pufferfish, remove mcl_hunger control for pufferfish effect --- mods/ITEMS/mcl_fishing/init.lua | 14 +++++++++++--- mods/PLAYER/mcl_hunger/register_foods.lua | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 365dec0d2..b705d318f 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -417,8 +417,7 @@ minetest.register_craftitem("mcl_fishing:clownfish_raw", { _mcl_saturation = 0.2, }) --- Pufferfish --- TODO: Add real status effect + minetest.register_craftitem("mcl_fishing:pufferfish_raw", { description = S("Pufferfish"), _tt_help = minetest.colorize("#FFFF00", S("Very poisonous")), @@ -428,5 +427,14 @@ minetest.register_craftitem("mcl_fishing:pufferfish_raw", { on_secondary_use = minetest.item_eat(1), stack_max = 64, groups = { food=2, eatable=1, brewitem = 1 }, - _mcl_saturation = 0.2, + -- _mcl_saturation = 0.2, }) + + +minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, user, pointed_thing) + + if itemstack:get_name() == "mcl_fishing:pufferfish_raw" then + mcl_potions.poison_func(user, 1.25, 7) + end + +end ) diff --git a/mods/PLAYER/mcl_hunger/register_foods.lua b/mods/PLAYER/mcl_hunger/register_foods.lua index 449c1c4fe..d4c933169 100644 --- a/mods/PLAYER/mcl_hunger/register_foods.lua +++ b/mods/PLAYER/mcl_hunger/register_foods.lua @@ -8,4 +8,4 @@ mcl_hunger.register_food("mcl_mobitems:rotten_flesh", 4, "", 30, 0, 100, 80) mcl_hunger.register_food("mcl_mobitems:chicken", 2, "", 30, 0, 100, 30) mcl_hunger.register_food("mcl_mobitems:spider_eye", 2, "", 4, 1, 0) -mcl_hunger.register_food("mcl_fishing:pufferfish_raw", 1, "", 60, 1, 300) +-- mcl_hunger.register_food("mcl_fishing:pufferfish_raw", 1, "", 60, 1, 300) From 2ca2f25e589f4621f7f7bacf98b7758f0e82a36c Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 1 Aug 2020 08:39:50 -0400 Subject: [PATCH 022/152] Correct tooltip for healing/harming potions --- mods/ITEMS/mcl_potions/potions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 402b9a1d4..43e7e94b2 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -69,7 +69,7 @@ local function register_potion(def) _tt = "1/2 Heart/"..effect.."sec | "..time_string(dur) end elseif def.name == "healing" or def.name == "harming" then - _tt = (effect / 2).." Hearts" + _tt = ((effect / 2) - ((effect / 2)% 0.5)).." Hearts" else _tt = tt or time_string(dur) or S("No effect") end From 0a5cb628c54e03f6f7884c18d97d3be3b0cb073e Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 1 Aug 2020 08:42:31 -0400 Subject: [PATCH 023/152] make lowercase to conform to Wuzzy's previous commit. --- mods/ITEMS/mcl_potions/potions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index ef0414428..e1628a0a9 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -70,7 +70,7 @@ local function register_potion(def) _tt = "1/2 heart/"..effect.."s | "..time_string(dur) end elseif def.name == "healing" or def.name == "harming" then - _tt = ((effect / 2) - ((effect / 2)% 0.5)).." Hearts" + _tt = ((effect / 2) - ((effect / 2)% 0.5)).." hearts" else _tt = tt or time_string(dur) or S("No effect") end From afc6a1bb0fa17ae07905e1c0e1f5ff46ba47c1b7 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sat, 1 Aug 2020 05:44:02 +0400 Subject: [PATCH 024/152] Localize variable in mcl_beds --- mods/ITEMS/mcl_beds/functions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index b1a0ce4fd..389871497 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -364,7 +364,7 @@ end) minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() lay_down(player, nil, nil, false, true) - players = minetest.get_connected_players() + local players = minetest.get_connected_players() for n, player in ipairs(players) do if player:get_player_name() == name then players[n] = nil From 125840c9e46ba62e9a77ab2dd51239e3bec36a0a Mon Sep 17 00:00:00 2001 From: kay27 Date: Sun, 2 Aug 2020 19:46:09 +0400 Subject: [PATCH 025/152] Fix bucket stacks https://git.minetest.land/Wuzzy/MineClone2/issues/745 by removing leftovers of metadata usage --- mods/ITEMS/mcl_buckets/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index 1ed516554..3a06272b3 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -221,7 +221,7 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", { -- Fill bucket, but not in Creative Mode if not minetest.is_creative_enabled(user:get_player_name()) then - new_bucket = ItemStack({name = liquiddef.itemname, metadata = tostring(node.param2)}) + new_bucket = ItemStack({name = liquiddef.itemname}) end minetest.add_node(pointed_thing.under, {name="air"}) @@ -274,7 +274,7 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", { local new_bucket if liquiddef ~= nil and liquiddef.itemname ~= nil and (dropnode.name == liquiddef.source_take) then -- Fill bucket - new_bucket = ItemStack({name = liquiddef.itemname, metadata = tostring(dropnode.param2)}) + new_bucket = ItemStack({name = liquiddef.itemname}) sound_take(dropnode.name, droppos) collect_liquid = true end From af1ab424fc589b534807f22b8ea7368d37b070b8 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sun, 2 Aug 2020 20:44:18 -0400 Subject: [PATCH 026/152] Allow potion effects to remain after player logs off. --- mods/ITEMS/mcl_potions/functions.lua | 187 +++++++++++++++++---------- 1 file changed, 122 insertions(+), 65 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 80ee46f6f..048b5e52e 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -26,7 +26,7 @@ end -local is_player, entity +local is_player, entity, meta minetest.register_globalstep(function(dtime) @@ -40,6 +40,10 @@ minetest.register_globalstep(function(dtime) if is_invisible[player].timer >= is_invisible[player].dur then mcl_potions.make_invisible(player, false) is_invisible[player] = nil + if player:is_player() then + meta = player:get_meta() + meta:set_string("_is_invisible", minetest.serialize(is_invisible[player])) + end end end @@ -72,6 +76,8 @@ minetest.register_globalstep(function(dtime) if is_poisoned[player].timer >= is_poisoned[player].dur then is_poisoned[player] = nil if is_player then + meta = player:get_meta() + meta:set_string("_is_poisoned", minetest.serialize(is_poisoned[player])) potions_set_hudbar(player) end end @@ -106,6 +112,8 @@ minetest.register_globalstep(function(dtime) if is_regenerating[player].timer >= is_regenerating[player].dur then is_regenerating[player] = nil if is_player then + meta = player:get_meta() + meta:set_string("_is_regenerating", minetest.serialize(is_regenerating[player])) potions_set_hudbar(player) end end @@ -126,6 +134,8 @@ minetest.register_globalstep(function(dtime) end if is_water_breathing[player].timer >= is_water_breathing[player].dur then + meta = player:get_meta() + meta:set_string("_is_water_breathing", minetest.serialize(is_water_breathing[player])) is_water_breathing[player] = nil end @@ -147,6 +157,8 @@ minetest.register_globalstep(function(dtime) if is_leaping[player].timer >= is_leaping[player].dur then playerphysics.remove_physics_factor(player, "jump", "mcl_potions:leaping") is_leaping[player] = nil + meta = player:get_meta() + meta:set_string("_is_leaping", minetest.serialize(is_leaping[player])) end else @@ -167,6 +179,8 @@ minetest.register_globalstep(function(dtime) if is_swift[player].timer >= is_swift[player].dur then playerphysics.remove_physics_factor(player, "speed", "mcl_potions:swiftness") is_swift[player] = nil + meta = player:get_meta() + meta:set_string("_is_swift", minetest.serialize(is_swift[player])) end else @@ -190,6 +204,8 @@ minetest.register_globalstep(function(dtime) if is_cat[player].timer >= is_cat[player].dur then is_cat[player] = nil + meta = player:get_meta() + meta:set_string("_is_cat", minetest.serialize(is_cat[player])) end else @@ -211,6 +227,8 @@ minetest.register_globalstep(function(dtime) if is_fire_proof[player].timer >= is_fire_proof[player].dur then is_fire_proof[player] = nil + meta = player:get_meta() + meta:set_string("_is_fire_proof", minetest.serialize(is_fire_proof[player])) end else @@ -230,6 +248,8 @@ minetest.register_globalstep(function(dtime) if is_weak[player].timer >= is_weak[player].dur then is_weak[player] = nil + meta = player:get_meta() + meta:set_string("_is_weak", minetest.serialize(is_weak[player])) end else @@ -249,6 +269,8 @@ minetest.register_globalstep(function(dtime) if is_strong[player].timer >= is_strong[player].dur then is_strong[player] = nil + meta = player:get_meta() + meta:set_string("_is_strong", minetest.serialize(is_strong[player])) end else @@ -295,78 +317,113 @@ end, true) function mcl_potions._reset_player_effects(player) - if is_invisible[player] then - mcl_potions.make_invisible(player, false) - is_invisible[player] = nil - else --ensure player isn't invisible if he shouldn't be - mcl_potions.make_invisible(player, false) - end + if not player:is_player() then return end + meta = player:get_meta() - if is_poisoned[player] then + mcl_potions.make_invisible(player, false) + is_invisible[player] = nil + is_poisoned[player] = nil + is_regenerating[player] = nil + is_strong[player] = nil + is_weak[player] = nil + is_water_breathing[player] = nil - is_poisoned[player] = nil + is_leaping[player] = nil + playerphysics.remove_physics_factor(player, "jump", "mcl_potions:leaping") - if player:is_player() then - potions_set_hudbar(player) - end + is_swift[player] = nil + playerphysics.remove_physics_factor(player, "speed", "mcl_potions:swiftness") - end + is_cat[player] = nil + player:override_day_night_ratio(nil) - if is_regenerating[player] then + is_fire_proof[player] = nil - is_regenerating[player] = nil - - if player:is_player() then - potions_set_hudbar(player) - end - - end - - if is_strong[player] then - is_strong[player] = nil - end - - if is_weak[player] then - is_weak[player] = nil - end - - if is_water_breathing[player] then - is_water_breathing[player] = nil - end - - if is_leaping[player] then - is_leaping[player] = nil - playerphysics.remove_physics_factor(player, "jump", "mcl_potions:leaping") - else -- ensure no effects are stuck from previous potions - playerphysics.remove_physics_factor(player, "jump", "mcl_potions:leaping") - end - - if is_swift[player] then - is_swift[player] = nil - playerphysics.remove_physics_factor(player, "speed", "mcl_potions:swiftness") - else -- ensure no effects are stuck from previous potions - playerphysics.remove_physics_factor(player, "speed", "mcl_potions:swiftness") - end - - if is_cat[player] then - player:override_day_night_ratio(nil) - is_cat[player] = nil - else -- ensure no effects are stuck from previous potions - player:override_day_night_ratio(nil) - end - - if is_fire_proof[player] then - is_fire_proof[player] = nil - end + potions_set_hudbar(player) end -minetest.register_on_leaveplayer( function(player) mcl_potions._reset_player_effects(player) end) -minetest.register_on_dieplayer( function(player) mcl_potions._reset_player_effects(player) end) --- TODO It's not MC-like to remove all potion effects when a player leaves or returns, but...it keeps --- the server from crashing when it loops for a player that isn't online and by resetting on join, it --- avoids effects present that shouldn't be -minetest.register_on_joinplayer( function(player) mcl_potions._reset_player_effects(player) end) +function mcl_potions._save_player_effects(player) + + if not player:is_player() then return end + meta = player:get_meta() + + meta:set_string("_is_invisible", minetest.serialize(is_invisible[player])) + meta:set_string("_is_poisoned", minetest.serialize(is_poisoned[player])) + meta:set_string("_is_regenerating", minetest.serialize(is_regenerating[player])) + meta:set_string("_is_strong", minetest.serialize(is_strong[player])) + meta:set_string("_is_weak", minetest.serialize(is_weak[player])) + meta:set_string("_is_water_breathing", minetest.serialize(is_water_breathing[player])) + meta:set_string("_is_leaping", minetest.serialize(is_leaping[player])) + meta:set_string("_is_swift", minetest.serialize(is_swift[player])) + meta:set_string("_is_cat", minetest.serialize(is_cat[player])) + meta:set_string("_is_fire_proof", minetest.serialize(is_fire_proof[player])) + +end + +function mcl_potions._load_player_effects(player) + + if not player:is_player() then return end + meta = player:get_meta() + + if minetest.deserialize(meta:get_string("_is_invisible")) then + is_invisible[player] = minetest.deserialize(meta:get_string("_is_invisible")) + mcl_potions.make_invisible(player, true) + end + + if minetest.deserialize(meta:get_string("_is_poisoned")) then + is_poisoned[player] = minetest.deserialize(meta:get_string("_is_poisoned")) + end + + if minetest.deserialize(meta:get_string("_is_regenerating")) then + is_regenerating[player] = minetest.deserialize(meta:get_string("_is_regenerating")) + end + + if minetest.deserialize(meta:get_string("_is_strong")) then + is_strong[player] = minetest.deserialize(meta:get_string("_is_strong")) + end + + if minetest.deserialize(meta:get_string("_is_weak")) then + is_weak[player] = minetest.deserialize(meta:get_string("_is_weak")) + end + + if minetest.deserialize(meta:get_string("_is_water_breathing")) then + is_water_breathing[player] = minetest.deserialize(meta:get_string("_is_water_breathing")) + end + + if minetest.deserialize(meta:get_string("_is_leaping")) then + is_leaping[player] = minetest.deserialize(meta:get_string("_is_leaping")) + end + + if minetest.deserialize(meta:get_string("_is_swift")) then + is_swift[player] = minetest.deserialize(meta:get_string("_is_swift")) + end + + if minetest.deserialize(meta:get_string("_is_cat")) then + is_cat[player] = minetest.deserialize(meta:get_string("_is_cat")) + end + + if minetest.deserialize(meta:get_string("_is_fire_proof")) then + is_fire_proof[player] = minetest.deserialize(meta:get_string("_is_fire_proof")) + end + + potions_set_hudbar(player) + +end + +minetest.register_on_leaveplayer( function(player) + mcl_potions._save_player_effects(player) + mcl_potions._reset_player_effects(player) -- clearout the buffer to prevent looking for a player not there +end) + +minetest.register_on_dieplayer( function(player) + mcl_potions._reset_player_effects(player) +end) + +minetest.register_on_joinplayer( function(player) + mcl_potions._reset_player_effects(player) -- make sure there are no wierd holdover effects + mcl_potions._load_player_effects(player) +end) function mcl_potions.is_obj_hit(self, pos) @@ -411,7 +468,7 @@ function mcl_potions.make_invisible(player, toggle) elseif is_invisible[player] then -- show player player:set_properties({visual_size = is_invisible[player].old_size}) - player:set_nametag_attributes({color = {a = 255}}) + player:set_nametag_attributes({color = {r = 255, g = 255, b = 255, a = 255}}) end From 67e4e814f4bd103cd251fc662bbd567fde2cfa95 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sun, 2 Aug 2020 20:50:29 -0400 Subject: [PATCH 027/152] move hudbar stuff outside initial statement. --- mods/ITEMS/mcl_potions/functions.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 048b5e52e..0df06d15a 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -638,10 +638,6 @@ function mcl_potions.poison_func(player, factor, duration) is_poisoned[player] = {step = factor, dur = duration, timer = 0} - if player:is_player() then - potions_set_hudbar(player) - end - else local victim = is_poisoned[player] @@ -651,6 +647,11 @@ function mcl_potions.poison_func(player, factor, duration) victim.timer = 0 end + + if player:is_player() then + potions_set_hudbar(player) + end + end @@ -660,10 +661,6 @@ function mcl_potions.regeneration_func(player, factor, duration) is_regenerating[player] = {step = factor, dur = duration, timer = 0} - if player:is_player() then - potions_set_hudbar(player) - end - else local victim = is_regenerating[player] @@ -673,6 +670,11 @@ function mcl_potions.regeneration_func(player, factor, duration) victim.timer = 0 end + + if player:is_player() then + potions_set_hudbar(player) + end + end From 460d6e837ab3f4e5fc65baec2ec5b8c436c53f13 Mon Sep 17 00:00:00 2001 From: MysticTempest Date: Mon, 3 Aug 2020 08:37:58 -0500 Subject: [PATCH 028/152] Fix farm mobs following players slowly, adjust animations to follow suit, increase pig view range slightly, and change the runaway animation from walk to run. --- mods/ENTITIES/mcl_mobs/api.lua | 11 ++++++----- mods/ENTITIES/mcl_mobs/api.txt | 1 + mods/ENTITIES/mobs_mc/cow+mooshroom.lua | 9 +++++---- mods/ENTITIES/mobs_mc/horse.lua | 2 +- mods/ENTITIES/mobs_mc/llama.lua | 4 ++++ mods/ENTITIES/mobs_mc/ocelot.lua | 4 +++- mods/ENTITIES/mobs_mc/pig.lua | 5 +++-- mods/ENTITIES/mobs_mc/rabbit.lua | 1 + mods/ENTITIES/mobs_mc/sheep.lua | 4 ++-- mods/ENTITIES/mobs_mc/wolf.lua | 1 + mods/ENTITIES/mobs_mc_gameconfig/init.lua | 3 ++- 11 files changed, 29 insertions(+), 16 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 2d45bb257..622b87461 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -1931,16 +1931,16 @@ local follow_flop = function(self) if p.x > s.x then yaw = yaw + pi end - set_yaw(self, yaw, 6) + set_yaw(self, yaw, 2.35) -- anyone but standing npc's can move along - if dist > self.reach + if dist > 3 and self.order ~= "stand" then - set_velocity(self, self.walk_velocity) + set_velocity(self, self.follow_velocity) if self.walk_chance ~= 0 then - set_animation(self, "walk") + set_animation(self, "run") end else set_velocity(self, 0) @@ -2179,7 +2179,7 @@ local do_states = function(self, dtime) set_animation(self, "stand") else set_velocity(self, self.run_velocity) - set_animation(self, "walk") + set_animation(self, "run") end -- attack routines (explode, dogfight, shoot, dogshoot) @@ -3472,6 +3472,7 @@ minetest.register_entity(name, { sounds_child = def.sounds_child, explosion_strength = def.explosion_strength, suffocation_timer = 0, + follow_velocity = def.follow_velocity or 2.4, -- End of MCL2 extensions on_spawn = def.on_spawn, diff --git a/mods/ENTITIES/mcl_mobs/api.txt b/mods/ENTITIES/mcl_mobs/api.txt index 17a6a8b04..8b7f71192 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -241,6 +241,7 @@ functions needed for the mob to work properly which contains the following: dir is mob's aiming direction 'sounds_child' same as sounds, but for childs. If not defined, childs will use same sound as adults but with higher pitch + 'follow_velocity' The speed at which a mob moves toward the player when they're holding the appropriate follow item. Node Replacement diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index cb5bb029a..dc231627c 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -35,10 +35,11 @@ local cow_def = { distance = 16, }, animation = { - stand_speed = 25, walk_speed = 25, run_speed = 50, - stand_start = 0, stand_end = 0, - walk_start = 0, walk_end = 40, - run_start = 0, run_end = 40, + stand_speed = 25, walk_speed = 40, + run_speed = 60, stand_start = 0, + stand_end = 0, walk_start = 0, + walk_end = 40, run_start = 0, + run_end = 40, }, follow = mobs_mc.follow.cow, on_rightclick = function(self, clicker) diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index 32ebbc1a9..bb4a93e2c 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -96,7 +96,7 @@ local horse = { walk_speed = 25, walk_start = 0, walk_end = 40, - run_speed = 50, + run_speed = 60, run_start = 0, run_end = 40, }, diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 8215dcfd1..6391e867c 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -46,6 +46,7 @@ mobs:register_mob("mobs_mc:llama", { runaway = true, walk_velocity = 1, run_velocity = 4.4, + follow_velocity = 4.4, floats = 1, drops = { {name = mobs_mc.items.leather, @@ -61,6 +62,9 @@ mobs:register_mob("mobs_mc:llama", { }, animation = { speed_normal = 24, + run_speed = 60, + run_start = 0, + run_end = 40, stand_start = 0, stand_end = 0, walk_start = 0, diff --git a/mods/ENTITIES/mobs_mc/ocelot.lua b/mods/ENTITIES/mobs_mc/ocelot.lua index 5d7fe3bc2..89a41fe44 100644 --- a/mods/ENTITIES/mobs_mc/ocelot.lua +++ b/mods/ENTITIES/mobs_mc/ocelot.lua @@ -41,6 +41,7 @@ local ocelot = { walk_chance = default_walk_chance, walk_velocity = 1, run_velocity = 3, + follow_velocity = 1, floats = 1, runaway = true, fall_damage = 0, @@ -52,7 +53,7 @@ local ocelot = { }, animation = { speed_normal = 25, - speed_run = 50, + run_speed = 50, stand_start = 0, stand_end = 0, walk_start = 0, @@ -105,6 +106,7 @@ cat.order = "roam" -- "sit" or "roam" cat.owner_loyal = true cat.tamed = true cat.runaway = false +cat.follow_velocity = 2.4 -- Automatically teleport cat to owner cat.do_custom = mobs_mc.make_owner_teleport_function(12) cat.sounds = { diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index ebb3f7aa4..259f45d95 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -20,6 +20,7 @@ mobs:register_mob("mobs_mc:pig", { makes_footstep_sound = true, walk_velocity = 1, run_velocity = 3, + follow_velocity = 3.4, drops = { {name = mobs_mc.items.porkchop_raw, chance = 1, @@ -36,7 +37,7 @@ mobs:register_mob("mobs_mc:pig", { animation = { stand_speed = 40, walk_speed = 40, - run_speed = 50, + run_speed = 90, stand_start = 0, stand_end = 0, walk_start = 0, @@ -45,7 +46,7 @@ mobs:register_mob("mobs_mc:pig", { run_end = 40, }, follow = mobs_mc.follow.pig, - view_range = 5, + view_range = 8, do_custom = function(self, dtime) -- set needed values if not already present diff --git a/mods/ENTITIES/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua index 8c0885636..783a24ff4 100644 --- a/mods/ENTITIES/mobs_mc/rabbit.lua +++ b/mods/ENTITIES/mobs_mc/rabbit.lua @@ -27,6 +27,7 @@ local rabbit = { makes_footstep_sound = false, walk_velocity = 1, run_velocity = 3.7, + follow_velocity = 1.1, floats = 1, runaway = true, jump = true, diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index a0c0a8a08..374ea4b59 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -76,8 +76,8 @@ mobs:register_mob("mobs_mc:sheep", { distance = 16, }, animation = { - speed_normal = 25, speed_run = 50, - stand_start = 40, stand_end = 80, + speed_normal = 25, run_speed = 65, + stand_start = 40, stand_end = 80, walk_start = 0, walk_end = 40, run_start = 0, run_end = 40, }, diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index e99853655..058c57153 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -125,6 +125,7 @@ dog.owner = "" -- TODO: Start sitting by default dog.order = "roam" dog.owner_loyal = true +dog.follow_velocity = 3.2 -- Automatically teleport dog to owner dog.do_custom = mobs_mc.make_owner_teleport_function(12) dog.follow = mobs_mc.follow.dog diff --git a/mods/ENTITIES/mobs_mc_gameconfig/init.lua b/mods/ENTITIES/mobs_mc_gameconfig/init.lua index bcac2256a..5f4e37c43 100644 --- a/mods/ENTITIES/mobs_mc_gameconfig/init.lua +++ b/mods/ENTITIES/mobs_mc_gameconfig/init.lua @@ -129,9 +129,10 @@ mobs_mc.override.items = { }, } +--Horses, Llamas, and Wolves shouldn't follow, but leaving this alone until leads are implemented. mobs_mc.override.follow = { chicken = { "mcl_farming:wheat_seeds", "mcl_farming:melon_seeds", "mcl_farming:pumpkin_seeds", "mcl_farming:beetroot_seeds", }, - parrot = { "mcl_farming:seed_wheat", "mcl_farming:seed_beetroot", "mcl_farming:seed_pumpkin", "mcl_farming:seed_melon" }, -- seeds in general + parrot = { "mcl_farming:wheat_seeds", "mcl_farming:melon_seeds", "mcl_farming:pumpkin_seeds", "mcl_farming:beetroot_seeds", }, pig = { mobs_mc.override.items.potato, mobs_mc.override.items.carrot, "mcl_farming:beetroot_item", mobs_mc.override.items.carrot_on_a_stick}, ocelot = { mobs_mc.override.items.fish_raw, mobs_mc.override.items.salmon_raw, mobs_mc.override.items.clownfish_raw, mobs_mc.override.items.pufferfish_raw, }, sheep = { mobs_mc.override.items.wheat }, From b9a9b1b8141b5489c5fe160b37908a46e42568c2 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 3 Aug 2020 12:47:42 -0400 Subject: [PATCH 029/152] Add pretty weak version of chat commands to give oneself potion effects - for testing --- mods/ITEMS/mcl_potions/functions.lua | 118 ++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 0df06d15a..ef6ae622c 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -26,6 +26,20 @@ end +-- ███╗░░░███╗░█████╗░██╗███╗░░██╗  ███████╗███████╗███████╗███████╗░█████╗░████████╗ +-- ████╗░████║██╔══██╗██║████╗░██║  ██╔════╝██╔════╝██╔════╝██╔════╝██╔══██╗╚══██╔══╝ +-- ██╔████╔██║███████║██║██╔██╗██║  █████╗░░█████╗░░█████╗░░█████╗░░██║░░╚═╝░░░██║░░░ +-- ██║╚██╔╝██║██╔══██║██║██║╚████║  ██╔══╝░░██╔══╝░░██╔══╝░░██╔══╝░░██║░░██╗░░░██║░░░ +-- ██║░╚═╝░██║██║░░██║██║██║░╚███║  ███████╗██║░░░░░██║░░░░░███████╗╚█████╔╝░░░██║░░░ +-- ╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝╚═╝░░╚══╝  ╚══════╝╚═╝░░░░░╚═╝░░░░░╚══════╝░╚════╝░░░░╚═╝░░░ +-- +-- ░█████╗░██╗░░██╗███████╗░█████╗░██╗░░██╗███████╗██████╗░ +-- ██╔══██╗██║░░██║██╔════╝██╔══██╗██║░██╔╝██╔════╝██╔══██╗ +-- ██║░░╚═╝███████║█████╗░░██║░░╚═╝█████═╝░█████╗░░██████╔╝ +-- ██║░░██╗██╔══██║██╔══╝░░██║░░██╗██╔═██╗░██╔══╝░░██╔══██╗ +-- ╚█████╔╝██║░░██║███████╗╚█████╔╝██║░╚██╗███████╗██║░░██║ +-- ░╚════╝░╚═╝░░╚═╝╚══════╝░╚════╝░╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝ + local is_player, entity, meta minetest.register_globalstep(function(dtime) @@ -315,6 +329,22 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason) end, true) + +-- ███████╗███████╗███████╗███████╗░█████╗░████████╗ +-- ██╔════╝██╔════╝██╔════╝██╔════╝██╔══██╗╚══██╔══╝ +-- █████╗░░█████╗░░█████╗░░█████╗░░██║░░╚═╝░░░██║░░░ +-- ██╔══╝░░██╔══╝░░██╔══╝░░██╔══╝░░██║░░██╗░░░██║░░░ +-- ███████╗██║░░░░░██║░░░░░███████╗╚█████╔╝░░░██║░░░ +-- ╚══════╝╚═╝░░░░░╚═╝░░░░░╚══════╝░╚════╝░░░░╚═╝░░░ +-- +-- ██╗░░░░░░█████╗░░█████╗░██████╗░░░░░██╗░██████╗░█████╗░██╗░░░██╗███████╗ +-- ██║░░░░░██╔══██╗██╔══██╗██╔══██╗░░░██╔╝██╔════╝██╔══██╗██║░░░██║██╔════╝ +-- ██║░░░░░██║░░██║███████║██║░░██║░░██╔╝░╚█████╗░███████║╚██╗░██╔╝█████╗░░ +-- ██║░░░░░██║░░██║██╔══██║██║░░██║░██╔╝░░░╚═══██╗██╔══██║░╚████╔╝░██╔══╝░░ +-- ███████╗╚█████╔╝██║░░██║██████╔╝██╔╝░░░██████╔╝██║░░██║░░╚██╔╝░░███████╗ +-- ╚══════╝░╚════╝░╚═╝░░╚═╝╚═════╝░╚═╝░░░░╚═════╝░╚═╝░░╚═╝░░░╚═╝░░░╚══════╝ + + function mcl_potions._reset_player_effects(player) if not player:is_player() then return end @@ -425,6 +455,21 @@ minetest.register_on_joinplayer( function(player) mcl_potions._load_player_effects(player) end) + +-- ░██████╗██╗░░░██╗██████╗░██████╗░░█████╗░██████╗░████████╗██╗███╗░░██╗░██████╗░ +-- ██╔════╝██║░░░██║██╔══██╗██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██║████╗░██║██╔════╝░ +-- ╚█████╗░██║░░░██║██████╔╝██████╔╝██║░░██║██████╔╝░░░██║░░░██║██╔██╗██║██║░░██╗░ +-- ░╚═══██╗██║░░░██║██╔═══╝░██╔═══╝░██║░░██║██╔══██╗░░░██║░░░██║██║╚████║██║░░╚██╗ +-- ██████╔╝╚██████╔╝██║░░░░░██║░░░░░╚█████╔╝██║░░██║░░░██║░░░██║██║░╚███║╚██████╔╝ +-- ╚═════╝░░╚═════╝░╚═╝░░░░░╚═╝░░░░░░╚════╝░╚═╝░░╚═╝░░░╚═╝░░░╚═╝╚═╝░░╚══╝░╚═════╝░ +-- +-- ███████╗██╗░░░██╗███╗░░██╗░█████╗░████████╗██╗░█████╗░███╗░░██╗░██████╗ +-- ██╔════╝██║░░░██║████╗░██║██╔══██╗╚══██╔══╝██║██╔══██╗████╗░██║██╔════╝ +-- █████╗░░██║░░░██║██╔██╗██║██║░░╚═╝░░░██║░░░██║██║░░██║██╔██╗██║╚█████╗░ +-- ██╔══╝░░██║░░░██║██║╚████║██║░░██╗░░░██║░░░██║██║░░██║██║╚████║░╚═══██╗ +-- ██║░░░░░╚██████╔╝██║░╚███║╚█████╔╝░░░██║░░░██║╚█████╔╝██║░╚███║██████╔╝ +-- ╚═╝░░░░░░╚═════╝░╚═╝░░╚══╝░╚════╝░░░░╚═╝░░░╚═╝░╚════╝░╚═╝░░╚══╝╚═════╝░ + function mcl_potions.is_obj_hit(self, pos) local entity @@ -475,8 +520,6 @@ function mcl_potions.make_invisible(player, toggle) end - - function mcl_potions._use_potion(item, obj, color) local d = 0.1 local pos = obj:get_pos() @@ -525,6 +568,28 @@ end +-- ██████╗░░█████╗░░██████╗███████╗  ██████╗░░█████╗░████████╗██╗░█████╗░███╗░░██╗ +-- ██╔══██╗██╔══██╗██╔════╝██╔════╝  ██╔══██╗██╔══██╗╚══██╔══╝██║██╔══██╗████╗░██║ +-- ██████╦╝███████║╚█████╗░█████╗░░  ██████╔╝██║░░██║░░░██║░░░██║██║░░██║██╔██╗██║ +-- ██╔══██╗██╔══██║░╚═══██╗██╔══╝░░  ██╔═══╝░██║░░██║░░░██║░░░██║██║░░██║██║╚████║ +-- ██████╦╝██║░░██║██████╔╝███████╗  ██║░░░░░╚█████╔╝░░░██║░░░██║╚█████╔╝██║░╚███║ +-- ╚═════╝░╚═╝░░╚═╝╚═════╝░╚══════╝  ╚═╝░░░░░░╚════╝░░░░╚═╝░░░╚═╝░╚════╝░╚═╝░░╚══╝ +-- +-- ███████╗███████╗███████╗███████╗░█████╗░████████╗ +-- ██╔════╝██╔════╝██╔════╝██╔════╝██╔══██╗╚══██╔══╝ +-- █████╗░░█████╗░░█████╗░░█████╗░░██║░░╚═╝░░░██║░░░ +-- ██╔══╝░░██╔══╝░░██╔══╝░░██╔══╝░░██║░░██╗░░░██║░░░ +-- ███████╗██║░░░░░██║░░░░░███████╗╚█████╔╝░░░██║░░░ +-- ╚══════╝╚═╝░░░░░╚═╝░░░░░╚══════╝░╚════╝░░░░╚═╝░░░ +-- +-- ███████╗██╗░░░██╗███╗░░██╗░█████╗░████████╗██╗░█████╗░███╗░░██╗░██████╗ +-- ██╔════╝██║░░░██║████╗░██║██╔══██╗╚══██╔══╝██║██╔══██╗████╗░██║██╔════╝ +-- █████╗░░██║░░░██║██╔██╗██║██║░░╚═╝░░░██║░░░██║██║░░██║██╔██╗██║╚█████╗░ +-- ██╔══╝░░██║░░░██║██║╚████║██║░░██╗░░░██║░░░██║██║░░██║██║╚████║░╚═══██╗ +-- ██║░░░░░╚██████╔╝██║░╚███║╚█████╔╝░░░██║░░░██║╚█████╔╝██║░╚███║██████╔╝ +-- ╚═╝░░░░░░╚═════╝░╚═╝░░╚══╝░╚════╝░░░░╚═╝░░░╚═╝░╚════╝░╚═╝░░╚══╝╚═════╝░ + + function mcl_potions.healing_func(player, hp) local obj = player:get_luaentity() @@ -674,7 +739,7 @@ function mcl_potions.regeneration_func(player, factor, duration) if player:is_player() then potions_set_hudbar(player) end - + end @@ -747,3 +812,50 @@ function mcl_potions.night_vision_func(player, null, duration) end end + + +-- ░█████╗░██╗░░██╗░█████╗░████████╗  ░█████╗░░█████╗░███╗░░░███╗███╗░░░███╗░█████╗░███╗░░██╗██████╗░░██████╗ +-- ██╔══██╗██║░░██║██╔══██╗╚══██╔══╝  ██╔══██╗██╔══██╗████╗░████║████╗░████║██╔══██╗████╗░██║██╔══██╗██╔════╝ +-- ██║░░╚═╝███████║███████║░░░██║░░░  ██║░░╚═╝██║░░██║██╔████╔██║██╔████╔██║███████║██╔██╗██║██║░░██║╚█████╗░ +-- ██║░░██╗██╔══██║██╔══██║░░░██║░░░  ██║░░██╗██║░░██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚████║██║░░██║░╚═══██╗ +-- ╚█████╔╝██║░░██║██║░░██║░░░██║░░░  ╚█████╔╝╚█████╔╝██║░╚═╝░██║██║░╚═╝░██║██║░░██║██║░╚███║██████╔╝██████╔╝ +-- ░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░  ░╚════╝░░╚════╝░╚═╝░░░░░╚═╝╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═════╝░╚═════╝░ + + +local get_function = {} + +get_function["poison"] = mcl_potions.poison_func +get_function["regeneration"] = mcl_potions.regeneration_func +get_function["invisibility"] = mcl_potions.invisiblility_func +get_function["fire_resistance"] = mcl_potions.fire_resistance_func +get_function["night_vision"] = mcl_potions.night_vision_func +get_function["water_breathing"] = mcl_potions.water_breathing_func +get_function["leaping"] = mcl_potions.leaping_func +get_function["swiftness"] = mcl_potions.swiftness_func +get_function["heal"] = mcl_potions.healing_func + +minetest.register_chatcommand("potion",{ + params = "", + description = "Set player potion effects -- arguments ", + privs = {server = true}, + func = function(name, params) + + P = {} + i = 0 + for str in string.gmatch(params, "([^ ]+)") do + i = i + 1 + P[i] = str + end + + if not P[3] then + P[3] = P[2] + end + + if get_function[P[1]] then + get_function[P[1]](minetest.get_player_by_name(name), tonumber(P[2]), tonumber(P[3])) + else + minetest.chat_send_player(name, P[1].." is not an available potion effect.") + end + + end , +}) From c051a95dae016a34fabd627c8ffb2a1ff375b1e5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 13:56:49 +0200 Subject: [PATCH 030/152] Fix typo in mcl_brewing --- mods/ITEMS/mcl_brewing/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index 717e660e4..c4a6d6408 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -310,7 +310,7 @@ if minetest.get_modpath("screwdriver") then end local doc_string = - S("To use an brewing_stand, rightclick it.").."\n" + S("To use a brewing stand, rightclick it.").."\n" S("To brew, place fuel first and/or your ingredient last!") local tiles = {"mcl_brewing_top.png", --top From fe4093606572f669035251a6ed0a4d81000c0359 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 14:20:53 +0200 Subject: [PATCH 031/152] Remove redundant arrow help string definition --- mods/ITEMS/mcl_potions/tipped_arrow.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index b338a18e1..9870c96a6 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -32,17 +32,16 @@ local how_to_shoot = minetest.registered_items["mcl_bows:arrow"]._doc_items_usag local mod_awards = minetest.get_modpath("awards") and minetest.get_modpath("mcl_achievements") local mod_button = minetest.get_modpath("mesecons_button") +local arrow_longdesc = minetest.registered_items["mcl_bows:arrow"]._doc_items_longdesc or "" +local arrow_tt = minetest.registered_items["mcl_bows:arrow"]._tt_help or "" + function mcl_potions.register_arrow(name, desc, color, def) local longdesc = def.longdesc or "" minetest.register_craftitem("mcl_potions:"..name.."_arrow", { description = desc, - _tt_help = S("Ammunition").."\n"..S("Damage from bow: 1-10").."\n"..S("Damage from dispenser: 3").."\n"..def.tt, - _doc_items_longdesc = S("Arrows are ammunition for bows and dispensers.").."\n".. - S("An arrow fired from a bow has a regular damage of 1-9. At full charge, there's a 20% chance of a critical hit dealing 10 damage instead. An arrow fired from a dispenser always deals 3 damage.").."\n".. - S("Arrows might get stuck on solid blocks and can be retrieved again. They are also capable of pushing wooden buttons.").."\n".. - S("This particular arrow is tipped and will give an effect when it hits a player or mob.").."\n".. - longdesc, + _tt_help = arrow_tt .. "\n" .. def.tt, + _doc_items_longdesc = arrow_longdesc .. "\n" .. longdesc, _doc_items_usagehelp = how_to_shoot, inventory_image = "mcl_bows_arrow_inv.png^(mcl_potions_arrow_inv.png^[colorize:"..color..":100)", groups = { ammo=1, ammo_bow=1, brewitem=1}, From 431cd6386575b37fa2ef5796841ebee51886a2e1 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 14:21:48 +0200 Subject: [PATCH 032/152] Add mod.conf to mcl_potions --- mods/ITEMS/mcl_potions/depends.txt | 7 ------- mods/ITEMS/mcl_potions/mod.conf | 2 ++ 2 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 mods/ITEMS/mcl_potions/depends.txt create mode 100644 mods/ITEMS/mcl_potions/mod.conf diff --git a/mods/ITEMS/mcl_potions/depends.txt b/mods/ITEMS/mcl_potions/depends.txt deleted file mode 100644 index 1dba2975c..000000000 --- a/mods/ITEMS/mcl_potions/depends.txt +++ /dev/null @@ -1,7 +0,0 @@ -mcl_core -mcl_farming -mcl_mobitems -mcl_fishing -mcl_bows -mcl_end -playerphysics diff --git a/mods/ITEMS/mcl_potions/mod.conf b/mods/ITEMS/mcl_potions/mod.conf new file mode 100644 index 000000000..0fe50a64e --- /dev/null +++ b/mods/ITEMS/mcl_potions/mod.conf @@ -0,0 +1,2 @@ +name = mcl_potions +depends = mcl_core, mcl_farming, mcl_mobitems, mcl_fishing, mcl_bows, mcl_end, playerphysics From e20a630a19a6ed72c7decf235be6c7c3858796f9 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 14:24:21 +0200 Subject: [PATCH 033/152] mcl_brewing, mcl_potions: Update transl. templates --- .../mcl_brewing/locale/mcl_brewing.ru.tr | 6 +- mods/ITEMS/mcl_brewing/locale/template.txt | 6 +- .../mcl_potions/locale/mcl_potions.de.tr | 116 ++++++++++++++--- .../mcl_potions/locale/mcl_potions.es.tr | 118 ++++++++++++++++-- .../mcl_potions/locale/mcl_potions.fr.tr | 116 ++++++++++++++--- .../mcl_potions/locale/mcl_potions.ru.tr | 118 +++++++++++++++--- mods/ITEMS/mcl_potions/locale/template.txt | 109 +++++++++++++--- 7 files changed, 518 insertions(+), 71 deletions(-) diff --git a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr index 0ccc09fef..aa5c61ea4 100644 --- a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr +++ b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr @@ -1,3 +1,7 @@ # textdomain: mcl_brewing Brewing Stand=Варочный стенд -The brewing stand allows the creating of potions for the benefit of various effects. Stay tuned for developments, as you can only view the stand and interact with it, but not create potions.=Варочный стенд позволяет создавать зелья для достижения различных эффектов. Следите за разработкой, а пока вы можете только просматривать стенд и взаимодействовать с ним, но не создавать зелья. +Inventory= +To use a brewing stand, rightclick it.= +To brew, place fuel first and/or your ingredient last!= +The stand allows you to brew potions!= +Brew Potions= diff --git a/mods/ITEMS/mcl_brewing/locale/template.txt b/mods/ITEMS/mcl_brewing/locale/template.txt index 56cf672ac..3a8ed23e1 100644 --- a/mods/ITEMS/mcl_brewing/locale/template.txt +++ b/mods/ITEMS/mcl_brewing/locale/template.txt @@ -1,3 +1,7 @@ # textdomain: mcl_brewing Brewing Stand= -The brewing stand allows the creating of potions for the benefit of various effects. Stay tuned for developments, as you can only view the stand and interact with it, but not create potions. +Inventory= +To use a brewing stand, rightclick it.= +To brew, place fuel first and/or your ingredient last!= +The stand allows you to brew potions!= +Brew Potions= diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index 7d0c9f3e3..e89909054 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -1,25 +1,113 @@ # textdomain: mcl_potions -Put this item in an item frame for decoration. It's useless otherwise.=Platizeren Sie diesen Gegenstand in einen Rahmen als Deko. Ansonsten ist er nutzlos. Fermented Spider Eye=Fermentiertes Spinnenauge Glass Bottle=Glasflasche +Liquid container=Flüssigkeitsbehälter + A glass bottle is used as a container for liquids and can be used to collect water directly.=Eine Glasflasche wird als Behälter von Flüssigkeiten benutzt und kann Wasser direkt aufsammeln. + To collect water, use it on a cauldron with water (which removes a level of water) or any water source (which removes no water).=Um Wasser aufzusammen, benutzen Sie sie an einem Kessel mit Wasser (was etwas Wasser entfernt) oder einer Wasserquelle (was kein Wasser entfernt). + Water Bottle=Wasserflasche Water bottles can be used to fill cauldrons. Drinking water has no effect.=Wasserflaschen können benutzt werden, um Kessel aufzufüllen. Trinken hat keine Wirkung. -Rightclick to drink. Rightclick a cauldron to pour the water into the cauldron.=Rechtsklicken zum Trinken. Auf einem Kessel rechtsklicken, um das Wasser in den Kessel zu schütten. + +Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.=Benutzen Sie die „Platzieren“-Taste zum Trinken. Platzieren Sie diesen Gegenstand auf einen Kessel, um das Wasser in den Kessel zu schütten. + River Water Bottle=Flusswasserflasche River water bottles can be used to fill cauldrons. Drinking it has no effect.=Flusswasserflaschen können benutzt werden, um Kessel aufzufüllen. Trinken hat keine Wirkung. -Awkward Potion=Seltsamer Trank -This potion has an awkward taste and is used for brewing more potions. Drinking it has no effect.=Dieser Trank schmeckt komisch. Er wird zum Brauen von Tränken benutzt. Trinken hat keine Wirkung. -Mundane Potion=Klarer Trank -This potion has a clean taste and is used for brewing more potions. Drinking it has no effect.=Dieser Trank hat einen klaren Geschmack und wird zum Brauen von Tränken benutzt. Trinken hat keine Wirkung. -Thick Potion=Bitterer Trank -This potion has a bitter taste and is used for brewing more potions. Drinking it has no effect.=Dieser Trank hat einen bitteren Geschmack und wird zum Brauen von Tränken benutzt. Trinken hat keine Wirkung. -Glistering Melon=Glitzermelone -This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Diese glänzende Melone ist voller winziger Goldnuggets und sähe ganz nett in einem Rahmen aus. Er ist nicht essbar und auch sonst zu nichts zu gebrauchen. -Dragon's Breath=Drachenatem -Use the “Place” key to drink it.=Benutzen Sie die „Platzieren“-Taste zum Trinken. -Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.=Benutzen Sie die „Platzieren“-Taste zum Trinken. Platzieren Sie diesen Gegenstand auf einen Kessel, um das Wasser in den Kessel zu schütten. + Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Benutzen Sie die „Platzieren“-Taste zum Trinken. Platzieren Sie diesen Gegenstand auf einen Kessel, um das Flusswasser in den Kessel zu schütten. -Liquid container=Flüssigkeitsbehälter + +Splash Water Bottle= +Lingering Water Bottle= +Glistering Melon=Glitzermelone + +This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Diese glänzende Melone ist voller winziger Goldnuggets und sähe ganz nett in einem Rahmen aus. Er ist nicht essbar und auch sonst zu nichts zu gebrauchen. + +A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= + +Lingering Weakness Potion= +Lingering Weakness Potion += +Lingering Strength Potion= +Lingering Strength Potion II= +Lingering Strength Potion += +Use the “Punch” key to throw it.= +Use the “Place” key to drink it.=Benutzen Sie die „Platzieren“-Taste zum Trinken. +Drinking a potion gives you a particular effect.= +@1 Potion= +Splash @1 Potion= +Lingering @1 Potion= +Arrow of @1= + II= + IV= +@1 Potion@2= +Splash @1@2 Potion= +Lingering @1@2 Potion= +Arrow of @1@2= +@1 + Potion= +Splash @1 + Potion= +Lingering @1 + Potion= +Arrow of @1 += +Awkward= +Has an awkward taste and is used for brewing potions.= +Mundane= +Has a terrible taste and is not useful for brewing potions.= +Thick= +Has a bitter taste and is not useful for brewing potions.= +Dragon's Breath=Drachenatem + +This item is used in brewing and can be combined with splash potions to create lingering potions.= + +Healing= ++2 hearts= ++4 hearts= +Instantly heals.= +Harming= +-3 hearts= +-6 hearts= +Instantly deals damage.= +Night Vision= +Grants the ability to see in darkness.= +Swiftness= +Increases walking speed.= +Slowness= +Decreases walking speed.= +Leaping= +Increases jump strength.= +Poison= +Applies the poison effect which deals damage at a regular interval.= +Regeneration= +Regenerates health over time.= +Invisibility= +Grants invisibility.= +Water Breathing= +Grants limitless breath underwater.= +Fire Resistance= +Grants immunity to damage from heat sources like fire.= +Weakness= +-4 HP damage | 1:30= +Weakness += +-4 HP damage | 4:00= +Strength= ++3 HP damage | 3:00= +Strength II= ++6 HP damage | 1:30= +Strength += ++3 HP damage | 8:00= +Try different combinations to create potions.= No effect=Keine Wirkung + +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= + +Weakness Splash Potion= +Weakness Splash Potion += +Strength Splash Potion= +Strength Splash Potion II= +Strength Splash Potion += +This particular arrow is tipped and will give an effect when it hits a player or mob.= + + +#### not used anymore #### + +Awkward Potion=Seltsamer Trank +Mundane Potion=Klarer Trank +Thick Potion=Bitterer Trank diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr index 434fc8142..37cd3ce1e 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr @@ -1,23 +1,115 @@ # textdomain: mcl_potions -Put this item in an item frame for decoration. It's useless otherwise.=Pon este artículo en un marco de artículo para la decoración. Fermented Spider Eye=Ojo de araña fermentado Glass Bottle=Frasco de cristal +Liquid container= + A glass bottle is used as a container for liquids and can be used to collect water directly.=El frasco de cristal se usa como recipiente para líquidos y se puede usar para recoger agua directamente. + To collect water, use it on a cauldron with water (which removes a level of water) or any water source (which removes no water).=Para recoger agua, colóquela en un caldero con agua (que elimina un nivel de agua) o cualquier fuente de agua (que no elimine agua). + Water Bottle=Frasco de cristal con agua Water bottles can be used to fill cauldrons. Drinking water has no effect.=Las botellas de agua se pueden usar para llenar calderos. El agua potable no tiene efecto. -Rightclick to drink. Rightclick a cauldron to pour the water into the cauldron.=Haga clic derecho para beber. Haga clic derecho en un caldero para verter el agua en el caldero. + +Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.=Use la tecla "Acción" para beber. Coloque este artículo en un caldero para verter el agua en el caldero. + River Water Bottle=Frasco de cristal con agua de rio River water bottles can be used to fill cauldrons. Drinking it has no effect.=Las botellas de agua de río se pueden usar para llenar calderos. Beberlo no tiene ningún efecto. -Awkward Potion=Poción incomoda -This potion has an awkward taste and is used for brewing more potions. Drinking it has no effect.=Esta poción tiene un sabor extraño y se usa para preparar más pociones. Beberlo no tiene ningún efecto. -Mundane Potion=Poción Mundana -This potion has a clean taste and is used for brewing more potions. Drinking it has no effect.=Esta poción tiene un sabor limpio y se usa para preparar más pociones. Beberlo no tiene ningún efecto. -Thick Potion=Poción densa -This potion has a bitter taste and is used for brewing more potions. Drinking it has no effect.=Esta poción tiene un sabor amargo y se usa para preparar más pociones. Beberlo no tiene ningún efecto. -Glistering Melon=Rodaja de sandía reluciente -This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Esta sandía brillante está llena de pequeñas pepitas de oro y sería bueno en un marco de artículo. No es comestible y no es útil para nada más. -Dragon's Breath=Aliento de dragón -Use the “Place” key to drink it.=Use la tecla "Colocar" para beberlo. -Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.=Use la tecla "Acción" para beber. Coloque este artículo en un caldero para verter el agua en el caldero. + Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Use la tecla "Acción" para beber. Coloque este artículo en un caldero para verter el agua de río en el caldero. + +Splash Water Bottle= +Lingering Water Bottle= +Glistering Melon=Rodaja de sandía reluciente + +This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Esta sandía brillante está llena de pequeñas pepitas de oro y sería bueno en un marco de artículo. No es comestible y no es útil para nada más. + +A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= + +Lingering Weakness Potion= +Lingering Weakness Potion += +Lingering Strength Potion= +Lingering Strength Potion II= +Lingering Strength Potion += +Use the “Punch” key to throw it.= +Use the “Place” key to drink it.=Use la tecla "Colocar" para beberlo. +Drinking a potion gives you a particular effect.= +@1 Potion= +Splash @1 Potion= +Lingering @1 Potion= +Arrow of @1= + II= + IV= +@1 Potion@2= +Splash @1@2 Potion= +Lingering @1@2 Potion= +Arrow of @1@2= +@1 + Potion= +Splash @1 + Potion= +Lingering @1 + Potion= +Arrow of @1 += +Awkward= +Has an awkward taste and is used for brewing potions.= +Mundane= +Has a terrible taste and is not useful for brewing potions.= +Thick= +Has a bitter taste and is not useful for brewing potions.= +Dragon's Breath=Aliento de dragón + +This item is used in brewing and can be combined with splash potions to create lingering potions.= + +Healing= ++2 hearts= ++4 hearts= +Instantly heals.= +Harming= +-3 hearts= +-6 hearts= +Instantly deals damage.= +Night Vision= +Grants the ability to see in darkness.= +Swiftness= +Increases walking speed.= +Slowness= +Decreases walking speed.= +Leaping= +Increases jump strength.= +Poison= +Applies the poison effect which deals damage at a regular interval.= +Regeneration= +Regenerates health over time.= +Invisibility= +Grants invisibility.= +Water Breathing= +Grants limitless breath underwater.= +Fire Resistance= +Grants immunity to damage from heat sources like fire.= +Weakness= +-4 HP damage | 1:30= +Weakness += +-4 HP damage | 4:00= +Strength= ++3 HP damage | 3:00= +Strength II= ++6 HP damage | 1:30= +Strength += ++3 HP damage | 8:00= +Try different combinations to create potions.= +No effect= + +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= + +Weakness Splash Potion= +Weakness Splash Potion += +Strength Splash Potion= +Strength Splash Potion II= +Strength Splash Potion += +This particular arrow is tipped and will give an effect when it hits a player or mob.= + + + +##### not used anymore ##### + +# textdomain: mcl_potions +Awkward Potion=Poción incomoda +Mundane Potion=Poción Mundana +Thick Potion=Poción densa diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr index c196c6cbc..7726fe910 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr @@ -1,25 +1,113 @@ # textdomain: mcl_potions -Put this item in an item frame for decoration. It's useless otherwise.=Mettez cet élément dans un cadre à élément pour la décoration. C'est inutile sinon. Fermented Spider Eye=Oeil d'araignée fermenté Glass Bottle=Bouteille en verre +Liquid container=Récipient de liquide + A glass bottle is used as a container for liquids and can be used to collect water directly.=Une bouteille en verre est utilisée comme récipient pour les liquides et peut être utilisée pour collecter l'eau directement. + To collect water, use it on a cauldron with water (which removes a level of water) or any water source (which removes no water).=Pour collecter l'eau, poser la sur un chaudron avec de l'eau (qui enlève un niveau d'eau) ou toute source d'eau (qui n'enlève pas d'eau). + Water Bottle=Bouteille d'eau Water bottles can be used to fill cauldrons. Drinking water has no effect.=Les bouteilles d'eau peuvent être utilisées pour remplir les chaudrons. L'eau potable n'a aucun effet. -Rightclick to drink. Rightclick a cauldron to pour the water into the cauldron.=Clic droit pour boire. Clic droit sur un chaudron pour verser l'eau dans le chaudron. + +Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.=Utilisez la touche "Utiliser" pour boire. Placez cet article sur un chaudron pour verser l'eau dans le chaudron. + River Water Bottle=Bouteille d'eau de rivière River water bottles can be used to fill cauldrons. Drinking it has no effect.=Les bouteilles d'eau de rivière peuvent être utilisées pour remplir les chaudrons. Le boire n'a aucun effet. -Awkward Potion=Potion maladroite -This potion has an awkward taste and is used for brewing more potions. Drinking it has no effect.=Cette potion a un goût gênant et est utilisée pour préparer plus de potions. Le boire n'a aucun effet. -Mundane Potion=Potion mondaine -This potion has a clean taste and is used for brewing more potions. Drinking it has no effect.=Cette potion a un goût propre et est utilisée pour préparer plus de potions. Le boire n'a aucun effet. -Thick Potion=Potion épaisse -This potion has a bitter taste and is used for brewing more potions. Drinking it has no effect.=Cette potion a un goût amer et est utilisée pour préparer plus de potions. Le boire n'a aucun effet. -Glistering Melon=Melon étincelant -This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Ce melon brillant est plein de minuscules pépites d'or et serait bien dans un cadre d'objet. Il n'est pas comestible et n'est utile à rien d'autre. -Dragon's Breath=Le souffle du dragon -Use the “Place” key to drink it.=Utilisez la touche "Utiliser" pour le boire. -Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.=Utilisez la touche "Utiliser" pour boire. Placez cet article sur un chaudron pour verser l'eau dans le chaudron. + Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Utilisez la touche "Utiliser" pour boire. Placez cet objet sur un chaudron pour verser l'eau de la rivière dans le chaudron. -Liquid container=Récipient de liquide + +Splash Water Bottle= +Lingering Water Bottle= +Glistering Melon=Melon étincelant + +This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Ce melon brillant est plein de minuscules pépites d'or et serait bien dans un cadre d'objet. Il n'est pas comestible et n'est utile à rien d'autre. + +A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= + +Lingering Weakness Potion= +Lingering Weakness Potion += +Lingering Strength Potion= +Lingering Strength Potion II= +Lingering Strength Potion += +Use the “Punch” key to throw it.= +Use the “Place” key to drink it.=Utilisez la touche "Utiliser" pour le boire. +Drinking a potion gives you a particular effect.= +@1 Potion= +Splash @1 Potion= +Lingering @1 Potion= +Arrow of @1= + II= + IV= +@1 Potion@2= +Splash @1@2 Potion= +Lingering @1@2 Potion= +Arrow of @1@2= +@1 + Potion= +Splash @1 + Potion= +Lingering @1 + Potion= +Arrow of @1 += +Awkward= +Has an awkward taste and is used for brewing potions.= +Mundane= +Has a terrible taste and is not useful for brewing potions.= +Thick= +Has a bitter taste and is not useful for brewing potions.= +Dragon's Breath=Le souffle du dragon + +This item is used in brewing and can be combined with splash potions to create lingering potions.= + +Healing= ++2 hearts= ++4 hearts= +Instantly heals.= +Harming= +-3 hearts= +-6 hearts= +Instantly deals damage.= +Night Vision= +Grants the ability to see in darkness.= +Swiftness= +Increases walking speed.= +Slowness= +Decreases walking speed.= +Leaping= +Increases jump strength.= +Poison= +Applies the poison effect which deals damage at a regular interval.= +Regeneration= +Regenerates health over time.= +Invisibility= +Grants invisibility.= +Water Breathing= +Grants limitless breath underwater.= +Fire Resistance= +Grants immunity to damage from heat sources like fire.= +Weakness= +-4 HP damage | 1:30= +Weakness += +-4 HP damage | 4:00= +Strength= ++3 HP damage | 3:00= +Strength II= ++6 HP damage | 1:30= +Strength += ++3 HP damage | 8:00= +Try different combinations to create potions.= No effect=Aucun effet + +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= + +Weakness Splash Potion= +Weakness Splash Potion += +Strength Splash Potion= +Strength Splash Potion II= +Strength Splash Potion += +This particular arrow is tipped and will give an effect when it hits a player or mob.= + + + +##### not used anymore ##### +Awkward Potion=Potion maladroite +Mundane Potion=Potion mondaine +Thick Potion=Potion épaisse diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr index b1016bb24..a1ad41f09 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr @@ -1,25 +1,115 @@ # textdomain: mcl_potions -Put this item in an item frame for decoration. It's useless otherwise.=Положите этот предмет в рамку для красоты. Для всего остального он бесполезен. Fermented Spider Eye=Прокисший паучий глаз Glass Bottle=Стеклянная бутылка +Liquid container=Контейнер для жидкостей + A glass bottle is used as a container for liquids and can be used to collect water directly.=Стеклянная бутылка используется для хранения жидкостей, её также можно использовать для сбора воды. + To collect water, use it on a cauldron with water (which removes a level of water) or any water source (which removes no water).=Воду в бутылку можно набрать из котла с помощью команды [Использовать] (это уменьшает уровень воды в котле) или из другого источника (уровень которого не уменьшится). + Water Bottle=Бутылка с водой Water bottles can be used to fill cauldrons. Drinking water has no effect.=Бутылки с водой можно использовать для наполнения котлов. Выпивание воды не даст никакого эффекта. -Rightclick to drink. Rightclick a cauldron to pour the water into the cauldron.=Кликните правой, чтобы выпить. Правый клик по котлу выльет воду из бутылки в котёл. + +Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.=Используйте клавишу “Разместить”, чтобы выпить это. Поместите этот предмет на котёл, чтобы вылить воду в котёл. + River Water Bottle=Бутылка с речной водой River water bottles can be used to fill cauldrons. Drinking it has no effect.=Бутылки с речной водой можно использовать для наполнения котлов. Выпивание воды не даст никакого эффекта. -Awkward Potion=Невкусное зелье -This potion has an awkward taste and is used for brewing more potions. Drinking it has no effect.=Невкусное зелье используется для приготовления других зелий. Приём внутрь не даёт никакого эффекта. -Mundane Potion=Успокоительное зелье -This potion has a clean taste and is used for brewing more potions. Drinking it has no effect.=Успокоительное зелье имеет чистый вкус и используется для приготовления других зелий. Приём внутрь не даёт никакого эффекта. -Thick Potion=Густое зелье -This potion has a bitter taste and is used for brewing more potions. Drinking it has no effect.=Густое зелье имеет горький вкус и используется для приготовления других зелий. Приём внутрь не даёт никакого эффекта. -Glistering Melon=Искрящаяся дыня -This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Искрящаяся дыня полна маленьких золотых самородков и может отлично смотреться в рамке. Она несъедобна и не годится больше ни для чего. -Dragon's Breath=Дыхание дракона -Use the “Place” key to drink it.=Используйте клавишу “Разместить”, чтобы выпить это. -Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.=Используйте клавишу “Разместить”, чтобы выпить это. Поместите этот предмет на котёл, чтобы вылить воду в котёл. + Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Используйте клавишу “Разместить”, чтобы выпить это. Поместите этот предмет на котёл, чтобы вылить речную воду в котёл. -Liquid container=Контейнер для жидкостей + +Splash Water Bottle= +Lingering Water Bottle= +Glistering Melon=Искрящаяся дыня + +This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Искрящаяся дыня полна маленьких золотых самородков и может отлично смотреться в рамке. Она несъедобна и не годится больше ни для чего. + +A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= + +Lingering Weakness Potion= +Lingering Weakness Potion += +Lingering Strength Potion= +Lingering Strength Potion II= +Lingering Strength Potion += +Use the “Punch” key to throw it.= +Use the “Place” key to drink it.=Используйте клавишу “Разместить”, чтобы выпить это. +Drinking a potion gives you a particular effect.= +@1 Potion= +Splash @1 Potion= +Lingering @1 Potion= +Arrow of @1= + II= + IV= +@1 Potion@2= +Splash @1@2 Potion= +Lingering @1@2 Potion= +Arrow of @1@2= +@1 + Potion= +Splash @1 + Potion= +Lingering @1 + Potion= +Arrow of @1 += +Awkward= +Has an awkward taste and is used for brewing potions.= +Mundane= +Has a terrible taste and is not useful for brewing potions.= +Thick= +Has a bitter taste and is not useful for brewing potions.= +Dragon's Breath=Дыхание дракона + +This item is used in brewing and can be combined with splash potions to create lingering potions.= + +Healing= ++2 hearts= ++4 hearts= +Instantly heals.= +Harming= +-3 hearts= +-6 hearts= +Instantly deals damage.= +Night Vision= +Grants the ability to see in darkness.= +Swiftness= +Increases walking speed.= +Slowness= +Decreases walking speed.= +Leaping= +Increases jump strength.= +Poison= +Applies the poison effect which deals damage at a regular interval.= +Regeneration= +Regenerates health over time.= +Invisibility= +Grants invisibility.= +Water Breathing= +Grants limitless breath underwater.= +Fire Resistance= +Grants immunity to damage from heat sources like fire.= +Weakness= +-4 HP damage | 1:30= +Weakness += +-4 HP damage | 4:00= +Strength= ++3 HP damage | 3:00= +Strength II= ++6 HP damage | 1:30= +Strength += ++3 HP damage | 8:00= +Try different combinations to create potions.= No effect=Не оказывает эффекта + +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= + +Weakness Splash Potion= +Weakness Splash Potion += +Strength Splash Potion= +Strength Splash Potion II= +Strength Splash Potion += +This particular arrow is tipped and will give an effect when it hits a player or mob.= + + + +##### not used anymore ##### + +# textdomain: mcl_potions +Awkward Potion=Невкусное зелье +Mundane Potion=Успокоительное зелье +Thick Potion=Густое зелье diff --git a/mods/ITEMS/mcl_potions/locale/template.txt b/mods/ITEMS/mcl_potions/locale/template.txt index 7d0ee7f63..f76cb601f 100644 --- a/mods/ITEMS/mcl_potions/locale/template.txt +++ b/mods/ITEMS/mcl_potions/locale/template.txt @@ -1,25 +1,106 @@ # textdomain: mcl_potions -Put this item in an item frame for decoration. It's useless otherwise.= Fermented Spider Eye= Glass Bottle= +Liquid container= + A glass bottle is used as a container for liquids and can be used to collect water directly.= + To collect water, use it on a cauldron with water (which removes a level of water) or any water source (which removes no water).= + Water Bottle= Water bottles can be used to fill cauldrons. Drinking water has no effect.= -Rightclick to drink. Rightclick a cauldron to pour the water into the cauldron.= + +Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.= + River Water Bottle= River water bottles can be used to fill cauldrons. Drinking it has no effect.= -Awkward Potion= -This potion has an awkward taste and is used for brewing more potions. Drinking it has no effect.= -Mundane Potion= -This potion has a clean taste and is used for brewing more potions. Drinking it has no effect.= -Thick Potion= -This potion has a bitter taste and is used for brewing more potions. Drinking it has no effect.= -Glistering Melon= -This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.= -Dragon's Breath= -Use the “Place” key to drink it.= -Use the “Place” key to drink. Place this item on a cauldron to pour the water into the cauldron.= + Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.= -Liquid container= + +Splash Water Bottle= +Lingering Water Bottle= +Glistering Melon= + +This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.= + +A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= + +Lingering Weakness Potion= +Lingering Weakness Potion += +Lingering Strength Potion= +Lingering Strength Potion II= +Lingering Strength Potion += +Use the “Punch” key to throw it.= +Use the “Place” key to drink it.= +Drinking a potion gives you a particular effect.= +@1 Potion= +Splash @1 Potion= +Lingering @1 Potion= +Arrow of @1= + II= + IV= +@1 Potion@2= +Splash @1@2 Potion= +Lingering @1@2 Potion= +Arrow of @1@2= +@1 + Potion= +Splash @1 + Potion= +Lingering @1 + Potion= +Arrow of @1 += +Awkward= +Has an awkward taste and is used for brewing potions.= +Mundane= +Has a terrible taste and is not useful for brewing potions.= +Thick= +Has a bitter taste and is not useful for brewing potions.= +Dragon's Breath= + +This item is used in brewing and can be combined with splash potions to create lingering potions.= + +Healing= ++2 hearts= ++4 hearts= +Instantly heals.= +Harming= +-3 hearts= +-6 hearts= +Instantly deals damage.= +Night Vision= +Grants the ability to see in darkness.= +Swiftness= +Increases walking speed.= +Slowness= +Decreases walking speed.= +Leaping= +Increases jump strength.= +Poison= +Applies the poison effect which deals damage at a regular interval.= +Regeneration= +Regenerates health over time.= +Invisibility= +Grants invisibility.= +Water Breathing= +Grants limitless breath underwater.= +Fire Resistance= +Grants immunity to damage from heat sources like fire.= +Weakness= +-4 HP damage | 1:30= +Weakness += +-4 HP damage | 4:00= +Strength= ++3 HP damage | 3:00= +Strength II= ++6 HP damage | 1:30= +Strength += ++3 HP damage | 8:00= +Try different combinations to create potions.= No effect= + +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= + +Weakness Splash Potion= +Weakness Splash Potion += +Strength Splash Potion= +Strength Splash Potion II= +Strength Splash Potion += +This particular arrow is tipped and will give an effect when it hits a player or mob.= From 87bf6c12b2442413ec79390738bf969a1f669583 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 14:44:27 +0200 Subject: [PATCH 034/152] Add German potion translation --- .../mcl_brewing/locale/mcl_brewing.de.tr | 7 + .../mcl_potions/locale/mcl_potions.de.tr | 150 +++++++++--------- 2 files changed, 82 insertions(+), 75 deletions(-) create mode 100644 mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr diff --git a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr new file mode 100644 index 000000000..34a9c28b4 --- /dev/null +++ b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr @@ -0,0 +1,7 @@ +# textdomain: mcl_brewing +Brewing Stand=Braustand +Inventory=Inventar +To use a brewing stand, rightclick it.=Um einen Braustand zu benutzen, rechtsklicken Sie ihn. +To brew, place fuel first and/or your ingredient last!=Um zu brauen, zuerst Brennstoff platzieren, dann ggf. die Zutat zuletzt platzieren! +The stand allows you to brew potions!=Der Stand ermöglicht das Brauen von Tränken. +Brew Potions=Tränke brauen diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index e89909054..29035c96a 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -17,93 +17,93 @@ River water bottles can be used to fill cauldrons. Drinking it has no effect.=Fl Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Benutzen Sie die „Platzieren“-Taste zum Trinken. Platzieren Sie diesen Gegenstand auf einen Kessel, um das Flusswasser in den Kessel zu schütten. -Splash Water Bottle= -Lingering Water Bottle= +Splash Water Bottle=Wurfwasserflasche +Lingering Water Bottle=Verweilwasserflasche Glistering Melon=Glitzermelone This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Diese glänzende Melone ist voller winziger Goldnuggets und sähe ganz nett in einem Rahmen aus. Er ist nicht essbar und auch sonst zu nichts zu gebrauchen. -A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= +A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.=Ein werfbarer Trank, der bei Kollision zerbrechen wird, wo er eine magische Wolke erzeugt, die für eine gewisse Zeit verweilen wird. Jeder Spieler und jede Mob in der Wolke wird die Trankwirkung erhalten, möglicherweise mehrmals. -Lingering Weakness Potion= -Lingering Weakness Potion += -Lingering Strength Potion= -Lingering Strength Potion II= -Lingering Strength Potion += -Use the “Punch” key to throw it.= +Lingering Weakness Potion=Schwächeverweiltrank +Lingering Weakness Potion +=Schwächeverweiltrank + +Lingering Strength Potion=Stärkeverweiltrank +Lingering Strength Potion II=Stärkeverweiltrank II +Lingering Strength Potion +=Stärkeverweiltrank + +Use the “Punch” key to throw it.=Benutzen Sie die „Platzieren“-Taste zum Werfen. Use the “Place” key to drink it.=Benutzen Sie die „Platzieren“-Taste zum Trinken. -Drinking a potion gives you a particular effect.= -@1 Potion= -Splash @1 Potion= -Lingering @1 Potion= -Arrow of @1= - II= - IV= -@1 Potion@2= -Splash @1@2 Potion= -Lingering @1@2 Potion= -Arrow of @1@2= -@1 + Potion= -Splash @1 + Potion= -Lingering @1 + Potion= -Arrow of @1 += -Awkward= -Has an awkward taste and is used for brewing potions.= -Mundane= -Has a terrible taste and is not useful for brewing potions.= -Thick= -Has a bitter taste and is not useful for brewing potions.= +Drinking a potion gives you a particular effect.=Das Trinken eines Tranks gibt Ihnen einen bestimmten Effekt +@1 Potion=@1-Trank +Splash @1 Potion=@1-Wurftrank +Lingering @1 Potion=@1-Verweiltrank +Arrow of @1=@1-Pfeil + II= II + IV= IV +@1 Potion@2=@1-Trank@2 +Splash @1@2 Potion=@1@2-Wurftrank +Lingering @1@2 Potion=@1@1-Verweiltrank +Arrow of @1@2=@1@2-Pfeil +@1 + Potion=@1 +-Trank +Splash @1 + Potion=@1 +-Wurftrank +Lingering @1 + Potion=@1 +-Verweiltrank +Arrow of @1 +=@1 +-Pfeil +Awkward=Seltsam +Has an awkward taste and is used for brewing potions.=Hat einen seltsamen Geschmack und wird in der Trankherstellung benutzt. +Mundane=Klarer +Has a terrible taste and is not useful for brewing potions.=Hat einen furchtbaren Geschmack und ist nicht für die Trankherstellung brauchbar. +Thick=Bitter +Has a bitter taste and is not useful for brewing potions.=Hat einen bitteren Geschmack und ist nicht für die Trankherstellung brauchbar. Dragon's Breath=Drachenatem -This item is used in brewing and can be combined with splash potions to create lingering potions.= +This item is used in brewing and can be combined with splash potions to create lingering potions.=Dieser Objekt wird für die Trankherstellung benutzt und kann mit Wurftränken kombiniert werden, um Verweiltränke herzustellen. -Healing= -+2 hearts= -+4 hearts= -Instantly heals.= -Harming= --3 hearts= --6 hearts= -Instantly deals damage.= -Night Vision= -Grants the ability to see in darkness.= -Swiftness= -Increases walking speed.= -Slowness= -Decreases walking speed.= -Leaping= -Increases jump strength.= -Poison= -Applies the poison effect which deals damage at a regular interval.= -Regeneration= -Regenerates health over time.= -Invisibility= -Grants invisibility.= -Water Breathing= -Grants limitless breath underwater.= -Fire Resistance= -Grants immunity to damage from heat sources like fire.= -Weakness= --4 HP damage | 1:30= -Weakness += --4 HP damage | 4:00= -Strength= -+3 HP damage | 3:00= -Strength II= -+6 HP damage | 1:30= -Strength += -+3 HP damage | 8:00= -Try different combinations to create potions.= +Healing=Heilen ++2 hearts=+2 Herzen ++4 hearts=+4 Herzen +Instantly heals.=Heilt sofort. +Harming=Schaden +-3 hearts=-3 Herzen +-6 hearts=-6 Herzen +Instantly deals damage.=Richtet sofort Schaden an. +Night Vision=Nachtricht +Grants the ability to see in darkness.=Gibt die Fähigkeit, in der Dunkelheit zu sehen. +Swiftness=Schnelligkeit +Increases walking speed.=Erhöht Gehgeschwindigkeit. +Slowness=Langsamkeit +Decreases walking speed.=Verringert Gehgeschwindigkeit. +Leaping=Sprung +Increases jump strength.=Erhöht Sprunghöhe. +Poison=Gift +Applies the poison effect which deals damage at a regular interval.=Gibt den Gifteffekt, der Schaden in regelmäßigen Abständen anrichtet. +Regeneration=Regenerierung +Regenerates health over time.=Regenieriert Gesundheit mit der Zeit. +Invisibility=Unsichtbarkeit +Grants invisibility.=Gibt Unsichtbarkeit. +Water Breathing=Wasseratem +Grants limitless breath underwater.=Gibt unbegrenzen Atem im Wasser. +Fire Resistance=Feuerwiderstand +Grants immunity to damage from heat sources like fire.=Gibt Immunität gegenüber Schaden von Hitzequellen wie Feuer. +Weakness=Schwäche +-4 HP damage | 1:30=-4 HP Schaden | 1:30 +Weakness +=Schwäche + +-4 HP damage | 4:00=-4 HP Schaden | 4:00 +Strength=Stärke ++3 HP damage | 3:00=+3 HP Schaden | 3:00 +Strength II=Stärke II ++6 HP damage | 1:30=+6 HP Schaden | 1:30 +Strength +=Stärke + ++3 HP damage | 8:00=+3 HP Schaden | 8:00 +Try different combinations to create potions.=Probieren Sie Kombinationen aus, um Tränke herzustellen. No effect=Keine Wirkung -A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.=Ein werfbarer Trank, der bei Kollision zerbrechen wird, wo er allen nahen Spielern und Mobs einen Statuseffekt geben wird. -Weakness Splash Potion= -Weakness Splash Potion += -Strength Splash Potion= -Strength Splash Potion II= -Strength Splash Potion += -This particular arrow is tipped and will give an effect when it hits a player or mob.= +Weakness Splash Potion=Schwächewurftrank +Weakness Splash Potion +=Schwächewurftrank + +Strength Splash Potion=Stärkewurftrank +Strength Splash Potion II=Stärkewurftrank II +Strength Splash Potion +=Stärkewurftrank + +This particular arrow is tipped and will give an effect when it hits a player or mob.=Dies Pfeilspitze dieses Pfeils in einem Trank getränkt und gibt einen Effekt, wenn er einen Spieler oder einen Mob trifft. #### not used anymore #### From e519c62c8b145bd9fa18422bab5d1b44a70b2fa0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 15:10:05 +0200 Subject: [PATCH 035/152] Clean up more potion-related strings --- .../mcl_inventory/locale/mcl_inventory.de.tr | 1 + .../mcl_inventory/locale/mcl_inventory.es.tr | 1 + .../mcl_inventory/locale/mcl_inventory.fr.tr | 1 + .../mcl_inventory/locale/mcl_inventory.ru.tr | 1 + mods/HUD/mcl_inventory/locale/template.txt | 1 + mods/ITEMS/mcl_potions/init.lua | 4 +- mods/ITEMS/mcl_potions/potions.lua | 45 ++++++++++++++----- mods/ITEMS/mcl_potions/tipped_arrow.lua | 4 +- 8 files changed, 43 insertions(+), 15 deletions(-) diff --git a/mods/HUD/mcl_inventory/locale/mcl_inventory.de.tr b/mods/HUD/mcl_inventory/locale/mcl_inventory.de.tr index a2aa355db..d565240d1 100644 --- a/mods/HUD/mcl_inventory/locale/mcl_inventory.de.tr +++ b/mods/HUD/mcl_inventory/locale/mcl_inventory.de.tr @@ -7,6 +7,7 @@ Building Blocks=Baublöcke Decoration Blocks=Dekoblöcke Redstone=Redstone Transportation=Transport +Brewing=Gebräu Miscellaneous=Sonstiges Search Items=Gegenstände durchsuchen Foodstuffs=Lebensmittel diff --git a/mods/HUD/mcl_inventory/locale/mcl_inventory.es.tr b/mods/HUD/mcl_inventory/locale/mcl_inventory.es.tr index b8160256e..d097daa14 100644 --- a/mods/HUD/mcl_inventory/locale/mcl_inventory.es.tr +++ b/mods/HUD/mcl_inventory/locale/mcl_inventory.es.tr @@ -7,6 +7,7 @@ Building Blocks=Bloques de construcción Decoration Blocks=Bloques de decoración Redstone=Redstone Transportation=Transporte +Brewing= Miscellaneous=Variado Search Items=Buscar artículos Foodstuffs=Productos alimenticios diff --git a/mods/HUD/mcl_inventory/locale/mcl_inventory.fr.tr b/mods/HUD/mcl_inventory/locale/mcl_inventory.fr.tr index e15a422a5..edb15a77b 100644 --- a/mods/HUD/mcl_inventory/locale/mcl_inventory.fr.tr +++ b/mods/HUD/mcl_inventory/locale/mcl_inventory.fr.tr @@ -7,6 +7,7 @@ Building Blocks=Blocs de Construction Decoration Blocks=Blocs de Décoration Redstone=Redstone Transportation=Transport +Brewing= Miscellaneous=Divers Search Items=Rechercher des objets Foodstuffs=Denrées alimentaires diff --git a/mods/HUD/mcl_inventory/locale/mcl_inventory.ru.tr b/mods/HUD/mcl_inventory/locale/mcl_inventory.ru.tr index 124fa3c8a..ab1c9a420 100644 --- a/mods/HUD/mcl_inventory/locale/mcl_inventory.ru.tr +++ b/mods/HUD/mcl_inventory/locale/mcl_inventory.ru.tr @@ -7,6 +7,7 @@ Building Blocks=Строительные блоки Decoration Blocks=Декоративные блоки Redstone=Редстоун (красный камень) Transportation=Транспорт +Brewing= Miscellaneous=Прочее Search Items=Искать предметы Foodstuffs=Продовольствие diff --git a/mods/HUD/mcl_inventory/locale/template.txt b/mods/HUD/mcl_inventory/locale/template.txt index 649f39581..7f1c9769d 100644 --- a/mods/HUD/mcl_inventory/locale/template.txt +++ b/mods/HUD/mcl_inventory/locale/template.txt @@ -7,6 +7,7 @@ Building Blocks= Decoration Blocks= Redstone= Transportation= +Brewing= Miscellaneous= Search Items= Foodstuffs= diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 18df5b398..eb23d66fb 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -278,8 +278,8 @@ minetest.register_craftitem("mcl_potions:river_water", { }) -- TODO: Extinguish fire, damage mobs -mcl_potions.register_splash("water", S("Splash Water Bottle"), "#0022FF", {tt="No effect", potion_fun=function() end}) -mcl_potions.register_lingering("water", S("Lingering Water Bottle"), "#0022FF", {tt="No effect", potion_fun=function() end}) +mcl_potions.register_splash("water", S("Splash Water Bottle"), "#0022FF", {tt=S("No effect"), potion_fun=function() end}) +mcl_potions.register_lingering("water", S("Lingering Water Bottle"), "#0022FF", {tt=S("No effect"), potion_fun=function() end}) minetest.register_craftitem("mcl_potions:speckled_melon", { description = S("Glistering Melon"), diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index e1628a0a9..b7608bd8c 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -67,10 +67,10 @@ local function register_potion(def) if effect and def.is_dur then _tt = perc_string(effect).." | "..time_string(dur) if def.name == "poison" or def.name == "regeneration" then - _tt = "1/2 heart/"..effect.."s | "..time_string(dur) + _tt = S("1 HP/@1s | @2", effect, time_string(dur)) end elseif def.name == "healing" or def.name == "harming" then - _tt = ((effect / 2) - ((effect / 2)% 0.5)).." hearts" + _tt = S("@1 HP", effect) else _tt = tt or time_string(dur) or S("No effect") end @@ -109,7 +109,11 @@ local function register_potion(def) local desc if not def.no_potion then - desc = S("@1 Potion", def.description) + if def.description_potion then + desc = def.description_potion + else + desc = S("@1 Potion", def.description) + end else desc = def.description end @@ -173,8 +177,19 @@ local function register_potion(def) } if def.color and not def.no_throwable then - mcl_potions.register_splash(def.name, S("Splash @1 Potion", def.description), def.color, splash_def) - mcl_potions.register_lingering(def.name, S("Lingering @1 Potion", def.description), def.color, ling_def) + local desc + if def.description_splash then + desc = def.description_splash + else + desc = S("Splash @1 Potion", def.description) + end + mcl_potions.register_splash(def.name, desc, def.color, splash_def) + if def.description_lingering then + desc = def.description_lingering + else + desc = S("Lingering @1 Potion", def.description) + end + mcl_potions.register_lingering(def.name, desc, def.color, ling_def) if not def.no_arrow then mcl_potions.register_arrow(def.name, S("Arrow of @1", def.description), def.color, arrow_def) end @@ -357,7 +372,9 @@ end local awkward_def = { name = "awkward", - description = S("Awkward"), + description_potion = S("Awkward Potion"), + description_splash = S("Awkward Splash Potion"), + description_lingering = S("Awkward Lingering Potion"), no_arrow = true, no_effect = true, _tt = S("No effect"), @@ -369,7 +386,9 @@ local awkward_def = { local mundane_def = { name = "mundane", - description = S("Mundane"), + description_potion = S("Mundane Potion"), + description_splash = S("Mundane Splash Potion"), + description_lingering = S("Mundane Lingering Potion"), no_arrow = true, no_effect = true, _tt = S("No effect"), @@ -380,7 +399,9 @@ local mundane_def = { local thick_def = { name = "thick", - description = S("Thick"), + description_potion = S("Thick Potion"), + description_splash = S("Thick Splash Potion"), + description_lingering = S("Thick Lingering Potion"), no_arrow = true, no_effect = true, _tt = S("No effect"), @@ -406,8 +427,8 @@ local dragon_breath_def = { local healing_def = { name = "healing", description = S("Healing"), - _tt = S("+2 hearts"), - _tt_2 = S("+4 hearts"), + _tt = S("+4 HP"), + _tt_2 = S("+8 HP"), _longdesc = S("Instantly heals."), color = "#CC0000", effect = 4, @@ -419,8 +440,8 @@ local healing_def = { local harming_def = { name = "harming", description = S("Harming"), - _tt = S("-3 hearts"), - _tt_II = S("-6 hearts"), + _tt = S("-6 HP"), + _tt_II = S("-12 HP"), _longdesc = S("Instantly deals damage."), color = "#660099", effect = -6, diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index 9870c96a6..483b621aa 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -41,7 +41,9 @@ function mcl_potions.register_arrow(name, desc, color, def) minetest.register_craftitem("mcl_potions:"..name.."_arrow", { description = desc, _tt_help = arrow_tt .. "\n" .. def.tt, - _doc_items_longdesc = arrow_longdesc .. "\n" .. longdesc, + _doc_items_longdesc = arrow_longdesc .. "\n" .. + S("This particular arrow is tipped and will give an effect when it hits a player or mob.") .. "\n" .. + longdesc, _doc_items_usagehelp = how_to_shoot, inventory_image = "mcl_bows_arrow_inv.png^(mcl_potions_arrow_inv.png^[colorize:"..color..":100)", groups = { ammo=1, ammo_bow=1, brewitem=1}, From cbf545ee1241daf9927e6b031d0c665455c17af7 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 15:18:36 +0200 Subject: [PATCH 036/152] Update mcl_potions translation template and German --- .../mcl_potions/locale/mcl_potions.de.tr | 68 ++++++++++--------- .../mcl_potions/locale/mcl_potions.es.tr | 32 ++++----- .../mcl_potions/locale/mcl_potions.fr.tr | 30 ++++---- .../mcl_potions/locale/mcl_potions.ru.tr | 32 ++++----- mods/ITEMS/mcl_potions/locale/template.txt | 23 +++++-- 5 files changed, 99 insertions(+), 86 deletions(-) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index 29035c96a..3b6b61e75 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -33,55 +33,63 @@ Lingering Strength Potion +=Stärkeverweiltrank + Use the “Punch” key to throw it.=Benutzen Sie die „Platzieren“-Taste zum Werfen. Use the “Place” key to drink it.=Benutzen Sie die „Platzieren“-Taste zum Trinken. Drinking a potion gives you a particular effect.=Das Trinken eines Tranks gibt Ihnen einen bestimmten Effekt -@1 Potion=@1-Trank -Splash @1 Potion=@1-Wurftrank -Lingering @1 Potion=@1-Verweiltrank -Arrow of @1=@1-Pfeil +1 HP/@1s | @2=1 TP/@1s | @2 +@1 HP=@1 TP +@1 Potion=Trank der @1 +Splash @1 Potion=Wurftrank der @1 +Lingering @1 Potion=Verweiltrank der @1 +Arrow of @1=Pfeil der @1 II= II IV= IV -@1 Potion@2=@1-Trank@2 -Splash @1@2 Potion=@1@2-Wurftrank -Lingering @1@2 Potion=@1@1-Verweiltrank -Arrow of @1@2=@1@2-Pfeil -@1 + Potion=@1 +-Trank -Splash @1 + Potion=@1 +-Wurftrank -Lingering @1 + Potion=@1 +-Verweiltrank -Arrow of @1 +=@1 +-Pfeil -Awkward=Seltsam +@1 Potion@2=Trank der @1@2 +Splash @1@2 Potion=Wurftrank der @1@2 +Lingering @1@2 Potion=Verweiltrank der @1@2 +Arrow of @1@2=Pfeil der @1@2 +@1 + Potion=Trank der @1 + +Splash @1 + Potion=Wurftrank der @1 + +Lingering @1 + Potion=Verweiltrank der @1 + +Arrow of @1 +=Pfeil der @1 +Awkward Potion=Seltsamer Trank +Awkward Splash Potion=Seltsamer Wurftrank +Awkward Lingering Potion=Seltsamer Verweiltrank Has an awkward taste and is used for brewing potions.=Hat einen seltsamen Geschmack und wird in der Trankherstellung benutzt. -Mundane=Klarer +Mundane Potion=Klarer Trank +Mundane Splash Potion=Klarer Wurftrank +Mundane Lingering Potion=Klarer Verweiltrank Has a terrible taste and is not useful for brewing potions.=Hat einen furchtbaren Geschmack und ist nicht für die Trankherstellung brauchbar. -Thick=Bitter +Thick Potion=Bitterer Trank +Thick Splash Potion=Bitterer Wurftrank +Thick Lingering Potion=Bitterer Verweiltrank Has a bitter taste and is not useful for brewing potions.=Hat einen bitteren Geschmack und ist nicht für die Trankherstellung brauchbar. Dragon's Breath=Drachenatem This item is used in brewing and can be combined with splash potions to create lingering potions.=Dieser Objekt wird für die Trankherstellung benutzt und kann mit Wurftränken kombiniert werden, um Verweiltränke herzustellen. -Healing=Heilen -+2 hearts=+2 Herzen -+4 hearts=+4 Herzen +Healing=Heilung ++4 HP=+4 TP ++8 HP=+8 TP Instantly heals.=Heilt sofort. -Harming=Schaden --3 hearts=-3 Herzen --6 hearts=-6 Herzen +Harming=Verletzung +-6 HP=-6 TP +-12 HP=-12 TP Instantly deals damage.=Richtet sofort Schaden an. -Night Vision=Nachtricht +Night Vision=Nachtsicht Grants the ability to see in darkness.=Gibt die Fähigkeit, in der Dunkelheit zu sehen. Swiftness=Schnelligkeit Increases walking speed.=Erhöht Gehgeschwindigkeit. Slowness=Langsamkeit Decreases walking speed.=Verringert Gehgeschwindigkeit. -Leaping=Sprung +Leaping=Sprungkraft Increases jump strength.=Erhöht Sprunghöhe. -Poison=Gift +Poison=Vergiftung Applies the poison effect which deals damage at a regular interval.=Gibt den Gifteffekt, der Schaden in regelmäßigen Abständen anrichtet. Regeneration=Regenerierung Regenerates health over time.=Regenieriert Gesundheit mit der Zeit. Invisibility=Unsichtbarkeit Grants invisibility.=Gibt Unsichtbarkeit. -Water Breathing=Wasseratem +Water Breathing=Wasseratmung Grants limitless breath underwater.=Gibt unbegrenzen Atem im Wasser. -Fire Resistance=Feuerwiderstand +Fire Resistance=Feuerresistenz Grants immunity to damage from heat sources like fire.=Gibt Immunität gegenüber Schaden von Hitzequellen wie Feuer. Weakness=Schwäche -4 HP damage | 1:30=-4 HP Schaden | 1:30 @@ -103,11 +111,5 @@ Weakness Splash Potion +=Schwächewurftrank + Strength Splash Potion=Stärkewurftrank Strength Splash Potion II=Stärkewurftrank II Strength Splash Potion +=Stärkewurftrank + -This particular arrow is tipped and will give an effect when it hits a player or mob.=Dies Pfeilspitze dieses Pfeils in einem Trank getränkt und gibt einen Effekt, wenn er einen Spieler oder einen Mob trifft. - -#### not used anymore #### - -Awkward Potion=Seltsamer Trank -Mundane Potion=Klarer Trank -Thick Potion=Bitterer Trank +This particular arrow is tipped and will give an effect when it hits a player or mob.=Diese Pfeilspitze dieses Pfeils in einem Trank getränkt und gibt einen Effekt, wenn er einen Spieler oder einen Mob trifft. diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr index 37cd3ce1e..67a3faac7 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr @@ -33,6 +33,8 @@ Lingering Strength Potion += Use the “Punch” key to throw it.= Use the “Place” key to drink it.=Use la tecla "Colocar" para beberlo. Drinking a potion gives you a particular effect.= +1 HP/@1s | @2= +@1 HP= @1 Potion= Splash @1 Potion= Lingering @1 Potion= @@ -47,23 +49,29 @@ Arrow of @1@2= Splash @1 + Potion= Lingering @1 + Potion= Arrow of @1 += -Awkward= +Awkward Potion=Poción incomoda +Awkward Splash Potion= +Awkward Lingering Potion= Has an awkward taste and is used for brewing potions.= -Mundane= +Mundane Potion=Poción Mundana +Mundane Splash Potion= +Mundane Lingering Potion= Has a terrible taste and is not useful for brewing potions.= -Thick= +Thick Potion=Poción densa +Thick Splash Potion= +Thick Lingering Potion= Has a bitter taste and is not useful for brewing potions.= Dragon's Breath=Aliento de dragón This item is used in brewing and can be combined with splash potions to create lingering potions.= Healing= -+2 hearts= -+4 hearts= ++4 HP= ++8 HP= Instantly heals.= Harming= --3 hearts= --6 hearts= +-6 HP= +-12 HP= Instantly deals damage.= Night Vision= Grants the ability to see in darkness.= @@ -103,13 +111,5 @@ Weakness Splash Potion += Strength Splash Potion= Strength Splash Potion II= Strength Splash Potion += + This particular arrow is tipped and will give an effect when it hits a player or mob.= - - - -##### not used anymore ##### - -# textdomain: mcl_potions -Awkward Potion=Poción incomoda -Mundane Potion=Poción Mundana -Thick Potion=Poción densa diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr index 7726fe910..5ccaea9dd 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr @@ -33,6 +33,8 @@ Lingering Strength Potion += Use the “Punch” key to throw it.= Use the “Place” key to drink it.=Utilisez la touche "Utiliser" pour le boire. Drinking a potion gives you a particular effect.= +1 HP/@1s | @2= +@1 HP= @1 Potion= Splash @1 Potion= Lingering @1 Potion= @@ -47,23 +49,29 @@ Arrow of @1@2= Splash @1 + Potion= Lingering @1 + Potion= Arrow of @1 += -Awkward= +Awkward Potion=Potion maladroite +Awkward Splash Potion= +Awkward Lingering Potion= Has an awkward taste and is used for brewing potions.= -Mundane= +Mundane Potion=Potion mondaine +Mundane Splash Potion= +Mundane Lingering Potion= Has a terrible taste and is not useful for brewing potions.= -Thick= +Thick Potion=Potion épaisse +Thick Splash Potion= +Thick Lingering Potion= Has a bitter taste and is not useful for brewing potions.= Dragon's Breath=Le souffle du dragon This item is used in brewing and can be combined with splash potions to create lingering potions.= Healing= -+2 hearts= -+4 hearts= ++4 HP= ++8 HP= Instantly heals.= Harming= --3 hearts= --6 hearts= +-6 HP= +-12 HP= Instantly deals damage.= Night Vision= Grants the ability to see in darkness.= @@ -103,11 +111,5 @@ Weakness Splash Potion += Strength Splash Potion= Strength Splash Potion II= Strength Splash Potion += + This particular arrow is tipped and will give an effect when it hits a player or mob.= - - - -##### not used anymore ##### -Awkward Potion=Potion maladroite -Mundane Potion=Potion mondaine -Thick Potion=Potion épaisse diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr index a1ad41f09..f7bf1aae1 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr @@ -33,6 +33,8 @@ Lingering Strength Potion += Use the “Punch” key to throw it.= Use the “Place” key to drink it.=Используйте клавишу “Разместить”, чтобы выпить это. Drinking a potion gives you a particular effect.= +1 HP/@1s | @2= +@1 HP= @1 Potion= Splash @1 Potion= Lingering @1 Potion= @@ -47,23 +49,29 @@ Arrow of @1@2= Splash @1 + Potion= Lingering @1 + Potion= Arrow of @1 += -Awkward= +Awkward Potion=Невкусное зелье +Awkward Splash Potion= +Awkward Lingering Potion= Has an awkward taste and is used for brewing potions.= -Mundane= +Mundane Potion=Успокоительное зелье +Mundane Splash Potion= +Mundane Lingering Potion= Has a terrible taste and is not useful for brewing potions.= -Thick= +Thick Potion=Густое зелье +Thick Splash Potion= +Thick Lingering Potion= Has a bitter taste and is not useful for brewing potions.= Dragon's Breath=Дыхание дракона This item is used in brewing and can be combined with splash potions to create lingering potions.= Healing= -+2 hearts= -+4 hearts= ++4 HP= ++8 HP= Instantly heals.= Harming= --3 hearts= --6 hearts= +-6 HP= +-12 HP= Instantly deals damage.= Night Vision= Grants the ability to see in darkness.= @@ -103,13 +111,5 @@ Weakness Splash Potion += Strength Splash Potion= Strength Splash Potion II= Strength Splash Potion += + This particular arrow is tipped and will give an effect when it hits a player or mob.= - - - -##### not used anymore ##### - -# textdomain: mcl_potions -Awkward Potion=Невкусное зелье -Mundane Potion=Успокоительное зелье -Thick Potion=Густое зелье diff --git a/mods/ITEMS/mcl_potions/locale/template.txt b/mods/ITEMS/mcl_potions/locale/template.txt index f76cb601f..27df8155e 100644 --- a/mods/ITEMS/mcl_potions/locale/template.txt +++ b/mods/ITEMS/mcl_potions/locale/template.txt @@ -33,6 +33,8 @@ Lingering Strength Potion += Use the “Punch” key to throw it.= Use the “Place” key to drink it.= Drinking a potion gives you a particular effect.= +1 HP/@1s | @2= +@1 HP= @1 Potion= Splash @1 Potion= Lingering @1 Potion= @@ -47,23 +49,29 @@ Arrow of @1@2= Splash @1 + Potion= Lingering @1 + Potion= Arrow of @1 += -Awkward= +Awkward Potion= +Awkward Splash Potion= +Awkward Lingering Potion= Has an awkward taste and is used for brewing potions.= -Mundane= +Mundane Potion= +Mundane Splash Potion= +Mundane Lingering Potion= Has a terrible taste and is not useful for brewing potions.= -Thick= +Thick Potion= +Thick Splash Potion= +Thick Lingering Potion= Has a bitter taste and is not useful for brewing potions.= Dragon's Breath= This item is used in brewing and can be combined with splash potions to create lingering potions.= Healing= -+2 hearts= -+4 hearts= ++4 HP= ++8 HP= Instantly heals.= Harming= --3 hearts= --6 hearts= +-6 HP= +-12 HP= Instantly deals damage.= Night Vision= Grants the ability to see in darkness.= @@ -103,4 +111,5 @@ Weakness Splash Potion += Strength Splash Potion= Strength Splash Potion II= Strength Splash Potion += + This particular arrow is tipped and will give an effect when it hits a player or mob.= From b49bcda0ac7c24dcdbbb081a4d2c34482499dccc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 15:20:08 +0200 Subject: [PATCH 037/152] Fix get_translator in mcl_brewing --- mods/ITEMS/mcl_brewing/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index c4a6d6408..8e643fdf1 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("mcl_brewing_stand") +local S = minetest.get_translator("mcl_brewing") local function active_brewing_formspec(fuel_percent, brew_percent) From 41cf1a43620ca2a249c08869dda2b5dfc2a6b5ee Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 15:24:15 +0200 Subject: [PATCH 038/152] Fix some translation typos in German --- mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index 3b6b61e75..1f287b8f3 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -5,7 +5,7 @@ Liquid container=Flüssigkeitsbehälter A glass bottle is used as a container for liquids and can be used to collect water directly.=Eine Glasflasche wird als Behälter von Flüssigkeiten benutzt und kann Wasser direkt aufsammeln. -To collect water, use it on a cauldron with water (which removes a level of water) or any water source (which removes no water).=Um Wasser aufzusammen, benutzen Sie sie an einem Kessel mit Wasser (was etwas Wasser entfernt) oder einer Wasserquelle (was kein Wasser entfernt). +To collect water, use it on a cauldron with water (which removes a level of water) or any water source (which removes no water).=Um Wasser aufzusammeln, benutzen Sie sie an einem Kessel mit Wasser (was etwas Wasser entfernt) oder einer Wasserquelle (was kein Wasser entfernt). Water Bottle=Wasserflasche Water bottles can be used to fill cauldrons. Drinking water has no effect.=Wasserflaschen können benutzt werden, um Kessel aufzufüllen. Trinken hat keine Wirkung. @@ -80,15 +80,15 @@ Increases walking speed.=Erhöht Gehgeschwindigkeit. Slowness=Langsamkeit Decreases walking speed.=Verringert Gehgeschwindigkeit. Leaping=Sprungkraft -Increases jump strength.=Erhöht Sprunghöhe. +Increases jump strength.=Erhöht Sprungstärke. Poison=Vergiftung Applies the poison effect which deals damage at a regular interval.=Gibt den Gifteffekt, der Schaden in regelmäßigen Abständen anrichtet. Regeneration=Regenerierung -Regenerates health over time.=Regenieriert Gesundheit mit der Zeit. +Regenerates health over time.=Regeneriert Gesundheit mit der Zeit. Invisibility=Unsichtbarkeit Grants invisibility.=Gibt Unsichtbarkeit. Water Breathing=Wasseratmung -Grants limitless breath underwater.=Gibt unbegrenzen Atem im Wasser. +Grants limitless breath underwater.=Gibt unbegrenzten Atem im Wasser. Fire Resistance=Feuerresistenz Grants immunity to damage from heat sources like fire.=Gibt Immunität gegenüber Schaden von Hitzequellen wie Feuer. Weakness=Schwäche From f1616e522a739ae5ae4eebc87247f44a4f1e295e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 15:26:35 +0200 Subject: [PATCH 039/152] Fix another German typo --- mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index 1f287b8f3..010c9ecf5 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -32,7 +32,7 @@ Lingering Strength Potion II=Stärkeverweiltrank II Lingering Strength Potion +=Stärkeverweiltrank + Use the “Punch” key to throw it.=Benutzen Sie die „Platzieren“-Taste zum Werfen. Use the “Place” key to drink it.=Benutzen Sie die „Platzieren“-Taste zum Trinken. -Drinking a potion gives you a particular effect.=Das Trinken eines Tranks gibt Ihnen einen bestimmten Effekt +Drinking a potion gives you a particular effect.=Das Trinken eines Tranks gibt Ihnen einen bestimmten Effekt. 1 HP/@1s | @2=1 TP/@1s | @2 @1 HP=@1 TP @1 Potion=Trank der @1 From b1b50df9ab72a9b3b051d93d24ee3fe315712f3a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 15:48:28 +0200 Subject: [PATCH 040/152] Add more help to brewing stand --- mods/ITEMS/mcl_brewing/init.lua | 7 +++++-- mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr | 5 ++++- mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr | 5 ++++- mods/ITEMS/mcl_brewing/locale/template.txt | 5 ++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index 8e643fdf1..848c2e9b8 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -310,8 +310,11 @@ if minetest.get_modpath("screwdriver") then end local doc_string = - S("To use a brewing stand, rightclick it.").."\n" - S("To brew, place fuel first and/or your ingredient last!") + S("To use a brewing stand, rightclick it.").."\n".. + S("To brew, you need blaze powder as fuel, a brewing material and at least 1 glass bottle filled with a liquid.").."\n".. + S("Place the blaze powder in the left slot, the brewing material in the middle slot and 1-3 bottles in the remaining slots.").."\n".. + S("When you have found a good comination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.").."\n".. + S("Different combinations of brewing materials and liquids will give different results. Try to experiment!") local tiles = {"mcl_brewing_top.png", --top "mcl_brewing_base.png", --bottom diff --git a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr index 34a9c28b4..69aa23c18 100644 --- a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr +++ b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr @@ -2,6 +2,9 @@ Brewing Stand=Braustand Inventory=Inventar To use a brewing stand, rightclick it.=Um einen Braustand zu benutzen, rechtsklicken Sie ihn. -To brew, place fuel first and/or your ingredient last!=Um zu brauen, zuerst Brennstoff platzieren, dann ggf. die Zutat zuletzt platzieren! +To brew, you need blaze powder as fuel, a brewing material and at least 1 glass bottle filled with a liquid.=Zum Brauen benötigt man Lohenstaub als Brennstoff, ein Braumaterial und mindestens 1 Glasflasche, die mit einer Flüssigkeit gefüllt ist. +Place the blaze powder in the left slot, the brewing material in the middle slot and 1-3 bottles in the remaining slots.=Platzieren Sie den Lohenstaub in den linken Plartz, das Braumaterial in den mittleren Platz und 1-3 Glasflaschen in die übrigen Plätze. +When you have found a good comination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.=Wenn Sie eine gute Kombination gefunden haben, beginnt der Brauvorgang automatisch, und es entsteht Dampf. Der Brennstoff und das Brühmaterial wird aufbraucht. Die Tränke werden bald fertig sein. +Different combinations of brewing materials and liquids will give different results. Try to experiment!=Unterschiedliche Kombinationen von Braumaterialien und Flüssigkeiten werden zu unterschiedlichen Ergebnissen führen. Experimentieren Sie! The stand allows you to brew potions!=Der Stand ermöglicht das Brauen von Tränken. Brew Potions=Tränke brauen diff --git a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr index aa5c61ea4..d8d32a3a2 100644 --- a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr +++ b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr @@ -2,6 +2,9 @@ Brewing Stand=Варочный стенд Inventory= To use a brewing stand, rightclick it.= -To brew, place fuel first and/or your ingredient last!= +To brew, you need blaze powder as fuel, a brewing material and at least 1 glass bottle filled with a liquid.= +Place the blaze powder in the left slot, the brewing material in the middle slot and 1-3 bottles in the remaining slots.= +When you have found a good comination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.= +Different combinations of brewing materials and liquids will give different results. Try to experiment!= The stand allows you to brew potions!= Brew Potions= diff --git a/mods/ITEMS/mcl_brewing/locale/template.txt b/mods/ITEMS/mcl_brewing/locale/template.txt index 3a8ed23e1..172788156 100644 --- a/mods/ITEMS/mcl_brewing/locale/template.txt +++ b/mods/ITEMS/mcl_brewing/locale/template.txt @@ -2,6 +2,9 @@ Brewing Stand= Inventory= To use a brewing stand, rightclick it.= -To brew, place fuel first and/or your ingredient last!= +To brew, you need blaze powder as fuel, a brewing material and at least 1 glass bottle filled with a liquid.= +Place the blaze powder in the left slot, the brewing material in the middle slot and 1-3 bottles in the remaining slots.= +When you have found a good comination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.= +Different combinations of brewing materials and liquids will give different results. Try to experiment!= The stand allows you to brew potions!= Brew Potions= From e2735e008129eb340f06e9e55aec25df90fdaf0e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 17:29:52 +0200 Subject: [PATCH 041/152] Fix wrong var name in mcl_mobs --- mods/ENTITIES/mcl_mobs/api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 622b87461..ad112ef58 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -2639,7 +2639,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) if self.do_punch then -- when false skip going any further - if self.do_punch(self, hitter, tflp, tool_caps, dir) == false then + if self.do_punch(self, hitter, tflp, tool_capabilities, dir) == false then return end end From 13963d00e59dfbd246a389cef8c7246389028561 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 18:04:37 +0200 Subject: [PATCH 042/152] Fix missing definition of age_next in mcl_fire --- mods/ITEMS/mcl_fire/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index 9ae8ce995..3212d7432 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -212,6 +212,9 @@ minetest.register_node("mcl_fire:eternal_fire", { while #airs > 0 do local r = math.random(1, #airs) if minetest.find_node_near(airs[r], 1, {"group:flammable"}) then + local node = minetest.get_node(airs[r]) + local age = node.param2 + local age_next = math.min(15, age + math.random(0, 1)) spawn_fire(airs[r], age_next) break else From 1f8488aba5c68e27dec7aeae46597ae8a1fee2b6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 18:33:53 +0200 Subject: [PATCH 043/152] Make throwable water bottles useful --- mods/ENTITIES/mobs_mc/blaze.lua | 2 +- mods/ENTITIES/mobs_mc/enderman.lua | 1 + mods/ENTITIES/mobs_mc/snowman.lua | 1 + mods/ITEMS/mcl_potions/functions.lua | 26 +++++++++++++++++++++ mods/ITEMS/mcl_potions/init.lua | 35 +++++++++++++++++++++++++--- mods/ITEMS/mcl_potions/lingering.lua | 19 +++++++++++---- mods/ITEMS/mcl_potions/splash.lua | 6 ++++- 7 files changed, 81 insertions(+), 9 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/blaze.lua b/mods/ENTITIES/mobs_mc/blaze.lua index 8231148ec..cbba537dd 100644 --- a/mods/ENTITIES/mobs_mc/blaze.lua +++ b/mods/ENTITIES/mobs_mc/blaze.lua @@ -22,7 +22,7 @@ mobs:register_mob("mobs_mc:blaze", { textures = { {"mobs_mc_blaze.png"}, }, - armor = { fleshy = 100, snowball_vulnerable = 100 }, + armor = { fleshy = 100, snowball_vulnerable = 100, water_vulnerable = 100 }, visual_size = {x=3, y=3}, sounds = { random = "mobs_mc_blaze_breath", diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index aab690e04..3ecff4e38 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -520,6 +520,7 @@ mobs:register_mob("mobs_mc:enderman", { end end end, + armor = { fleshy = 100, water_vulnerable = 100 }, water_damage = 8, view_range = 64, fear_height = 4, diff --git a/mods/ENTITIES/mobs_mc/snowman.lua b/mods/ENTITIES/mobs_mc/snowman.lua index b9686ba57..02c1178e8 100644 --- a/mods/ENTITIES/mobs_mc/snowman.lua +++ b/mods/ENTITIES/mobs_mc/snowman.lua @@ -31,6 +31,7 @@ mobs:register_mob("mobs_mc:snowman", { fall_damage = 0, water_damage = 4, rain_damage = 4, + armor = { fleshy = 100, water_vulnerable = 100 }, attacks_monsters = true, collisionbox = {-0.35, -0.01, -0.35, 0.35, 1.89, 0.35}, visual = "mesh", diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 0df06d15a..11e579a5f 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -747,3 +747,29 @@ function mcl_potions.night_vision_func(player, null, duration) end end + +function mcl_potions._extinguish_nearby_fire(pos) + local epos = {x=pos.x, y=pos.y+0.5, z=pos.z} + local dnode = minetest.get_node({x=pos.x,y=pos.y-0.5,z=pos.z}) + if minetest.get_item_group(dnode.name, "fire") ~= 0 then + epos.y = pos.y - 0.5 + end + local dirs = { + {x=0,y=0,z=0}, + {x=0,y=0,z=-1}, + {x=0,y=0,z=1}, + {x=-1,y=0,z=0}, + {x=1,y=0,z=0}, + } + local exting = false + for d=1, #dirs do + local tpos = vector.add(epos, dirs[d]) + local node = minetest.get_node(tpos) + if minetest.get_item_group(node.name, "fire") ~= 0 then + minetest.sound_play("fire_extinguish_flame", {pos = tpos, gain = 0.25, max_hear_distance = 16}, true) + minetest.remove_node(tpos) + exting = true + end + end + return exting +end diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index eb23d66fb..1fd99771b 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -277,9 +277,38 @@ minetest.register_craftitem("mcl_potions:river_water", { }) --- TODO: Extinguish fire, damage mobs -mcl_potions.register_splash("water", S("Splash Water Bottle"), "#0022FF", {tt=S("No effect"), potion_fun=function() end}) -mcl_potions.register_lingering("water", S("Lingering Water Bottle"), "#0022FF", {tt=S("No effect"), potion_fun=function() end}) +-- Hurt mobs +local water_splash = function(obj, damage) + if not obj then + return + end + if not damage or (damage > 0 and damage < 1) then + damage = 1 + end + -- Damage mobs that are vulnerable to water + local lua = obj:get_luaentity() + if lua and lua._cmi_is_mob then + obj:punch(obj, 1.0, { + full_punch_interval = 1.0, + damage_groups = {water_vulnerable=damage}, + }, nil) + end +end + +mcl_potions.register_splash("water", S("Splash Water Bottle"), "#0022FF", { + tt=S("Extinguishes fire and hurts some mobs"), + longdesc=S("A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water."), + no_effect=true, + potion_fun=water_splash, + effect=1 +}) +mcl_potions.register_lingering("water", S("Lingering Water Bottle"), "#0022FF", { + tt=S("Extinguishes fire and hurts some mobs"), + longdesc=S("A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water."), + no_effect=true, + potion_fun=water_splash, + effect=1 +}) minetest.register_craftitem("mcl_potions:speckled_melon", { description = S("Glistering Melon"), diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index 318d51a68..beb838bae 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -10,9 +10,9 @@ end local lingering_effect_at = {} -local function add_lingering_effect(pos, color, def) +local function add_lingering_effect(pos, color, def, is_water) - lingering_effect_at[pos] = {color = color, timer = 30, def = def} + lingering_effect_at[pos] = {color = color, timer = 30, def = def, is_water = is_water} end @@ -46,6 +46,14 @@ minetest.register_globalstep(function(dtime) texture = "mcl_potions_sprite.png^[colorize:"..vals.color..":127", }) + -- Extingish fire if water bottle + if vals.is_water then + if mcl_potions._extinguish_nearby_fire(pos) then + vals.timer = vals.timer / 2 + end + end + + -- Affect players and mobs for _, obj in pairs(minetest.get_objects_inside_radius(pos, d)) do local entity = obj:get_luaentity() @@ -114,13 +122,13 @@ function mcl_potions.register_lingering(name, descr, color, def) visual_size = {x=w/2,y=w/2}, collisionbox = {0,0,0,0,0,0}, on_step = function(self, dtime) - local pos = self.object:getpos() + local pos = self.object:get_pos() local node = minetest.get_node(pos) local n = node.name local d = 4 if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" or mcl_potions.is_obj_hit(self, pos) then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) - add_lingering_effect(pos, color, def) + add_lingering_effect(pos, color, def, name == "water") minetest.add_particlespawner({ amount = 40, time = 1, @@ -138,6 +146,9 @@ function mcl_potions.register_lingering(name, descr, color, def) vertical = false, texture = "mcl_potions_sprite.png^[colorize:"..color..":127", }) + if name == "water" then + mcl_potions._extinguish_nearby_fire(pos) + end self.object:remove() end end, diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 779c75ac3..008cfa972 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -56,7 +56,7 @@ function mcl_potions.register_splash(name, descr, color, def) visual_size = {x=w/2,y=w/2}, collisionbox = {0,0,0,0,0,0}, on_step = function(self, dtime) - local pos = self.object:getpos() + local pos = self.object:get_pos() local node = minetest.get_node(pos) local n = node.name local d = 2 @@ -80,6 +80,10 @@ function mcl_potions.register_splash(name, descr, color, def) vertical = false, texture = "mcl_potions_sprite.png^[colorize:"..color..":127", }) + + if name == "water" then + mcl_potions._extinguish_nearby_fire(pos) + end self.object:remove() for _,obj in pairs(minetest.get_objects_inside_radius(pos, 4)) do From 20455a259f21249cedfaf92aba9ca74505fbe160 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 19:06:32 +0200 Subject: [PATCH 044/152] Tweak splash potion particles --- mods/ITEMS/mcl_potions/splash.lua | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 008cfa972..e31bd27ed 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -59,27 +59,27 @@ function mcl_potions.register_splash(name, descr, color, def) local pos = self.object:get_pos() local node = minetest.get_node(pos) local n = node.name - local d = 2 + local d = 0.1 local redux_map = {7/8,0.5,0.25} if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" or mcl_potions.is_obj_hit(self, pos) then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) minetest.add_particlespawner({ - amount = 50, - time = 2, - minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, - maxpos = {x=pos.x+d, y=pos.y+d, z=pos.z+d}, - minvel = {x=-1, y=0, z=-1}, - maxvel = {x=1, y=0.5, z=1}, - minacc = {x=-0.5, y=0, z=-0.5}, - maxacc = {x=0.5, y=.2, z=0.5}, - minexptime = 1, - maxexptime = 3, - minsize = 2, - maxsize = 4, - collisiondetection = true, - vertical = false, - texture = "mcl_potions_sprite.png^[colorize:"..color..":127", - }) + amount = 50, + time = 0.1, + minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, + maxpos = {x=pos.x+d, y=pos.y+0.5+d, z=pos.z+d}, + minvel = {x=-2, y=0, z=-2}, + maxvel = {x=2, y=2, z=2}, + minacc = {x=0, y=0, z=0}, + maxacc = {x=0, y=0, z=0}, + minexptime = 0.5, + maxexptime = 1.25, + minsize = 1, + maxsize = 2, + collisiondetection = true, + vertical = false, + texture = "mcl_potions_sprite.png^[colorize:"..color..":127", + }) if name == "water" then mcl_potions._extinguish_nearby_fire(pos) From 9c304105e978dcd6c7023491fe325ed62a3a4668 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 19:26:51 +0200 Subject: [PATCH 045/152] Add special particles for throwable water bottles --- mods/ITEMS/mcl_potions/lingering.lua | 83 +++++++++++------- mods/ITEMS/mcl_potions/splash.lua | 15 +++- .../textures/mcl_potions_droplet.png | Bin 0 -> 85 bytes 3 files changed, 61 insertions(+), 37 deletions(-) create mode 100644 mods/ITEMS/mcl_potions/textures/mcl_potions_droplet.png diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index beb838bae..d5f4623b1 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -27,26 +27,31 @@ minetest.register_globalstep(function(dtime) vals.timer = vals.timer - lingering_timer local d = 4 * (vals.timer / 30.0) - + local texture + if vals.is_water then + texture = "mcl_potions_droplet.png" + else + texture = "mcl_potions_sprite.png" + end minetest.add_particlespawner({ - amount = 10 * d^2, - time = 1, - minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, - maxpos = {x=pos.x+d, y=pos.y+1, z=pos.z+d}, - minvel = {x=-0.5, y=0, z=-0.5}, - maxvel = {x=0.5, y=0.5, z=0.5}, - minacc = {x=-0.2, y=0, z=-0.2}, - maxacc = {x=0.2, y=.05, z=0.2}, - minexptime = 1, - maxexptime = 2, - minsize = 2, - maxsize = 4, - collisiondetection = true, - vertical = false, - texture = "mcl_potions_sprite.png^[colorize:"..vals.color..":127", - }) + amount = 10 * d^2, + time = 1, + minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, + maxpos = {x=pos.x+d, y=pos.y+1, z=pos.z+d}, + minvel = {x=-0.5, y=0, z=-0.5}, + maxvel = {x=0.5, y=0.5, z=0.5}, + minacc = {x=-0.2, y=0, z=-0.2}, + maxacc = {x=0.2, y=.05, z=0.2}, + minexptime = 1, + maxexptime = 2, + minsize = 2, + maxsize = 4, + collisiondetection = true, + vertical = false, + texture = texture.."^[colorize:"..vals.color..":127", + }) - -- Extingish fire if water bottle + -- Extinguish fire if water bottle if vals.is_water then if mcl_potions._extinguish_nearby_fire(pos) then vals.timer = vals.timer / 2 @@ -129,23 +134,33 @@ function mcl_potions.register_lingering(name, descr, color, def) if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" or mcl_potions.is_obj_hit(self, pos) then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) add_lingering_effect(pos, color, def, name == "water") + local texture, minacc, maxacc + if name == "water" then + texture = "mcl_potions_droplet.png" + minacc = {x=-0.2, y=-0.05, z=-0.2} + maxacc = {x=0.2, y=0.05, z=0.2} + else + texture = "mcl_potions_sprite.png" + minacc = {x=-0.2, y=0, z=-0.2} + maxacc = {x=0.2, y=.05, z=0.2} + end minetest.add_particlespawner({ - amount = 40, - time = 1, - minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, - maxpos = {x=pos.x+d, y=pos.y+1, z=pos.z+d}, - minvel = {x=-0.5, y=0, z=-0.5}, - maxvel = {x=0.5, y=0.5, z=0.5}, - minacc = {x=-0.2, y=0, z=-0.2}, - maxacc = {x=0.2, y=.05, z=0.2}, - minexptime = 1, - maxexptime = 2, - minsize = 1, - maxsize = 2, - collisiondetection = true, - vertical = false, - texture = "mcl_potions_sprite.png^[colorize:"..color..":127", - }) + amount = 40, + time = 1, + minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, + maxpos = {x=pos.x+d, y=pos.y+1, z=pos.z+d}, + minvel = {x=-0.5, y=0, z=-0.5}, + maxvel = {x=0.5, y=0.5, z=0.5}, + minacc = minacc, + maxacc = maxacc, + minexptime = 1, + maxexptime = 2, + minsize = 1, + maxsize = 2, + collisiondetection = true, + vertical = false, + texture = texture.."^[colorize:"..color..":127", + }) if name == "water" then mcl_potions._extinguish_nearby_fire(pos) end diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index e31bd27ed..1dc87b198 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -1,4 +1,5 @@ local S = minetest.get_translator("mcl_potions") +local GRAVITY = tonumber(minetest.settings:get("movement_gravity")) local splash_image = function(colorstring, opacity) if not opacity then @@ -63,6 +64,14 @@ function mcl_potions.register_splash(name, descr, color, def) local redux_map = {7/8,0.5,0.25} if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" or mcl_potions.is_obj_hit(self, pos) then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) + local texture, acc + if name == "water" then + texture = "mcl_potions_droplet.png" + acc = {x=0, y=-GRAVITY, z=0} + else + texture = "mcl_potions_sprite.png" + acc = {x=0, y=0, z=0} + end minetest.add_particlespawner({ amount = 50, time = 0.1, @@ -70,15 +79,15 @@ function mcl_potions.register_splash(name, descr, color, def) maxpos = {x=pos.x+d, y=pos.y+0.5+d, z=pos.z+d}, minvel = {x=-2, y=0, z=-2}, maxvel = {x=2, y=2, z=2}, - minacc = {x=0, y=0, z=0}, - maxacc = {x=0, y=0, z=0}, + minacc = acc, + maxacc = acc, minexptime = 0.5, maxexptime = 1.25, minsize = 1, maxsize = 2, collisiondetection = true, vertical = false, - texture = "mcl_potions_sprite.png^[colorize:"..color..":127", + texture = texture.."^[colorize:"..color..":127" }) if name == "water" then diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_droplet.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_droplet.png new file mode 100644 index 0000000000000000000000000000000000000000..e85767d321eed3e6abdc309e04a13af21c7233db GIT binary patch literal 85 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4$#}XrhEy;nOSn8ZGt-z?!6!h_ iXqkuNva8MP3=HSXl{RueN<0Tt$KdJe=d#Wzp$P!<;}w7a literal 0 HcmV?d00001 From ff476c29b6069734d87b4d7f2a9584f741b86613 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 19:44:19 +0200 Subject: [PATCH 046/152] Better lingering for lingering water bottle --- mods/ITEMS/mcl_potions/functions.lua | 42 ++++++++++++++++++---------- mods/ITEMS/mcl_potions/init.lua | 2 +- mods/ITEMS/mcl_potions/lingering.lua | 4 +-- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 11e579a5f..d18801b2d 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -748,26 +748,40 @@ function mcl_potions.night_vision_func(player, null, duration) end -function mcl_potions._extinguish_nearby_fire(pos) +function mcl_potions._extinguish_nearby_fire(pos, radius) local epos = {x=pos.x, y=pos.y+0.5, z=pos.z} local dnode = minetest.get_node({x=pos.x,y=pos.y-0.5,z=pos.z}) if minetest.get_item_group(dnode.name, "fire") ~= 0 then epos.y = pos.y - 0.5 end - local dirs = { - {x=0,y=0,z=0}, - {x=0,y=0,z=-1}, - {x=0,y=0,z=1}, - {x=-1,y=0,z=0}, - {x=1,y=0,z=0}, - } local exting = false - for d=1, #dirs do - local tpos = vector.add(epos, dirs[d]) - local node = minetest.get_node(tpos) - if minetest.get_item_group(node.name, "fire") ~= 0 then - minetest.sound_play("fire_extinguish_flame", {pos = tpos, gain = 0.25, max_hear_distance = 16}, true) - minetest.remove_node(tpos) + -- No radius: Splash, extinguish epos and 4 nodes around + if not radius then + local dirs = { + {x=0,y=0,z=0}, + {x=0,y=0,z=-1}, + {x=0,y=0,z=1}, + {x=-1,y=0,z=0}, + {x=1,y=0,z=0}, + } + for d=1, #dirs do + local tpos = vector.add(epos, dirs[d]) + local node = minetest.get_node(tpos) + if minetest.get_item_group(node.name, "fire") ~= 0 then + minetest.sound_play("fire_extinguish_flame", {pos = tpos, gain = 0.25, max_hear_distance = 16}, true) + minetest.remove_node(tpos) + exting = true + end + end + -- Has radius: lingering, extinguish all nodes in area + else + local nodes = minetest.find_nodes_in_area( + {x=epos.x-radius,y=epos.y,z=epos.z-radius}, + {x=epos.x+radius,y=epos.y,z=epos.z+radius}, + {"group:fire"}) + for n=1, #nodes do + minetest.sound_play("fire_extinguish_flame", {pos = nodes[n], gain = 0.25, max_hear_distance = 16}, true) + minetest.remove_node(nodes[n]) exting = true end end diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 1fd99771b..6836b0d6e 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -304,7 +304,7 @@ mcl_potions.register_splash("water", S("Splash Water Bottle"), "#0022FF", { }) mcl_potions.register_lingering("water", S("Lingering Water Bottle"), "#0022FF", { tt=S("Extinguishes fire and hurts some mobs"), - longdesc=S("A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water."), + longdesc=S("A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water."), no_effect=true, potion_fun=water_splash, effect=1 diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index d5f4623b1..b9ed85f84 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -53,7 +53,7 @@ minetest.register_globalstep(function(dtime) -- Extinguish fire if water bottle if vals.is_water then - if mcl_potions._extinguish_nearby_fire(pos) then + if mcl_potions._extinguish_nearby_fire(pos, d) then vals.timer = vals.timer / 2 end end @@ -162,7 +162,7 @@ function mcl_potions.register_lingering(name, descr, color, def) texture = texture.."^[colorize:"..color..":127", }) if name == "water" then - mcl_potions._extinguish_nearby_fire(pos) + mcl_potions._extinguish_nearby_fire(pos, d) end self.object:remove() end From 50bd1b9d5eb03fed6adaed28ea786e2b37ef2d8d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 19:47:13 +0200 Subject: [PATCH 047/152] Update water bottle translate --- mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr | 9 +++++++++ mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr | 8 ++++++++ mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr | 8 ++++++++ mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr | 8 ++++++++ mods/ITEMS/mcl_potions/locale/template.txt | 8 ++++++++ 5 files changed, 41 insertions(+) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index 010c9ecf5..6008ec36b 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -18,7 +18,15 @@ River water bottles can be used to fill cauldrons. Drinking it has no effect.=Fl Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Benutzen Sie die „Platzieren“-Taste zum Trinken. Platzieren Sie diesen Gegenstand auf einen Kessel, um das Flusswasser in den Kessel zu schütten. Splash Water Bottle=Wurfwasserflasche +Extinguishes fire and hurts some mobs=Löscht Feuer und verletzt einige Mobs + +A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water.=Eine werfbare Wasserflasche, die beim Einschlag zerbrechen wird und nahes Feuer löschen und einige wasserempfindliche Mobs verletzen wird. + Lingering Water Bottle=Verweilwasserflasche + +A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water.=Eine werfbare Wasserflasche, die beim Einschlag zerbrechen und eine Wolke aus Wasserdunst erzeugen wird, welche Feuer löscht und wasserempfindliche Mobs verletzt. + + Glistering Melon=Glitzermelone This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Diese glänzende Melone ist voller winziger Goldnuggets und sähe ganz nett in einem Rahmen aus. Er ist nicht essbar und auch sonst zu nichts zu gebrauchen. @@ -113,3 +121,4 @@ Strength Splash Potion II=Stärkewurftrank II Strength Splash Potion +=Stärkewurftrank + This particular arrow is tipped and will give an effect when it hits a player or mob.=Diese Pfeilspitze dieses Pfeils in einem Trank getränkt und gibt einen Effekt, wenn er einen Spieler oder einen Mob trifft. + diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr index 67a3faac7..9b5bc6a84 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr @@ -18,7 +18,14 @@ River water bottles can be used to fill cauldrons. Drinking it has no effect.=La Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Use la tecla "Acción" para beber. Coloque este artículo en un caldero para verter el agua de río en el caldero. Splash Water Bottle= +Extinguishes fire and hurts some mobs= + +A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water.= + Lingering Water Bottle= + +A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water.= + Glistering Melon=Rodaja de sandía reluciente This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Esta sandía brillante está llena de pequeñas pepitas de oro y sería bueno en un marco de artículo. No es comestible y no es útil para nada más. @@ -113,3 +120,4 @@ Strength Splash Potion II= Strength Splash Potion += This particular arrow is tipped and will give an effect when it hits a player or mob.= + diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr index 5ccaea9dd..ce149320d 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr @@ -18,7 +18,14 @@ River water bottles can be used to fill cauldrons. Drinking it has no effect.=Le Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Utilisez la touche "Utiliser" pour boire. Placez cet objet sur un chaudron pour verser l'eau de la rivière dans le chaudron. Splash Water Bottle= +Extinguishes fire and hurts some mobs= + +A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water.= + Lingering Water Bottle= + +A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water.= + Glistering Melon=Melon étincelant This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Ce melon brillant est plein de minuscules pépites d'or et serait bien dans un cadre d'objet. Il n'est pas comestible et n'est utile à rien d'autre. @@ -113,3 +120,4 @@ Strength Splash Potion II= Strength Splash Potion += This particular arrow is tipped and will give an effect when it hits a player or mob.= + diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr index f7bf1aae1..92ea08b82 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr @@ -18,7 +18,14 @@ River water bottles can be used to fill cauldrons. Drinking it has no effect.=Б Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Используйте клавишу “Разместить”, чтобы выпить это. Поместите этот предмет на котёл, чтобы вылить речную воду в котёл. Splash Water Bottle= +Extinguishes fire and hurts some mobs= + +A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water.= + Lingering Water Bottle= + +A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water.= + Glistering Melon=Искрящаяся дыня This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Искрящаяся дыня полна маленьких золотых самородков и может отлично смотреться в рамке. Она несъедобна и не годится больше ни для чего. @@ -113,3 +120,4 @@ Strength Splash Potion II= Strength Splash Potion += This particular arrow is tipped and will give an effect when it hits a player or mob.= + diff --git a/mods/ITEMS/mcl_potions/locale/template.txt b/mods/ITEMS/mcl_potions/locale/template.txt index 27df8155e..28797e659 100644 --- a/mods/ITEMS/mcl_potions/locale/template.txt +++ b/mods/ITEMS/mcl_potions/locale/template.txt @@ -18,7 +18,14 @@ River water bottles can be used to fill cauldrons. Drinking it has no effect.= Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.= Splash Water Bottle= +Extinguishes fire and hurts some mobs= + +A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water.= + Lingering Water Bottle= + +A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water.= + Glistering Melon= This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.= @@ -113,3 +120,4 @@ Strength Splash Potion II= Strength Splash Potion += This particular arrow is tipped and will give an effect when it hits a player or mob.= + From 1834be9e46682ff41fa01f0eaf09936769e53e18 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 19:53:14 +0200 Subject: [PATCH 048/152] Lingering potion: Reduce timer by constant value --- mods/ITEMS/mcl_potions/lingering.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index b9ed85f84..0cba055d2 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -54,7 +54,7 @@ minetest.register_globalstep(function(dtime) -- Extinguish fire if water bottle if vals.is_water then if mcl_potions._extinguish_nearby_fire(pos, d) then - vals.timer = vals.timer / 2 + vals.timer = vals.timer - 3.25 end end @@ -65,7 +65,8 @@ minetest.register_globalstep(function(dtime) if obj:is_player() or entity._cmi_is_mob then vals.def.potion_fun(obj) - vals.timer = vals.timer / 2 + -- TODO: Apply timer penalty only if the potion effect was acutally applied + vals.timer = vals.timer - 3.25 end end From 53c83a347960f619dad2046829decdd63c2c9957 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 19:58:04 +0200 Subject: [PATCH 049/152] Fix German translation mistake --- mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index 6008ec36b..c20a61d1f 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -38,7 +38,7 @@ Lingering Weakness Potion +=Schwächeverweiltrank + Lingering Strength Potion=Stärkeverweiltrank Lingering Strength Potion II=Stärkeverweiltrank II Lingering Strength Potion +=Stärkeverweiltrank + -Use the “Punch” key to throw it.=Benutzen Sie die „Platzieren“-Taste zum Werfen. +Use the “Punch” key to throw it.=Benutzen Sie die „Schlagen“-Taste zum Werfen. Use the “Place” key to drink it.=Benutzen Sie die „Platzieren“-Taste zum Trinken. Drinking a potion gives you a particular effect.=Das Trinken eines Tranks gibt Ihnen einen bestimmten Effekt. 1 HP/@1s | @2=1 TP/@1s | @2 From e310de1754d96d29bf95e3cc5da4b28264e6e23e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 19:59:50 +0200 Subject: [PATCH 050/152] Fix Shulker spawnegg typo --- mods/ENTITIES/mobs_mc/shulker.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/shulker.lua b/mods/ENTITIES/mobs_mc/shulker.lua index 4304ef061..0f38f68a3 100644 --- a/mods/ENTITIES/mobs_mc/shulker.lua +++ b/mods/ENTITIES/mobs_mc/shulker.lua @@ -75,6 +75,6 @@ mobs:register_arrow("mobs_mc:shulkerbullet", { }) -mobs:register_egg("mobs_mc:shulker", S("Schulker"), "mobs_mc_spawn_icon_shulker.png", 0) +mobs:register_egg("mobs_mc:shulker", S("Shulker"), "mobs_mc_spawn_icon_shulker.png", 0) mobs:spawn_specific("mobs_mc:shulker", mobs_mc.spawn.end_city, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 5000, 2, mobs_mc.spawn_height.end_min, mobs_mc.spawn_height.end_max) From f5032503d04e59b55dbc638c730aab61eb129a72 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 20:04:12 +0200 Subject: [PATCH 051/152] Remove dead code in mcl_potions --- mods/ITEMS/mcl_potions/init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 6836b0d6e..74addfb68 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -31,8 +31,7 @@ minetest.register_craftitem("mcl_potions:fermented_spider_eye", { _doc_items_longdesc = brewhelp, wield_image = "mcl_potions_spider_eye_fermented.png", inventory_image = "mcl_potions_spider_eye_fermented.png", - -- TODO: Reveal item when it's actually useful - groups = { brewitem = 1, not_in_creative_inventory = 0, not_in_craft_guide = 0 }, + groups = { brewitem = 1, }, stack_max = 64, }) @@ -314,7 +313,7 @@ minetest.register_craftitem("mcl_potions:speckled_melon", { description = S("Glistering Melon"), _doc_items_longdesc = S("This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else."), stack_max = 64, - groups = { brewitem = 1, not_in_creative_inventory = 0, not_in_craft_guide = 0 }, + groups = { brewitem = 1, }, inventory_image = "mcl_potions_melon_speckled.png", }) From 92591b37dc378f7b161c8432a346179baa05a10f Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 20:36:44 +0200 Subject: [PATCH 052/152] Make throwable potion entities non-pointable --- mods/ITEMS/mcl_potions/lingering.lua | 3 ++- mods/ITEMS/mcl_potions/splash.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index 0cba055d2..f6c0bd474 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -126,7 +126,8 @@ function mcl_potions.register_lingering(name, descr, color, def) textures = {lingering_image(color)}, hp_max = 1, visual_size = {x=w/2,y=w/2}, - collisionbox = {0,0,0,0,0,0}, + collisionbox = {-0.1,-0.1,-0.1,0.1,0.1,0.1}, + pointable = false, on_step = function(self, dtime) local pos = self.object:get_pos() local node = minetest.get_node(pos) diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 1dc87b198..75ab6d6ed 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -55,7 +55,8 @@ function mcl_potions.register_splash(name, descr, color, def) textures = {splash_image(color)}, hp_max = 1, visual_size = {x=w/2,y=w/2}, - collisionbox = {0,0,0,0,0,0}, + collisionbox = {-0.1,-0.1,-0.1,0.1,0.1,0.1}, + pointable = false, on_step = function(self, dtime) local pos = self.object:get_pos() local node = minetest.get_node(pos) From 402205d1ed73457a2f3f1114ea9419e147b08470 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 20:40:34 +0200 Subject: [PATCH 053/152] Do not hide alive chorus flower in Creative --- mods/ITEMS/mcl_end/chorus_plant.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_end/chorus_plant.lua b/mods/ITEMS/mcl_end/chorus_plant.lua index f85fdcd82..be75bce53 100644 --- a/mods/ITEMS/mcl_end/chorus_plant.lua +++ b/mods/ITEMS/mcl_end/chorus_plant.lua @@ -134,7 +134,7 @@ minetest.register_node("mcl_end:chorus_flower", { node_box = chorus_flower_box, selection_box = { type = "regular" }, sounds = mcl_sounds.node_sound_wood_defaults(), - groups = {handy=1,axey=1, deco_block = 1, not_in_creative_inventory = 1, dig_by_piston = 1, destroy_by_lava_flow = 1,chorus_plant = 1}, + groups = {handy=1,axey=1, deco_block = 1, dig_by_piston = 1, destroy_by_lava_flow = 1,chorus_plant = 1}, node_placement_prediction = "", on_place = function(itemstack, placer, pointed_thing) From ed6604ee5685145203c7d78dab8ecf2c961dd65d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 20:44:41 +0200 Subject: [PATCH 054/152] Remove incorrect dead chorus flower tooltip --- mods/ITEMS/mcl_end/chorus_plant.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/mods/ITEMS/mcl_end/chorus_plant.lua b/mods/ITEMS/mcl_end/chorus_plant.lua index be75bce53..2eff54891 100644 --- a/mods/ITEMS/mcl_end/chorus_plant.lua +++ b/mods/ITEMS/mcl_end/chorus_plant.lua @@ -207,7 +207,6 @@ minetest.register_node("mcl_end:chorus_flower", { minetest.register_node("mcl_end:chorus_flower_dead", { description = S("Dead Chorus Flower"), - _tt_help = S("Grows on end stone"), _doc_items_longdesc = S("This is a part of a chorus plant. It doesn't grow. Chorus flowers die of old age or when they are unable to grow. A dead chorus flower can be harvested to obtain a fresh chorus flower which is able to grow again."), tiles = { "mcl_end_chorus_flower_dead.png", From 3deac5a1c6c1c00b0f16240453d7c2db7b332e77 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 20:55:07 +0200 Subject: [PATCH 055/152] Add crafting recipe for dragon's breath --- mods/ITEMS/mcl_potions/init.lua | 1 - mods/MISC/mcl_temp_helper_recipes/init.lua | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 74addfb68..045664b63 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -352,7 +352,6 @@ local awkward_table = { ["mcl_mobitems:ghast_tear"] = "mcl_potions:regeneration", ["mcl_mobitems:spider_eye"] = "mcl_potions:poison", ["mcl_mobitems:rabbit_foot"] = "mcl_potions:leaping", - ["mcl_end:chorus_flower"] = "mcl_potions:dragon_breath", -- temporary until dragon's breath is obtainable } local output_table = { diff --git a/mods/MISC/mcl_temp_helper_recipes/init.lua b/mods/MISC/mcl_temp_helper_recipes/init.lua index fdde8004f..f9a6ec0e9 100644 --- a/mods/MISC/mcl_temp_helper_recipes/init.lua +++ b/mods/MISC/mcl_temp_helper_recipes/init.lua @@ -116,3 +116,11 @@ minetest.register_craft({ output = "mcl_core:gold_ingot 9", recipe = {{ "mcl_core:emerald" }}, }) + +minetest.register_craft({ + output = "mcl_potions:dragon_breath 3", + recipe = { + {"","mcl_end:chorus_flower",""}, + {"mcl_potions:glass_bottle","mcl_potions:glass_bottle","mcl_potions:glass_bottle"}, + } +}) From fd724f4c1c3cbb223449a717cca965aeb93f344a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 20:59:16 +0200 Subject: [PATCH 056/152] Lingering heal/harm potions change at least 1 HP --- mods/ITEMS/mcl_potions/functions.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index d18801b2d..5cd52b297 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -532,6 +532,10 @@ function mcl_potions.healing_func(player, hp) if obj and obj.harmed_by_heal then hp = -hp end if hp > 0 then + -- at least 1 HP + if hp < 1 then + hp = 1 + end if obj and obj._cmi_is_mob then obj.health = math.max(obj.health + hp, obj.hp_max) @@ -539,7 +543,10 @@ function mcl_potions.healing_func(player, hp) player:set_hp(math.min(player:get_hp() + hp, player:get_properties().hp_max), { type = "set_hp", other = "healing" }) end - else + elseif hp < 0 then + if hp > -1 then + hp = -1 + end if obj and obj._cmi_is_mob then obj.health = obj.health + hp From 2e9231ac56a9c62be69ce68f0e3500fb1de8f455 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 5 Aug 2020 21:00:30 +0200 Subject: [PATCH 057/152] Remove dead chorus flower from Creative --- mods/ITEMS/mcl_end/chorus_plant.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_end/chorus_plant.lua b/mods/ITEMS/mcl_end/chorus_plant.lua index 2eff54891..1363debf7 100644 --- a/mods/ITEMS/mcl_end/chorus_plant.lua +++ b/mods/ITEMS/mcl_end/chorus_plant.lua @@ -223,7 +223,7 @@ minetest.register_node("mcl_end:chorus_flower_dead", { selection_box = { type = "regular" }, sounds = mcl_sounds.node_sound_wood_defaults(), drop = "mcl_end:chorus_flower", - groups = {handy=1,axey=1, deco_block = 1, dig_by_piston = 1, destroy_by_lava_flow = 1,chorus_plant = 1}, + groups = {handy=1,axey=1, deco_block = 1, dig_by_piston = 1, destroy_by_lava_flow = 1,chorus_plant = 1, not_in_creative_inventory=1}, after_dig_node = mcl_end.check_detach_chorus_plant, on_blast = mcl_end.check_blast_chorus_plant, _mcl_blast_resistance = 2, From 49a5f765bd45f9c315c81a7ff498d3653fcacdaa Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 5 Aug 2020 20:18:18 -0400 Subject: [PATCH 058/152] Save player effects on server shutdown. --- mods/ITEMS/mcl_potions/functions.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 7d61f2c8b..539727b59 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -455,6 +455,14 @@ minetest.register_on_joinplayer( function(player) mcl_potions._load_player_effects(player) end) +minetest.register_on_shutdown(function() + -- save player effects on server shutdown + for _,player in ipairs(minetest.get_connected_players()) do + mcl_potions._save_player_effects(player) + end + +end) + -- ░██████╗██╗░░░██╗██████╗░██████╗░░█████╗░██████╗░████████╗██╗███╗░░██╗░██████╗░ -- ██╔════╝██║░░░██║██╔══██╗██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██║████╗░██║██╔════╝░ From 6ba7ba981d4dc5219674476bfae7b9d4f709656c Mon Sep 17 00:00:00 2001 From: kay27 Date: Thu, 6 Aug 2020 19:15:59 +0400 Subject: [PATCH 059/152] Russian translation of mcl_potions, mcl_brewing --- .../mcl_brewing/locale/mcl_brewing.ru.tr | 16 +- .../mcl_potions/locale/mcl_potions.ru.tr | 168 +++++++++--------- 2 files changed, 92 insertions(+), 92 deletions(-) diff --git a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr index d8d32a3a2..1cfcfb631 100644 --- a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr +++ b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr @@ -1,10 +1,10 @@ # textdomain: mcl_brewing Brewing Stand=Варочный стенд -Inventory= -To use a brewing stand, rightclick it.= -To brew, you need blaze powder as fuel, a brewing material and at least 1 glass bottle filled with a liquid.= -Place the blaze powder in the left slot, the brewing material in the middle slot and 1-3 bottles in the remaining slots.= -When you have found a good comination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.= -Different combinations of brewing materials and liquids will give different results. Try to experiment!= -The stand allows you to brew potions!= -Brew Potions= +Inventory=Инвентарь +To use a brewing stand, rightclick it.=Кликните правой, чтобы использовать варочный стенд. +To brew, you need blaze powder as fuel, a brewing material and at least 1 glass bottle filled with a liquid.=Для приготовления зелья вам понадобится огненный порошок в качестве топлива, исходный материал и как минимум 1 стеклянная бутылка, наполненная жидкостью. +Place the blaze powder in the left slot, the brewing material in the middle slot and 1-3 bottles in the remaining slots.=Поместите огненный порошок в левый отсек, исходный материал в средний отсек и 1-3 бутылки в оставшиеся отсеки. +When you have found a good comination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.=Когда вы подберёте хорошее сочетание, приготовление зелья начнётся автоматически — появится пар и начнётся расход топлива и исходного материала. Зелья вскоре будут готовы. +Different combinations of brewing materials and liquids will give different results. Try to experiment!=Разные сочетания варочных материалов и жидкостей будут давать разные результаты. Поэкспериментируйте! +The stand allows you to brew potions!=Стенд позволяет вам варить зелья! +Brew Potions=Зельеварение diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr index 92ea08b82..af8a34f3b 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr @@ -17,107 +17,107 @@ River water bottles can be used to fill cauldrons. Drinking it has no effect.=Б Use the “Place” key to drink. Place this item on a cauldron to pour the river water into the cauldron.=Используйте клавишу “Разместить”, чтобы выпить это. Поместите этот предмет на котёл, чтобы вылить речную воду в котёл. -Splash Water Bottle= -Extinguishes fire and hurts some mobs= +Splash Water Bottle=Бутылка со взрывающейся водой +Extinguishes fire and hurts some mobs=Тушит огонь и ранит некоторых мобов -A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water.= +A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water.=Бутылка с водой, которую можно метать. Она разбивается при ударе, тушит ближайший огонь и ранит мобов, уязвимых к воде. -Lingering Water Bottle= +Lingering Water Bottle=Бутылка с оседающей водой -A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water.= +A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water.=Бутылка с водой, которую можно метать. Она разбивается при ударе, образуя облако пара, которое оседает на землю через некоторое время. Это облако тушит огонь и ранит мобов, уязвимых к воде. Glistering Melon=Искрящаяся дыня This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Искрящаяся дыня полна маленьких золотых самородков и может отлично смотреться в рамке. Она несъедобна и не годится больше ни для чего. -A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= +A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.=Зелье, которое можно метать. При ударе оно разбивается, создавая волшебное облако, которое задерживается на некоторое время. Любой игрок или моб внутри облака получит эффект зелья, возможно, неоднократно. -Lingering Weakness Potion= -Lingering Weakness Potion += -Lingering Strength Potion= -Lingering Strength Potion II= -Lingering Strength Potion += -Use the “Punch” key to throw it.= -Use the “Place” key to drink it.=Используйте клавишу “Разместить”, чтобы выпить это. -Drinking a potion gives you a particular effect.= -1 HP/@1s | @2= -@1 HP= -@1 Potion= -Splash @1 Potion= -Lingering @1 Potion= -Arrow of @1= - II= - IV= -@1 Potion@2= -Splash @1@2 Potion= -Lingering @1@2 Potion= -Arrow of @1@2= -@1 + Potion= -Splash @1 + Potion= -Lingering @1 + Potion= -Arrow of @1 += +Lingering Weakness Potion=Оседающее зелье слабости +Lingering Weakness Potion +=Оседающее зелье слабости + +Lingering Strength Potion=Оседающее зелье силы +Lingering Strength Potion II=Оседающее зелье силы II +Lingering Strength Potion +=Оседающее зелье силы + +Use the “Punch” key to throw it.=Нажмите [Ударить] для метания. +Use the “Place” key to drink it.=Нажмите [Разместить] для выпивания. +Drinking a potion gives you a particular effect.=Выпивание зелья даёт вам особый эффект. +1 HP/@1s | @2=1 HP/@1с | @2 +@1 HP=@1 HP +@1 Potion=Зелье @1 +Splash @1 Potion=Взрывающее зелье @1 +Lingering @1 Potion=Оседающее зелье @1 +Arrow of @1=Стрельба @1 + II= II + IV= IV +@1 Potion@2=@1 Зелье@2 +Splash @1@2 Potion=Взрывающее зелье @1@2 +Lingering @1@2 Potion=Оседающее зелье @1@2 +Arrow of @1@2=Стрельба @1@2 +@1 + Potion=@1 + Зелье +Splash @1 + Potion=Взрывающее @1 + Зелье +Lingering @1 + Potion=Оседающее @1 + Зелье +Arrow of @1 +=Стрельба @1 + Awkward Potion=Невкусное зелье -Awkward Splash Potion= -Awkward Lingering Potion= -Has an awkward taste and is used for brewing potions.= +Awkward Splash Potion=Невкусное взрывающееся зелье +Awkward Lingering Potion=Невкусное оседающее зелье +Has an awkward taste and is used for brewing potions.=Имеет неприятный вкус и используется для приготовления других зелий. Mundane Potion=Успокоительное зелье -Mundane Splash Potion= -Mundane Lingering Potion= -Has a terrible taste and is not useful for brewing potions.= +Mundane Splash Potion=Успокоительное взрывающееся зелье +Mundane Lingering Potion=Успокоительное оседающее зелье +Has a terrible taste and is not useful for brewing potions.=Имеет отвратительный вкус и используется для приготовления других зелий. Thick Potion=Густое зелье -Thick Splash Potion= -Thick Lingering Potion= -Has a bitter taste and is not useful for brewing potions.= +Thick Splash Potion=Густое взрывающееся зелье +Thick Lingering Potion=Густое оседающее зелье +Has a bitter taste and is not useful for brewing potions.=Имеет горький вкус и используется для приготовления других зелий. Dragon's Breath=Дыхание дракона -This item is used in brewing and can be combined with splash potions to create lingering potions.= +This item is used in brewing and can be combined with splash potions to create lingering potions.=Этот предмет используется в зельеварении и может объединяться со взрывающимися зельями, чтобы создать эффект оседания -Healing= -+4 HP= -+8 HP= -Instantly heals.= -Harming= --6 HP= --12 HP= -Instantly deals damage.= -Night Vision= -Grants the ability to see in darkness.= -Swiftness= -Increases walking speed.= -Slowness= -Decreases walking speed.= -Leaping= -Increases jump strength.= -Poison= -Applies the poison effect which deals damage at a regular interval.= -Regeneration= -Regenerates health over time.= -Invisibility= -Grants invisibility.= -Water Breathing= -Grants limitless breath underwater.= -Fire Resistance= -Grants immunity to damage from heat sources like fire.= -Weakness= --4 HP damage | 1:30= -Weakness += --4 HP damage | 4:00= -Strength= -+3 HP damage | 3:00= -Strength II= -+6 HP damage | 1:30= -Strength += -+3 HP damage | 8:00= -Try different combinations to create potions.= +Healing=Лечение ++4 HP=+4 HP ++8 HP=+8 HP +Instantly heals.=Лечит мгновенно +Harming=Вред +-6 HP=-6 HP +-12 HP=-12 HP +Instantly deals damage.=Вызывает мгновенную смерть. +Night Vision=Ночное зрение +Grants the ability to see in darkness.=Даёт возможность видеть в темноте +Swiftness=Быстрота +Increases walking speed.=Увеличивает скорость ходьбы +Slowness=Замедление +Decreases walking speed.=Уменьшает скорость ходьбы +Leaping=Прыгучесть +Increases jump strength.=Увеличивает силу прыжка +Poison=Отрава +Applies the poison effect which deals damage at a regular interval.=Наносит эффект яда, который вызывает урон через равные промежутки времени. +Regeneration=Восстановление +Regenerates health over time.=Восстанавливает здоровье со временем. +Invisibility=Невидимость +Grants invisibility.=Делает невидимым. +Water Breathing=Подводное дыхание +Grants limitless breath underwater.=Даёт возможность неограниченно дышать под водой. +Fire Resistance=Огнестойкость +Grants immunity to damage from heat sources like fire.=Делает невосприимчивым к урону от источников тепла, например, от огня. +Weakness=Слабость +-4 HP damage | 1:30=Урон -4 HP | 1:30 +Weakness +=Слабость + +-4 HP damage | 4:00=Урон -4 HP | 4:00 +Strength=Сила ++3 HP damage | 3:00=Урон +3 HP | 3:00 +Strength II=Сила II ++6 HP damage | 1:30=Урон +6 HP | 1:30 +Strength +=Сила + ++3 HP damage | 8:00=Урон +3 HP | 8:00 +Try different combinations to create potions.=Пробуйте разные сочетания для приготовления зелий. No effect=Не оказывает эффекта -A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.=Зелье, которое можно метать. Оно разбивается при ударе и он дает всем ближайшим игрокам и мобам эффект статуса. -Weakness Splash Potion= -Weakness Splash Potion += -Strength Splash Potion= -Strength Splash Potion II= -Strength Splash Potion += +Weakness Splash Potion=Взрывающееся зелье слабости +Weakness Splash Potion +=Взрывающееся зелье слабости + +Strength Splash Potion=Взрывающееся зелье силы +Strength Splash Potion II=Взрывающееся зелье силы II +Strength Splash Potion +=Взрывающееся зелье силы + -This particular arrow is tipped and will give an effect when it hits a player or mob.= +This particular arrow is tipped and will give an effect when it hits a player or mob.=Эта необычная стрела с обработанным наконечником даёт эффект при попадании в игрока или моба. From 0e462ef883c4107c0f467736c89f2c762063628e Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 6 Aug 2020 17:30:28 -0400 Subject: [PATCH 060/152] Update potions to not break on contact with liquid nodes. --- mods/ITEMS/mcl_potions/lingering.lua | 3 ++- mods/ITEMS/mcl_potions/splash.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index f6c0bd474..a12f8b304 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -132,8 +132,9 @@ function mcl_potions.register_lingering(name, descr, color, def) local pos = self.object:get_pos() local node = minetest.get_node(pos) local n = node.name + local g = minetest.get_node_group(n, "liquid") local d = 4 - if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" or mcl_potions.is_obj_hit(self, pos) then + if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) add_lingering_effect(pos, color, def, name == "water") local texture, minacc, maxacc diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 75ab6d6ed..54b321b44 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -61,9 +61,10 @@ function mcl_potions.register_splash(name, descr, color, def) local pos = self.object:get_pos() local node = minetest.get_node(pos) local n = node.name + local g = minetest.get_node_group(n, "liquid") local d = 0.1 local redux_map = {7/8,0.5,0.25} - if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" or mcl_potions.is_obj_hit(self, pos) then + if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) local texture, acc if name == "water" then From 128e98ca4d8a09ef03f36e2a1586ebb096bea504 Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 6 Aug 2020 17:30:49 -0400 Subject: [PATCH 061/152] Delete dead code --- mods/ITEMS/mcl_potions/lingering.lua | 30 ----------------------- mods/ITEMS/mcl_potions/splash.lua | 36 ---------------------------- 2 files changed, 66 deletions(-) diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index a12f8b304..57141ea89 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -172,33 +172,3 @@ function mcl_potions.register_lingering(name, descr, color, def) end, }) end - --- -- register_lingering("weakness", S("Lingering Weakness Potion"), "#6600AA", { --- -- potion_fun = function(player) mcl_potions.weakness_func(player, -4, mcl_potions.DURATION*mcl_potions.INV_FACTOR*0.25) end, --- -- -- TODO: Fix tooltip --- -- tt = time_string(mcl_potions.DURATION*mcl_potions.INV_FACTOR*0.25) --- -- }) --- -- --- -- register_lingering("weakness_plus", S("Lingering Weakness Potion +"), "#7700BB", { --- -- potion_fun = function(player) mcl_potions.weakness_func(player, -4, mcl_potions.DURATION_PLUS*mcl_potions.INV_FACTOR*0.25) end, --- -- -- TODO: Fix tooltip --- -- tt = time_string(mcl_potions.DURATION*mcl_potions.INV_FACTOR*0.25) --- -- }) --- -- --- -- register_lingering("strength", S("Lingering Strength Potion"), "#D444D4", { --- -- potion_fun = function(player) mcl_potions.strength_func(player, 3, mcl_potions.DURATION*0.25) end, --- -- -- TODO: Fix tooltip --- -- tt = time_string(mcl_potions.DURATION*0.25) --- -- }) --- -- --- -- register_lingering("strength_2", S("Lingering Strength Potion II"), "#D444F4", { --- -- potion_fun = function(player) mcl_potions.strength_func(player, 6, smcl_potions.DURATION_2*0.25) end, --- -- -- TODO: Fix tooltip --- -- tt = time_string(mcl_potions.DURATION_2*0.25) --- -- }) --- -- --- -- register_lingering("strength_plus", S("Lingering Strength Potion +"), "#D444E4", { --- -- potion_fun = function(player) mcl_potions.strength_func(player, 3, mcl_potions.DURATION_PLUS*0.25) end, --- -- -- TODO: Fix tooltip --- -- tt = time_string(mcl_potions.DURATION_PLUS*0.25) --- -- }) diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 54b321b44..6fd761eea 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -116,39 +116,3 @@ end local function time_string(dur) return math.floor(dur/60)..string.format(":%02d",math.floor(dur % 60)) end - -local splash_DUR = mcl_potions.DURATION*mcl_potions.SPLASH_FACTOR -local splash_DUR_2 = mcl_potions.DURATION_2*mcl_potions.SPLASH_FACTOR -local splash_DUR_pl = mcl_potions.DURATION_PLUS*mcl_potions.SPLASH_FACTOR - - - --- register_splash("weakness", S("Weakness Splash Potion"), "#6600AA", { --- potion_fun = function(player, redx) mcl_potions.weakness_func(player, -4, splash_DUR*mcl_potions.INV_FACTOR*redx) end, --- -- TODO: Fix tooltip --- tt = time_string(splash_DUR*mcl_potions.INV_FACTOR) --- }) --- --- register_splash("weakness_plus", S("Weakness Splash Potion +"), "#7700BB", { --- potion_fun = function(player, redx) mcl_potions.weakness_func(player, -4, splash_DUR_pl*mcl_potions.INV_FACTOR*redx) end, --- -- TODO: Fix tooltip --- tt = time_string(splash_DUR_pl*mcl_potions.INV_FACTOR) --- }) --- --- register_splash("strength", S("Strength Splash Potion"), "#D444D4", { --- potion_fun = function(player, redx) mcl_potions.strength_func(player, 3, splash_DUR*redx) end, --- -- TODO: Fix tooltip --- tt = time_string(splash_DUR) --- }) --- --- register_splash("strength_2", S("Strength Splash Potion II"), "#D444F4", { --- potion_fun = function(player, redx) mcl_potions.strength_func(player, 6, splash_DUR_2*redx) end, --- -- TODO: Fix tooltip --- tt = time_string(splash_DUR_2) --- }) --- --- register_splash("strength_plus", S("Strength Splash Potion +"), "#D444E4", { --- potion_fun = function(player, redx) mcl_potions.strength_func(player, 3, splash_DUR_pl*redx) end, --- -- TODO: Fix tooltip --- tt = time_string(splash_DUR_pl) --- }) From 48fae05040edefba3cf1408b6a7f4d9672eb6d11 Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 6 Aug 2020 17:44:16 -0400 Subject: [PATCH 062/152] Fix problem with charging double potion effect when hit by a tipped_arrow --- mods/ITEMS/mcl_potions/tipped_arrow.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index 483b621aa..f9bfa166e 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -259,7 +259,6 @@ function mcl_potions.register_arrow(name, desc, color, def) if self._shooter and self._shooter:is_player() then -- “Ding” sound for hitting another player minetest.sound_play({name="mcl_bows_hit_player", gain=0.1}, {to_player=self._shooter}, true) - def.potion_fun(obj) end end From c373c972b34ee21017bc327b0b0b6456a64fd7d6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 8 Aug 2020 09:28:47 +0200 Subject: [PATCH 063/152] Fix typo in mcl_brewing: comination --- mods/ITEMS/mcl_brewing/init.lua | 2 +- mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr | 2 +- mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr | 2 +- mods/ITEMS/mcl_brewing/locale/template.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index 848c2e9b8..880fb949f 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -313,7 +313,7 @@ local doc_string = S("To use a brewing stand, rightclick it.").."\n".. S("To brew, you need blaze powder as fuel, a brewing material and at least 1 glass bottle filled with a liquid.").."\n".. S("Place the blaze powder in the left slot, the brewing material in the middle slot and 1-3 bottles in the remaining slots.").."\n".. - S("When you have found a good comination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.").."\n".. + S("When you have found a good combination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.").."\n".. S("Different combinations of brewing materials and liquids will give different results. Try to experiment!") local tiles = {"mcl_brewing_top.png", --top diff --git a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr index 69aa23c18..fb127c914 100644 --- a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr +++ b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.de.tr @@ -4,7 +4,7 @@ Inventory=Inventar To use a brewing stand, rightclick it.=Um einen Braustand zu benutzen, rechtsklicken Sie ihn. To brew, you need blaze powder as fuel, a brewing material and at least 1 glass bottle filled with a liquid.=Zum Brauen benötigt man Lohenstaub als Brennstoff, ein Braumaterial und mindestens 1 Glasflasche, die mit einer Flüssigkeit gefüllt ist. Place the blaze powder in the left slot, the brewing material in the middle slot and 1-3 bottles in the remaining slots.=Platzieren Sie den Lohenstaub in den linken Plartz, das Braumaterial in den mittleren Platz und 1-3 Glasflaschen in die übrigen Plätze. -When you have found a good comination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.=Wenn Sie eine gute Kombination gefunden haben, beginnt der Brauvorgang automatisch, und es entsteht Dampf. Der Brennstoff und das Brühmaterial wird aufbraucht. Die Tränke werden bald fertig sein. +When you have found a good combination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.=Wenn Sie eine gute Kombination gefunden haben, beginnt der Brauvorgang automatisch, und es entsteht Dampf. Der Brennstoff und das Brühmaterial wird aufbraucht. Die Tränke werden bald fertig sein. Different combinations of brewing materials and liquids will give different results. Try to experiment!=Unterschiedliche Kombinationen von Braumaterialien und Flüssigkeiten werden zu unterschiedlichen Ergebnissen führen. Experimentieren Sie! The stand allows you to brew potions!=Der Stand ermöglicht das Brauen von Tränken. Brew Potions=Tränke brauen diff --git a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr index 1cfcfb631..37b96819d 100644 --- a/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr +++ b/mods/ITEMS/mcl_brewing/locale/mcl_brewing.ru.tr @@ -4,7 +4,7 @@ Inventory=Инвентарь To use a brewing stand, rightclick it.=Кликните правой, чтобы использовать варочный стенд. To brew, you need blaze powder as fuel, a brewing material and at least 1 glass bottle filled with a liquid.=Для приготовления зелья вам понадобится огненный порошок в качестве топлива, исходный материал и как минимум 1 стеклянная бутылка, наполненная жидкостью. Place the blaze powder in the left slot, the brewing material in the middle slot and 1-3 bottles in the remaining slots.=Поместите огненный порошок в левый отсек, исходный материал в средний отсек и 1-3 бутылки в оставшиеся отсеки. -When you have found a good comination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.=Когда вы подберёте хорошее сочетание, приготовление зелья начнётся автоматически — появится пар и начнётся расход топлива и исходного материала. Зелья вскоре будут готовы. +When you have found a good combination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.=Когда вы подберёте хорошее сочетание, приготовление зелья начнётся автоматически — появится пар и начнётся расход топлива и исходного материала. Зелья вскоре будут готовы. Different combinations of brewing materials and liquids will give different results. Try to experiment!=Разные сочетания варочных материалов и жидкостей будут давать разные результаты. Поэкспериментируйте! The stand allows you to brew potions!=Стенд позволяет вам варить зелья! Brew Potions=Зельеварение diff --git a/mods/ITEMS/mcl_brewing/locale/template.txt b/mods/ITEMS/mcl_brewing/locale/template.txt index 172788156..e5619f1e1 100644 --- a/mods/ITEMS/mcl_brewing/locale/template.txt +++ b/mods/ITEMS/mcl_brewing/locale/template.txt @@ -4,7 +4,7 @@ Inventory= To use a brewing stand, rightclick it.= To brew, you need blaze powder as fuel, a brewing material and at least 1 glass bottle filled with a liquid.= Place the blaze powder in the left slot, the brewing material in the middle slot and 1-3 bottles in the remaining slots.= -When you have found a good comination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.= +When you have found a good combination, the brewing will commence automatically and steam starts to appear, using up the fuel and brewing material. The potions will soon be ready.= Different combinations of brewing materials and liquids will give different results. Try to experiment!= The stand allows you to brew potions!= Brew Potions= From 7104bbd2dfd2d3a1aef0d65fd36aa75dd5757b73 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 8 Aug 2020 09:32:38 +0200 Subject: [PATCH 064/152] Remove tt strings for WIP potions for now --- mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr | 5 ----- mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr | 5 ----- mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr | 5 ----- mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr | 5 ----- mods/ITEMS/mcl_potions/locale/template.txt | 5 ----- mods/ITEMS/mcl_potions/potions.lua | 10 +++++----- 6 files changed, 5 insertions(+), 30 deletions(-) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index c20a61d1f..68ce919d6 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -100,15 +100,10 @@ Grants limitless breath underwater.=Gibt unbegrenzten Atem im Wasser. Fire Resistance=Feuerresistenz Grants immunity to damage from heat sources like fire.=Gibt Immunität gegenüber Schaden von Hitzequellen wie Feuer. Weakness=Schwäche --4 HP damage | 1:30=-4 HP Schaden | 1:30 Weakness +=Schwäche + --4 HP damage | 4:00=-4 HP Schaden | 4:00 Strength=Stärke -+3 HP damage | 3:00=+3 HP Schaden | 3:00 Strength II=Stärke II -+6 HP damage | 1:30=+6 HP Schaden | 1:30 Strength +=Stärke + -+3 HP damage | 8:00=+3 HP Schaden | 8:00 Try different combinations to create potions.=Probieren Sie Kombinationen aus, um Tränke herzustellen. No effect=Keine Wirkung diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr index 9b5bc6a84..5a03a6f9d 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr @@ -99,15 +99,10 @@ Grants limitless breath underwater.= Fire Resistance= Grants immunity to damage from heat sources like fire.= Weakness= --4 HP damage | 1:30= Weakness += --4 HP damage | 4:00= Strength= -+3 HP damage | 3:00= Strength II= -+6 HP damage | 1:30= Strength += -+3 HP damage | 8:00= Try different combinations to create potions.= No effect= diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr index ce149320d..d1ea0f9a6 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr @@ -99,15 +99,10 @@ Grants limitless breath underwater.= Fire Resistance= Grants immunity to damage from heat sources like fire.= Weakness= --4 HP damage | 1:30= Weakness += --4 HP damage | 4:00= Strength= -+3 HP damage | 3:00= Strength II= -+6 HP damage | 1:30= Strength += -+3 HP damage | 8:00= Try different combinations to create potions.= No effect=Aucun effet diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr index af8a34f3b..150d5e396 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr @@ -99,15 +99,10 @@ Grants limitless breath underwater.=Даёт возможность неогра Fire Resistance=Огнестойкость Grants immunity to damage from heat sources like fire.=Делает невосприимчивым к урону от источников тепла, например, от огня. Weakness=Слабость --4 HP damage | 1:30=Урон -4 HP | 1:30 Weakness +=Слабость + --4 HP damage | 4:00=Урон -4 HP | 4:00 Strength=Сила -+3 HP damage | 3:00=Урон +3 HP | 3:00 Strength II=Сила II -+6 HP damage | 1:30=Урон +6 HP | 1:30 Strength +=Сила + -+3 HP damage | 8:00=Урон +3 HP | 8:00 Try different combinations to create potions.=Пробуйте разные сочетания для приготовления зелий. No effect=Не оказывает эффекта diff --git a/mods/ITEMS/mcl_potions/locale/template.txt b/mods/ITEMS/mcl_potions/locale/template.txt index 28797e659..99f48a01f 100644 --- a/mods/ITEMS/mcl_potions/locale/template.txt +++ b/mods/ITEMS/mcl_potions/locale/template.txt @@ -99,15 +99,10 @@ Grants limitless breath underwater.= Fire Resistance= Grants immunity to damage from heat sources like fire.= Weakness= --4 HP damage | 1:30= Weakness += --4 HP damage | 4:00= Strength= -+3 HP damage | 3:00= Strength II= -+6 HP damage | 1:30= Strength += -+3 HP damage | 8:00= Try different combinations to create potions.= No effect= diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index b7608bd8c..4664cec5c 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -578,7 +578,7 @@ end -- minetest.register_craftitem("mcl_potions:weakness", { -- description = S("Weakness"), --- _tt_help = S("-4 HP damage | 1:30"), +-- _tt_help = TODO, -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#6600AA"), -- inventory_image = potion_image("#6600AA"), @@ -602,7 +602,7 @@ end -- -- minetest.register_craftitem("mcl_potions:weakness_plus", { -- description = S("Weakness +"), --- _tt_help = S("-4 HP damage | 4:00"), +-- _tt_help = TODO, -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#7700BB"), -- inventory_image = potion_image("#7700BB"), @@ -626,7 +626,7 @@ end -- -- minetest.register_craftitem("mcl_potions:strength", { -- description = S("Strength"), --- _tt_help = S("+3 HP damage | 3:00"), +-- _tt_help = TODO, -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#D444D4"), -- inventory_image = potion_image("#D444D4"), @@ -650,7 +650,7 @@ end -- -- minetest.register_craftitem("mcl_potions:strength_2", { -- description = S("Strength II"), --- _tt_help = S("+6 HP damage | 1:30"), +-- _tt_help = TODO, -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#D444E4"), -- inventory_image = potion_image("#D444E4"), @@ -674,7 +674,7 @@ end -- -- minetest.register_craftitem("mcl_potions:strength_plus", { -- description = S("Strength +"), --- _tt_help = S("+3 HP damage | 8:00"), +-- _tt_help = TODO, -- _doc_items_longdesc = brewhelp, -- wield_image = potion_image("#D444F4"), -- inventory_image = potion_image("#D444F4"), From a472c30163889aae5994402a73accb79ffb7cefa Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 8 Aug 2020 10:00:16 +0200 Subject: [PATCH 065/152] Fix indentations in mcl_potions/mcl_brewing --- mods/ITEMS/mcl_brewing/init.lua | 44 +++--- mods/ITEMS/mcl_potions/functions.lua | 111 ++++++++------- mods/ITEMS/mcl_potions/init.lua | 34 ++--- mods/ITEMS/mcl_potions/lingering.lua | 176 ++++++++++++------------ mods/ITEMS/mcl_potions/potions.lua | 46 ++++--- mods/ITEMS/mcl_potions/splash.lua | 147 ++++++++++---------- mods/ITEMS/mcl_potions/tipped_arrow.lua | 11 +- 7 files changed, 294 insertions(+), 275 deletions(-) diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index 880fb949f..944b32aa3 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -152,22 +152,22 @@ local function brewing_stand_timer(pos, elapsed) d = 0.5 minetest.add_particlespawner({ - amount = 4, - time = 1, - minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, - maxpos = {x=pos.x+d, y=pos.y+2, z=pos.z+d}, - minvel = {x=-0.1, y=0, z=-0.1}, - maxvel = {x=0.1, y=0.5, z=0.1}, - minacc = {x=-0.05, y=0, z=-0.05}, - maxacc = {x=0.05, y=.1, z=0.05}, - minexptime = 1, - maxexptime = 2, - minsize = 0.5, - maxsize = 2, - collisiondetection = true, - vertical = false, - texture = "mcl_brewing_bubble_sprite.png", - }) + amount = 4, + time = 1, + minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, + maxpos = {x=pos.x+d, y=pos.y+2, z=pos.z+d}, + minvel = {x=-0.1, y=0, z=-0.1}, + maxvel = {x=0.1, y=0.5, z=0.1}, + minacc = {x=-0.05, y=0, z=-0.05}, + maxacc = {x=0.05, y=.1, z=0.05}, + minexptime = 1, + maxexptime = 2, + minsize = 0.5, + maxsize = 2, + collisiondetection = true, + vertical = false, + texture = "mcl_brewing_bubble_sprite.png", + }) -- Replace the stand item with the brew result if stand_timer >= BREW_TIME then @@ -231,7 +231,6 @@ local function brewing_stand_timer(pos, elapsed) meta:set_float("fuel_timer", fuel_timer) meta:set_float("stand_timer", stand_timer) meta:set_float("fuel", fuel) - -- meta:set_list("stand_items", stand_list) meta:set_string("formspec", formspec) return result @@ -317,11 +316,11 @@ local doc_string = S("Different combinations of brewing materials and liquids will give different results. Try to experiment!") local tiles = {"mcl_brewing_top.png", --top - "mcl_brewing_base.png", --bottom - "mcl_brewing_side.png", --right - "mcl_brewing_side.png", --left - "mcl_brewing_side.png", --back - "mcl_brewing_side.png^[transformFX"} --front + "mcl_brewing_base.png", --bottom + "mcl_brewing_side.png", --right + "mcl_brewing_side.png", --left + "mcl_brewing_side.png", --back + "mcl_brewing_side.png^[transformFX"} --front local allow_put = function(pos, listname, index, stack, player) local name = player:get_player_name() @@ -856,7 +855,6 @@ minetest.register_node("mcl_brewing:stand_011", { _mcl_blast_resistance = 1, _mcl_hardness = 1, on_destruct = on_destruct, - -- after_dig_node = after_dig, allow_metadata_inventory_take = allow_take, allow_metadata_inventory_put = allow_put, on_metadata_inventory_put = on_put, diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 539727b59..ad1cc9c55 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -296,14 +296,15 @@ minetest.register_globalstep(function(dtime) end) -local is_fire_node = { ["mcl_core:lava_flowing"]=true, - ["mcl_core:lava_source"]=true, - ["mcl_fire:eternal_fire"]=true, - ["mcl_fire:fire"]=true, - ["mcl_nether:magma"]=true, - ["mcl_nether:nether_lava_source"]=true, - ["mcl_nether:nether_lava_flowing"]=true, - ["mcl_nether:nether_lava_source"]=true} +local is_fire_node = { ["mcl_core:lava_flowing"]=true, + ["mcl_core:lava_source"]=true, + ["mcl_fire:eternal_fire"]=true, + ["mcl_fire:fire"]=true, + ["mcl_nether:magma"]=true, + ["mcl_nether:nether_lava_source"]=true, + ["mcl_nether:nether_lava_flowing"]=true, + ["mcl_nether:nether_lava_source"]=true +} -- Prevent damage to player with Fire Resistance enabled minetest.register_on_player_hpchange(function(player, hp_change, reason) @@ -314,8 +315,6 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason) -- it's worth noting that you don't take damage from players in this case... local player_info = mcl_playerinfo[player:get_player_name()] - -- if reason.type == "drown" then return hp_change - if is_fire_node[player_info.node_head] or is_fire_node[player_info.node_feet] or is_fire_node[player_info.node_stand] then return 0 else @@ -347,7 +346,9 @@ end, true) function mcl_potions._reset_player_effects(player) - if not player:is_player() then return end + if not player:is_player() then + return + end meta = player:get_meta() mcl_potions.make_invisible(player, false) @@ -375,7 +376,9 @@ end function mcl_potions._save_player_effects(player) - if not player:is_player() then return end + if not player:is_player() then + return + end meta = player:get_meta() meta:set_string("_is_invisible", minetest.serialize(is_invisible[player])) @@ -393,7 +396,9 @@ end function mcl_potions._load_player_effects(player) - if not player:is_player() then return end + if not player:is_player() then + return + end meta = player:get_meta() if minetest.deserialize(meta:get_string("_is_invisible")) then @@ -487,7 +492,9 @@ function mcl_potions.is_obj_hit(self, pos) if entity and entity.name ~= self.object:get_luaentity().name then - if entity._cmi_is_mob then return true end + if entity._cmi_is_mob then + return true + end elseif object:is_player() and self._thrower ~= object:get_player_name() then return true @@ -500,7 +507,9 @@ end function mcl_potions.make_invisible(player, toggle) - if not player then return false end + if not player then + return false + end local is_player = player:is_player() local entity = player:get_luaentity() @@ -533,22 +542,22 @@ function mcl_potions._use_potion(item, obj, color) local pos = obj:get_pos() minetest.sound_play("mcl_potions_drinking", {pos = pos, max_hear_distance = 6, gain = 1}) minetest.add_particlespawner({ - amount = 25, - time = 1, - minpos = {x=pos.x-d, y=pos.y+1, z=pos.z-d}, - maxpos = {x=pos.x+d, y=pos.y+2, z=pos.z+d}, - minvel = {x=-0.1, y=0, z=-0.1}, - maxvel = {x=0.1, y=0.1, z=0.1}, - minacc = {x=-0.1, y=0, z=-0.1}, - maxacc = {x=0.1, y=.1, z=0.1}, - minexptime = 1, - maxexptime = 5, - minsize = 0.5, - maxsize = 1, - collisiondetection = true, - vertical = false, - texture = "mcl_potions_sprite.png^[colorize:"..color..":127", - }) + amount = 25, + time = 1, + minpos = {x=pos.x-d, y=pos.y+1, z=pos.z-d}, + maxpos = {x=pos.x+d, y=pos.y+2, z=pos.z+d}, + minvel = {x=-0.1, y=0, z=-0.1}, + maxvel = {x=0.1, y=0.1, z=0.1}, + minacc = {x=-0.1, y=0, z=-0.1}, + maxacc = {x=0.1, y=.1, z=0.1}, + minexptime = 1, + maxexptime = 5, + minsize = 0.5, + maxsize = 1, + collisiondetection = true, + vertical = false, + texture = "mcl_potions_sprite.png^[colorize:"..color..":127", + }) end @@ -556,22 +565,22 @@ function mcl_potions._add_spawner(obj, color) local d = 0.2 local pos = obj:get_pos() minetest.add_particlespawner({ - amount = 1, - time = 1, - minpos = {x=pos.x-d, y=pos.y+1, z=pos.z-d}, - maxpos = {x=pos.x+d, y=pos.y+2, z=pos.z+d}, - minvel = {x=-0.1, y=0, z=-0.1}, - maxvel = {x=0.1, y=0.1, z=0.1}, - minacc = {x=-0.1, y=0, z=-0.1}, - maxacc = {x=0.1, y=.1, z=0.1}, - minexptime = 0.5, - maxexptime = 1, - minsize = 0.5, - maxsize = 1, - collisiondetection = false, - vertical = false, - texture = "mcl_potions_sprite.png^[colorize:"..color..":127", - }) + amount = 1, + time = 1, + minpos = {x=pos.x-d, y=pos.y+1, z=pos.z-d}, + maxpos = {x=pos.x+d, y=pos.y+2, z=pos.z+d}, + minvel = {x=-0.1, y=0, z=-0.1}, + maxvel = {x=0.1, y=0.1, z=0.1}, + minacc = {x=-0.1, y=0, z=-0.1}, + maxacc = {x=0.1, y=.1, z=0.1}, + minexptime = 0.5, + maxexptime = 1, + minsize = 0.5, + maxsize = 1, + collisiondetection = false, + vertical = false, + texture = "mcl_potions_sprite.png^[colorize:"..color..":127", + }) end @@ -633,7 +642,9 @@ end function mcl_potions.swiftness_func(player, factor, duration) - if not player:get_meta() then return false end + if not player:get_meta() then + return false + end if not is_swift[player] then @@ -654,7 +665,9 @@ end function mcl_potions.leaping_func(player, factor, duration) - if not player:get_meta() then return false end + if not player:get_meta() then + return false + end if not is_leaping[player] then diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 045664b63..a712005e7 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -296,14 +296,14 @@ end mcl_potions.register_splash("water", S("Splash Water Bottle"), "#0022FF", { tt=S("Extinguishes fire and hurts some mobs"), - longdesc=S("A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water."), + longdesc=S("A throwable water bottle that will shatter on impact, where it extinguishes nearby fire and hurts mobs that are vulnerable to water."), no_effect=true, potion_fun=water_splash, effect=1 }) mcl_potions.register_lingering("water", S("Lingering Water Bottle"), "#0022FF", { tt=S("Extinguishes fire and hurts some mobs"), - longdesc=S("A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water."), + longdesc=S("A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water."), no_effect=true, potion_fun=water_splash, effect=1 @@ -366,23 +366,23 @@ local extension_table = {} local potions = {} for i, potion in ipairs({"healing","harming","swiftness","slowness", - "leaping","poison","regeneration","invisibility","fire_resistance", - -- "weakness","strength", - "water_breathing","night_vision"}) do + "leaping","poison","regeneration","invisibility","fire_resistance", + -- "weakness","strength", + "water_breathing","night_vision"}) do - table.insert(potions, potion) + table.insert(potions, potion) - if potion ~= "invisibility" and potion ~= "night_vision" and potion ~= "weakness" and potion ~= "water_breathing" and potion ~= "fire_resistance" then - enhancement_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_2" - enhancement_table["mcl_potions:"..potion.."_splash"] = "mcl_potions:"..potion.."_2_splash" - table.insert(potions, potion.."_2") - end + if potion ~= "invisibility" and potion ~= "night_vision" and potion ~= "weakness" and potion ~= "water_breathing" and potion ~= "fire_resistance" then + enhancement_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_2" + enhancement_table["mcl_potions:"..potion.."_splash"] = "mcl_potions:"..potion.."_2_splash" + table.insert(potions, potion.."_2") + end - if potion ~= "healing" and potion ~= "harming" then - extension_table["mcl_potions:"..potion.."_splash"] = "mcl_potions:"..potion.."_plus_splash" - extension_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_plus" - table.insert(potions, potion.."_plus") - end + if potion ~= "healing" and potion ~= "harming" then + extension_table["mcl_potions:"..potion.."_splash"] = "mcl_potions:"..potion.."_plus_splash" + extension_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_plus" + table.insert(potions, potion.."_plus") + end end @@ -419,7 +419,7 @@ local splash_table = {} local lingering_table = {} for i, potion in ipairs(potions) do - splash_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_splash" + splash_table["mcl_potions:"..potion] = "mcl_potions:"..potion.."_splash" lingering_table["mcl_potions:"..potion.."_splash"] = "mcl_potions:"..potion.."_lingering" end diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index 57141ea89..c74143233 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -71,7 +71,9 @@ minetest.register_globalstep(function(dtime) end end - if vals.timer <= 0 then lingering_effect_at[pos] = nil end + if vals.timer <= 0 then + lingering_effect_at[pos] = nil + end end lingering_timer = 0 @@ -82,93 +84,93 @@ end) function mcl_potions.register_lingering(name, descr, color, def) - local id = "mcl_potions:"..name.."_lingering" - local longdesc = def.longdesc - if not def.no_effect then - longdesc = S("A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.") - if def.longdesc then - longdesc = longdesc .. "\n" .. def.longdesc - end - end - minetest.register_craftitem(id, { - description = descr, - _tt_help = def.tt, - _doc_items_longdesc = longdesc, - _doc_items_usagehelp = S("Use the “Punch” key to throw it."), - inventory_image = lingering_image(color), - groups = {brewitem=1, not_in_creative_inventory=0}, - on_use = function(item, placer, pointed_thing) - local velocity = 10 - local dir = placer:get_look_dir(); - local pos = placer:getpos(); - local obj = minetest.add_entity({x=pos.x+dir.x,y=pos.y+2+dir.y,z=pos.z+dir.z}, id.."_flying") - obj:setvelocity({x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}) - obj:setacceleration({x=dir.x*-3, y=-9.8, z=dir.z*-3}) - obj:get_luaentity()._thrower = placer:get_player_name() - if not minetest.is_creative_enabled(placer:get_player_name()) then - item:take_item() - end - return item - end, - stack_max = 1, - _on_dispense = function(stack, dispenserpos, droppos, dropnode, dropdir) - local s_pos = vector.add(dispenserpos, vector.multiply(dropdir, 0.51)) - local obj = minetest.add_entity({x=s_pos.x+dropdir.x,y=s_pos.y+dropdir.y,z=s_pos.z+dropdir.z}, id.."_flying") - local velocity = 22 - obj:set_velocity({x=dropdir.x*velocity,y=dropdir.y*velocity,z=dropdir.z*velocity}) - obj:set_acceleration({x=dropdir.x*-3, y=-9.8, z=dropdir.z*-3}) + local id = "mcl_potions:"..name.."_lingering" + local longdesc = def.longdesc + if not def.no_effect then + longdesc = S("A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.") + if def.longdesc then + longdesc = longdesc .. "\n" .. def.longdesc end - }) + end + minetest.register_craftitem(id, { + description = descr, + _tt_help = def.tt, + _doc_items_longdesc = longdesc, + _doc_items_usagehelp = S("Use the “Punch” key to throw it."), + inventory_image = lingering_image(color), + groups = {brewitem=1, not_in_creative_inventory=0}, + on_use = function(item, placer, pointed_thing) + local velocity = 10 + local dir = placer:get_look_dir(); + local pos = placer:getpos(); + local obj = minetest.add_entity({x=pos.x+dir.x,y=pos.y+2+dir.y,z=pos.z+dir.z}, id.."_flying") + obj:setvelocity({x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}) + obj:setacceleration({x=dir.x*-3, y=-9.8, z=dir.z*-3}) + obj:get_luaentity()._thrower = placer:get_player_name() + if not minetest.is_creative_enabled(placer:get_player_name()) then + item:take_item() + end + return item + end, + stack_max = 1, + _on_dispense = function(stack, dispenserpos, droppos, dropnode, dropdir) + local s_pos = vector.add(dispenserpos, vector.multiply(dropdir, 0.51)) + local obj = minetest.add_entity({x=s_pos.x+dropdir.x,y=s_pos.y+dropdir.y,z=s_pos.z+dropdir.z}, id.."_flying") + local velocity = 22 + obj:set_velocity({x=dropdir.x*velocity,y=dropdir.y*velocity,z=dropdir.z*velocity}) + obj:set_acceleration({x=dropdir.x*-3, y=-9.8, z=dropdir.z*-3}) + end +}) - local w = 0.7 +local w = 0.7 - minetest.register_entity(id.."_flying",{ - textures = {lingering_image(color)}, - hp_max = 1, - visual_size = {x=w/2,y=w/2}, - collisionbox = {-0.1,-0.1,-0.1,0.1,0.1,0.1}, - pointable = false, - on_step = function(self, dtime) - local pos = self.object:get_pos() - local node = minetest.get_node(pos) - local n = node.name - local g = minetest.get_node_group(n, "liquid") - local d = 4 - if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then - minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) - add_lingering_effect(pos, color, def, name == "water") - local texture, minacc, maxacc - if name == "water" then - texture = "mcl_potions_droplet.png" - minacc = {x=-0.2, y=-0.05, z=-0.2} - maxacc = {x=0.2, y=0.05, z=0.2} - else - texture = "mcl_potions_sprite.png" - minacc = {x=-0.2, y=0, z=-0.2} - maxacc = {x=0.2, y=.05, z=0.2} - end - minetest.add_particlespawner({ - amount = 40, - time = 1, - minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, - maxpos = {x=pos.x+d, y=pos.y+1, z=pos.z+d}, - minvel = {x=-0.5, y=0, z=-0.5}, - maxvel = {x=0.5, y=0.5, z=0.5}, - minacc = minacc, - maxacc = maxacc, - minexptime = 1, - maxexptime = 2, - minsize = 1, - maxsize = 2, - collisiondetection = true, - vertical = false, - texture = texture.."^[colorize:"..color..":127", - }) - if name == "water" then - mcl_potions._extinguish_nearby_fire(pos, d) - end - self.object:remove() - end - end, - }) +minetest.register_entity(id.."_flying",{ + textures = {lingering_image(color)}, + hp_max = 1, + visual_size = {x=w/2,y=w/2}, + collisionbox = {-0.1,-0.1,-0.1,0.1,0.1,0.1}, + pointable = false, + on_step = function(self, dtime) + local pos = self.object:get_pos() + local node = minetest.get_node(pos) + local n = node.name + local g = minetest.get_node_group(n, "liquid") + local d = 4 + if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then + minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) + add_lingering_effect(pos, color, def, name == "water") + local texture, minacc, maxacc + if name == "water" then + texture = "mcl_potions_droplet.png" + minacc = {x=-0.2, y=-0.05, z=-0.2} + maxacc = {x=0.2, y=0.05, z=0.2} + else + texture = "mcl_potions_sprite.png" + minacc = {x=-0.2, y=0, z=-0.2} + maxacc = {x=0.2, y=.05, z=0.2} + end + minetest.add_particlespawner({ + amount = 40, + time = 1, + minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, + maxpos = {x=pos.x+d, y=pos.y+1, z=pos.z+d}, + minvel = {x=-0.5, y=0, z=-0.5}, + maxvel = {x=0.5, y=0.5, z=0.5}, + minacc = minacc, + maxacc = maxacc, + minexptime = 1, + maxexptime = 2, + minsize = 1, + maxsize = 2, + collisiondetection = true, + vertical = false, + texture = texture.."^[colorize:"..color..":127", + }) + if name == "water" then + mcl_potions._extinguish_nearby_fire(pos, d) + end + self.object:remove() + end + end, +}) end diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 4664cec5c..a226ad719 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -12,7 +12,9 @@ local how_to_drink = S("Use the “Place” key to drink it.") local potion_intro = S("Drinking a potion gives you a particular effect.") local function time_string(dur) - if not dur then return nil end + if not dur then + return nil + end return math.floor(dur/60)..string.format(":%02d",math.floor(dur % 60)) end local function perc_string(num) @@ -55,12 +57,14 @@ local function register_potion(def) end local on_use = function (itemstack, user, pointed_thing) - if not def.on_use then return end - def.on_use(user, def.effect, dur) - minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) - mcl_potions._use_potion(itemstack, user, def.color) - return itemstack - end + if not def.on_use then + return + end + def.on_use(user, def.effect, dur) + minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) + mcl_potions._use_potion(itemstack, user, def.color) + return itemstack + end local function get_tt(tt, effect, dur) local _tt @@ -121,7 +125,7 @@ local function register_potion(def) if not def.no_effect then potion_longdesc = potion_intro .. "\n" .. def._longdesc end - local potion_usagehelp + local potion_usagehelp local basic_potion_tt if def.name ~= "dragon_breath" then potion_usagehelp = how_to_drink @@ -218,11 +222,11 @@ local function register_potion(def) end local on_use = function (itemstack, user, pointed_thing) - def.on_use(user, effect_II, dur_2) - minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) - mcl_potions._use_potion(itemstack, user, def.color) - return itemstack - end + def.on_use(user, effect_II, dur_2) + minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) + mcl_potions._use_potion(itemstack, user, def.color) + return itemstack + end minetest.register_craftitem("mcl_potions:"..def.name.."_2", { description = S("@1 Potion@2", def.description, desc_mod), @@ -301,11 +305,11 @@ local function register_potion(def) end local on_use = function (itemstack, user, pointed_thing) - def.on_use(user, def.effect, dur_pl) - minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) - mcl_potions._use_potion(itemstack, user, def.color) - return itemstack - end + def.on_use(user, def.effect, dur_pl) + minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) + mcl_potions._use_potion(itemstack, user, def.color) + return itemstack + end minetest.register_craftitem("mcl_potions:"..def.name.."_plus", { description = S("@1 + Potion", def.description), @@ -565,9 +569,9 @@ local fire_resistance_def = { local defs = { awkward_def, mundane_def, thick_def, dragon_breath_def, - healing_def, harming_def, night_vision_def, swiftness_def, - slowness_def, leaping_def, poison_def, regeneration_def, - invisibility_def, water_breathing_def, fire_resistance_def} + healing_def, harming_def, night_vision_def, swiftness_def, + slowness_def, leaping_def, poison_def, regeneration_def, + invisibility_def, water_breathing_def, fire_resistance_def} for _, def in ipairs(defs) do register_potion(def) diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 6fd761eea..2f7fbf77f 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -11,34 +11,34 @@ end function mcl_potions.register_splash(name, descr, color, def) - local id = "mcl_potions:"..name.."_splash" - local longdesc = def.longdesc - if not def.no_effect then - longdesc = S("A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.") - if def.longdesc then - longdesc = longdesc .. "\n" .. def.longdesc - end - end - minetest.register_craftitem(id, { - description = descr, + local id = "mcl_potions:"..name.."_splash" + local longdesc = def.longdesc + if not def.no_effect then + longdesc = S("A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.") + if def.longdesc then + longdesc = longdesc .. "\n" .. def.longdesc + end + end + minetest.register_craftitem(id, { + description = descr, _tt_help = def.tt, - _doc_items_longdesc = longdesc, - _doc_items_usagehelp = S("Use the “Punch” key to throw it."), - inventory_image = splash_image(color), + _doc_items_longdesc = longdesc, + _doc_items_usagehelp = S("Use the “Punch” key to throw it."), + inventory_image = splash_image(color), groups = {brewitem=1, not_in_creative_inventory=0}, - on_use = function(item, placer, pointed_thing) - local velocity = 10 - local dir = placer:get_look_dir(); - local pos = placer:get_pos(); - local obj = minetest.add_entity({x=pos.x+dir.x,y=pos.y+2+dir.y,z=pos.z+dir.z}, id.."_flying") - obj:set_velocity({x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}) - obj:set_acceleration({x=dir.x*-3, y=-9.8, z=dir.z*-3}) + on_use = function(item, placer, pointed_thing) + local velocity = 10 + local dir = placer:get_look_dir(); + local pos = placer:get_pos(); + local obj = minetest.add_entity({x=pos.x+dir.x,y=pos.y+2+dir.y,z=pos.z+dir.z}, id.."_flying") + obj:set_velocity({x=dir.x*velocity,y=dir.y*velocity,z=dir.z*velocity}) + obj:set_acceleration({x=dir.x*-3, y=-9.8, z=dir.z*-3}) obj:get_luaentity()._thrower = placer:get_player_name() if not minetest.is_creative_enabled(placer:get_player_name()) then item:take_item() end - return item - end, + return item + end, stack_max = 1, _on_dispense = function(stack, dispenserpos, droppos, dropnode, dropdir) local s_pos = vector.add(dispenserpos, vector.multiply(dropdir, 0.51)) @@ -47,70 +47,73 @@ function mcl_potions.register_splash(name, descr, color, def) obj:set_velocity({x=dropdir.x*velocity,y=dropdir.y*velocity,z=dropdir.z*velocity}) obj:set_acceleration({x=dropdir.x*-3, y=-9.8, z=dropdir.z*-3}) end - }) + }) - local w = 0.7 + local w = 0.7 - minetest.register_entity(id.."_flying",{ - textures = {splash_image(color)}, + minetest.register_entity(id.."_flying",{ + textures = {splash_image(color)}, hp_max = 1, visual_size = {x=w/2,y=w/2}, collisionbox = {-0.1,-0.1,-0.1,0.1,0.1,0.1}, pointable = false, - on_step = function(self, dtime) - local pos = self.object:get_pos() - local node = minetest.get_node(pos) - local n = node.name - local g = minetest.get_node_group(n, "liquid") - local d = 0.1 - local redux_map = {7/8,0.5,0.25} - if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then - minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) - local texture, acc - if name == "water" then - texture = "mcl_potions_droplet.png" - acc = {x=0, y=-GRAVITY, z=0} - else - texture = "mcl_potions_sprite.png" - acc = {x=0, y=0, z=0} - end - minetest.add_particlespawner({ - amount = 50, - time = 0.1, - minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, - maxpos = {x=pos.x+d, y=pos.y+0.5+d, z=pos.z+d}, - minvel = {x=-2, y=0, z=-2}, - maxvel = {x=2, y=2, z=2}, - minacc = acc, - maxacc = acc, - minexptime = 0.5, - maxexptime = 1.25, - minsize = 1, - maxsize = 2, - collisiondetection = true, - vertical = false, - texture = texture.."^[colorize:"..color..":127" - }) + on_step = function(self, dtime) + local pos = self.object:get_pos() + local node = minetest.get_node(pos) + local n = node.name + local g = minetest.get_node_group(n, "liquid") + local d = 0.1 + local redux_map = {7/8,0.5,0.25} + if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then + minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) + local texture, acc + if name == "water" then + texture = "mcl_potions_droplet.png" + acc = {x=0, y=-GRAVITY, z=0} + else + texture = "mcl_potions_sprite.png" + acc = {x=0, y=0, z=0} + end + minetest.add_particlespawner({ + amount = 50, + time = 0.1, + minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, + maxpos = {x=pos.x+d, y=pos.y+0.5+d, z=pos.z+d}, + minvel = {x=-2, y=0, z=-2}, + maxvel = {x=2, y=2, z=2}, + minacc = acc, + maxacc = acc, + minexptime = 0.5, + maxexptime = 1.25, + minsize = 1, + maxsize = 2, + collisiondetection = true, + vertical = false, + texture = texture.."^[colorize:"..color..":127" + }) if name == "water" then mcl_potions._extinguish_nearby_fire(pos) end - self.object:remove() - for _,obj in pairs(minetest.get_objects_inside_radius(pos, 4)) do + self.object:remove() + for _,obj in pairs(minetest.get_objects_inside_radius(pos, 4)) do - local entity = obj:get_luaentity() - if obj:is_player() or entity._cmi_is_mob then + local entity = obj:get_luaentity() + if obj:is_player() or entity._cmi_is_mob then - local pos2 = obj:get_pos() - local rad = math.floor(math.sqrt((pos2.x-pos.x)^2 + (pos2.y-pos.y)^2 + (pos2.z-pos.z)^2)) - if rad > 0 then def.potion_fun(obj, redux_map[rad]) else def.potion_fun(obj, 1) end - - end + local pos2 = obj:get_pos() + local rad = math.floor(math.sqrt((pos2.x-pos.x)^2 + (pos2.y-pos.y)^2 + (pos2.z-pos.z)^2)) + if rad > 0 then + def.potion_fun(obj, redux_map[rad]) + else + def.potion_fun(obj, 1) end - end - end, - }) + end + + end + end, + }) end local function time_string(dur) diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index f9bfa166e..31e7c1ddd 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -19,12 +19,11 @@ local function arrow_image(colorstring, opacity) opacity = 127 end return {"mcl_bows_arrow.png^[transformFX^(mcl_bows_arrow_overlay.png^[transformFX^[colorize:"..colorstring..":"..tostring(opacity)..")", - "mcl_bows_arrow.png^[transformFX^(mcl_bows_arrow_overlay.png^[transformFX^[colorize:"..colorstring..":"..tostring(opacity)..")", - "mcl_bows_arrow_back.png^[colorize:"..colorstring..":"..tostring(opacity), - "mcl_bows_arrow_front.png^[colorize:"..colorstring..":"..tostring(opacity), - "mcl_bows_arrow.png^(mcl_bows_arrow_overlay.png^[colorize:"..colorstring..":"..tostring(opacity)..")", - "mcl_bows_arrow.png^[transformFX^(mcl_bows_arrow_overlay.png^[transformFX^[colorize:"..colorstring..":"..tostring(opacity)..")"} - + "mcl_bows_arrow.png^[transformFX^(mcl_bows_arrow_overlay.png^[transformFX^[colorize:"..colorstring..":"..tostring(opacity)..")", + "mcl_bows_arrow_back.png^[colorize:"..colorstring..":"..tostring(opacity), + "mcl_bows_arrow_front.png^[colorize:"..colorstring..":"..tostring(opacity), + "mcl_bows_arrow.png^(mcl_bows_arrow_overlay.png^[colorize:"..colorstring..":"..tostring(opacity)..")", + "mcl_bows_arrow.png^[transformFX^(mcl_bows_arrow_overlay.png^[transformFX^[colorize:"..colorstring..":"..tostring(opacity)..")"} end local how_to_shoot = minetest.registered_items["mcl_bows:arrow"]._doc_items_usagehelp From aaa13878c1d7cbb612497eabe405f0ebb44c04e1 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 8 Aug 2020 10:14:37 +0200 Subject: [PATCH 066/152] Clean up the effect test command a little --- mods/ITEMS/mcl_potions/functions.lua | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index ad1cc9c55..79e9bf9b1 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mcl_potions") + local is_invisible = {} local is_poisoned = {} local is_regenerating = {} @@ -902,28 +904,33 @@ get_chat_function["leaping"] = mcl_potions.leaping_func get_chat_function["swiftness"] = mcl_potions.swiftness_func get_chat_function["heal"] = mcl_potions.healing_func -minetest.register_chatcommand("potion",{ - params = "", - description = "Set player potion effects -- arguments ", +minetest.register_chatcommand("effect",{ + params = S(" "), + description = S("Add a status effect to yourself. Arguments: : name of potion effect, e.g. poison. : effect strength multiplier (1 = 100%). : duration in seconds"), privs = {server = true}, func = function(name, params) - P = {} - i = 0 + local P = {} + local i = 0 for str in string.gmatch(params, "([^ ]+)") do i = i + 1 P[i] = str end - if not P[3] then - P[3] = P[2] + if not P[1] then + return false, S("Missing effect parameter!") + elseif not P[2] then + return false, S("Missing factor parameter!") + elseif not P[3] then + return false, S("Missing duration parameter!") end if get_chat_function[P[1]] then get_chat_function[P[1]](minetest.get_player_by_name(name), tonumber(P[2]), tonumber(P[3])) + return true else - minetest.chat_send_player(name, P[1].." is not an available potion effect. Use /help potion as needed.") + return false, S("@1 is not an available potion effect.", P[1]) end - end , + end, }) From db1cc2e0127067007c46ac7d1061afe5d0c577ba Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 8 Aug 2020 10:25:23 +0200 Subject: [PATCH 067/152] Effect command: Swap arguments --- mods/ITEMS/mcl_potions/functions.lua | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 79e9bf9b1..d9233c6d3 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -905,8 +905,8 @@ get_chat_function["swiftness"] = mcl_potions.swiftness_func get_chat_function["heal"] = mcl_potions.healing_func minetest.register_chatcommand("effect",{ - params = S(" "), - description = S("Add a status effect to yourself. Arguments: : name of potion effect, e.g. poison. : effect strength multiplier (1 = 100%). : duration in seconds"), + params = S(" []"), + description = S("Add a status effect to yourself. Arguments: : name of potion effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 = 100%)"), privs = {server = true}, func = function(name, params) @@ -919,14 +919,18 @@ minetest.register_chatcommand("effect",{ if not P[1] then return false, S("Missing effect parameter!") - elseif not P[2] then - return false, S("Missing factor parameter!") - elseif not P[3] then - return false, S("Missing duration parameter!") + elseif not tonumber(P[2]) then + return false, S("Missing or invalid duration parameter!") + elseif P[3] and not tonumber(P[3]) then + return false, S("Invalid factor parameter!") + end + -- Default factor = 1 + if not P[3] then + P[3] = 1.0 end if get_chat_function[P[1]] then - get_chat_function[P[1]](minetest.get_player_by_name(name), tonumber(P[2]), tonumber(P[3])) + get_chat_function[P[1]](minetest.get_player_by_name(name), tonumber(P[3]), tonumber(P[2])) return true else return false, S("@1 is not an available potion effect.", P[1]) From 9024c8084d5379f1264bb8747d98d94b2f8c4566 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 8 Aug 2020 17:48:03 -0400 Subject: [PATCH 068/152] Update how "on_use" is defined for potions. --- mods/ITEMS/mcl_potions/potions.lua | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index b7608bd8c..b9e0d253a 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -54,13 +54,19 @@ local function register_potion(def) dur = 45 end - local on_use = function (itemstack, user, pointed_thing) - if not def.on_use then return end - def.on_use(user, def.effect, dur) - minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) - mcl_potions._use_potion(itemstack, user, def.color) - return itemstack + local on_use = nil + + if def.on_use then + + on_use = function (itemstack, user, pointed_thing) + + def.on_use(user, def.effect, dur) + minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) + mcl_potions._use_potion(itemstack, user, def.color) + + return itemstack end + end local function get_tt(tt, effect, dur) local _tt From 5637701c4bf80cf229705e3c07d73679cda753a2 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 8 Aug 2020 17:51:39 -0400 Subject: [PATCH 069/152] Correct indentation --- mods/ITEMS/mcl_potions/potions.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index cc5304d3f..84a44deef 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -59,15 +59,14 @@ local function register_potion(def) local on_use = nil if def.on_use then - on_use = function (itemstack, user, pointed_thing) - def.on_use(user, def.effect, dur) - minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) - mcl_potions._use_potion(itemstack, user, def.color) + def.on_use(user, def.effect, dur) + minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) + mcl_potions._use_potion(itemstack, user, def.color) - return itemstack - end + return itemstack + end end local function get_tt(tt, effect, dur) From f4f976a7a544bc3e02a65c254102e9ca637adb84 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 10 Aug 2020 10:30:00 +0200 Subject: [PATCH 070/152] Fix potions ignoring on_rightclick of node/objects --- mods/ITEMS/mcl_potions/potions.lua | 46 +++++++++++++++++------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 84a44deef..3a5b513dd 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -45,6 +45,29 @@ end -- ╚═╝░░░░░░╚════╝░░░░╚═╝░░░╚═╝░╚════╝░╚═╝░░╚══╝╚═════╝░ +function return_on_use(def, effect, dur) + return function (itemstack, user, pointed_thing) + if pointed_thing.type == "node" then + if user and not user:get_player_control().sneak then + -- Use pointed node's on_rightclick function first, if present + local node = minetest.get_node(pointed_thing.under) + if user and not user:get_player_control().sneak then + if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then + return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, user, itemstack) or itemstack + end + end + end + elseif pointed_thing.type == "object" then + return itemstack + end + + def.on_use(user, effect, dur) + minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) + mcl_potions._use_potion(itemstack, user, def.color) + end +end + + local function register_potion(def) local dur = mcl_potions.DURATION @@ -59,14 +82,7 @@ local function register_potion(def) local on_use = nil if def.on_use then - on_use = function (itemstack, user, pointed_thing) - - def.on_use(user, def.effect, dur) - minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) - mcl_potions._use_potion(itemstack, user, def.color) - - return itemstack - end + on_use = return_on_use(def, def.effect, dur) end local function get_tt(tt, effect, dur) @@ -224,12 +240,7 @@ local function register_potion(def) desc_mod = S(" IV") end - local on_use = function (itemstack, user, pointed_thing) - def.on_use(user, effect_II, dur_2) - minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) - mcl_potions._use_potion(itemstack, user, def.color) - return itemstack - end + on_use = return_on_use(def, effect_II, dur_2) minetest.register_craftitem("mcl_potions:"..def.name.."_2", { description = S("@1 Potion@2", def.description, desc_mod), @@ -307,12 +318,7 @@ local function register_potion(def) dur_pl = 90 end - local on_use = function (itemstack, user, pointed_thing) - def.on_use(user, def.effect, dur_pl) - minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) - mcl_potions._use_potion(itemstack, user, def.color) - return itemstack - end + on_use = return_on_use(def, def.effect, dur_pl) minetest.register_craftitem("mcl_potions:"..def.name.."_plus", { description = S("@1 + Potion", def.description), From 2a7edbde49e1d1a9b5ae671ecf15ff95cdbaf3c4 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 10 Aug 2020 10:40:10 +0200 Subject: [PATCH 071/152] mcl_potions: Move command to own file --- mods/ITEMS/mcl_potions/commands.lua | 56 +++++++++++++++++++++++++++ mods/ITEMS/mcl_potions/functions.lua | 57 ---------------------------- mods/ITEMS/mcl_potions/init.lua | 1 + 3 files changed, 57 insertions(+), 57 deletions(-) create mode 100644 mods/ITEMS/mcl_potions/commands.lua diff --git a/mods/ITEMS/mcl_potions/commands.lua b/mods/ITEMS/mcl_potions/commands.lua new file mode 100644 index 000000000..4c38b394a --- /dev/null +++ b/mods/ITEMS/mcl_potions/commands.lua @@ -0,0 +1,56 @@ +local S = minetest.get_translator("mcl_potions") + +-- ░█████╗░██╗░░██╗░█████╗░████████╗  ░█████╗░░█████╗░███╗░░░███╗███╗░░░███╗░█████╗░███╗░░██╗██████╗░░██████╗ +-- ██╔══██╗██║░░██║██╔══██╗╚══██╔══╝  ██╔══██╗██╔══██╗████╗░████║████╗░████║██╔══██╗████╗░██║██╔══██╗██╔════╝ +-- ██║░░╚═╝███████║███████║░░░██║░░░  ██║░░╚═╝██║░░██║██╔████╔██║██╔████╔██║███████║██╔██╗██║██║░░██║╚█████╗░ +-- ██║░░██╗██╔══██║██╔══██║░░░██║░░░  ██║░░██╗██║░░██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚████║██║░░██║░╚═══██╗ +-- ╚█████╔╝██║░░██║██║░░██║░░░██║░░░  ╚█████╔╝╚█████╔╝██║░╚═╝░██║██║░╚═╝░██║██║░░██║██║░╚███║██████╔╝██████╔╝ +-- ░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░  ░╚════╝░░╚════╝░╚═╝░░░░░╚═╝╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═════╝░╚═════╝░ + + +local get_chat_function = {} + +get_chat_function["poison"] = mcl_potions.poison_func +get_chat_function["regeneration"] = mcl_potions.regeneration_func +get_chat_function["invisibility"] = mcl_potions.invisiblility_func +get_chat_function["fire_resistance"] = mcl_potions.fire_resistance_func +get_chat_function["night_vision"] = mcl_potions.night_vision_func +get_chat_function["water_breathing"] = mcl_potions.water_breathing_func +get_chat_function["leaping"] = mcl_potions.leaping_func +get_chat_function["swiftness"] = mcl_potions.swiftness_func +get_chat_function["heal"] = mcl_potions.healing_func + +minetest.register_chatcommand("effect",{ + params = S(" []"), + description = S("Add a status effect to yourself. Arguments: : name of potion effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 = 100%)"), + privs = {server = true}, + func = function(name, params) + + local P = {} + local i = 0 + for str in string.gmatch(params, "([^ ]+)") do + i = i + 1 + P[i] = str + end + + if not P[1] then + return false, S("Missing effect parameter!") + elseif not tonumber(P[2]) then + return false, S("Missing or invalid duration parameter!") + elseif P[3] and not tonumber(P[3]) then + return false, S("Invalid factor parameter!") + end + -- Default factor = 1 + if not P[3] then + P[3] = 1.0 + end + + if get_chat_function[P[1]] then + get_chat_function[P[1]](minetest.get_player_by_name(name), tonumber(P[3]), tonumber(P[2])) + return true + else + return false, S("@1 is not an available potion effect.", P[1]) + end + + end, +}) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index d9233c6d3..263427921 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -1,5 +1,3 @@ -local S = minetest.get_translator("mcl_potions") - local is_invisible = {} local is_poisoned = {} local is_regenerating = {} @@ -883,58 +881,3 @@ function mcl_potions._extinguish_nearby_fire(pos, radius) return exting end - --- ░█████╗░██╗░░██╗░█████╗░████████╗  ░█████╗░░█████╗░███╗░░░███╗███╗░░░███╗░█████╗░███╗░░██╗██████╗░░██████╗ --- ██╔══██╗██║░░██║██╔══██╗╚══██╔══╝  ██╔══██╗██╔══██╗████╗░████║████╗░████║██╔══██╗████╗░██║██╔══██╗██╔════╝ --- ██║░░╚═╝███████║███████║░░░██║░░░  ██║░░╚═╝██║░░██║██╔████╔██║██╔████╔██║███████║██╔██╗██║██║░░██║╚█████╗░ --- ██║░░██╗██╔══██║██╔══██║░░░██║░░░  ██║░░██╗██║░░██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚████║██║░░██║░╚═══██╗ --- ╚█████╔╝██║░░██║██║░░██║░░░██║░░░  ╚█████╔╝╚█████╔╝██║░╚═╝░██║██║░╚═╝░██║██║░░██║██║░╚███║██████╔╝██████╔╝ --- ░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░  ░╚════╝░░╚════╝░╚═╝░░░░░╚═╝╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═════╝░╚═════╝░ - - -local get_chat_function = {} - -get_chat_function["poison"] = mcl_potions.poison_func -get_chat_function["regeneration"] = mcl_potions.regeneration_func -get_chat_function["invisibility"] = mcl_potions.invisiblility_func -get_chat_function["fire_resistance"] = mcl_potions.fire_resistance_func -get_chat_function["night_vision"] = mcl_potions.night_vision_func -get_chat_function["water_breathing"] = mcl_potions.water_breathing_func -get_chat_function["leaping"] = mcl_potions.leaping_func -get_chat_function["swiftness"] = mcl_potions.swiftness_func -get_chat_function["heal"] = mcl_potions.healing_func - -minetest.register_chatcommand("effect",{ - params = S(" []"), - description = S("Add a status effect to yourself. Arguments: : name of potion effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 = 100%)"), - privs = {server = true}, - func = function(name, params) - - local P = {} - local i = 0 - for str in string.gmatch(params, "([^ ]+)") do - i = i + 1 - P[i] = str - end - - if not P[1] then - return false, S("Missing effect parameter!") - elseif not tonumber(P[2]) then - return false, S("Missing or invalid duration parameter!") - elseif P[3] and not tonumber(P[3]) then - return false, S("Invalid factor parameter!") - end - -- Default factor = 1 - if not P[3] then - P[3] = 1.0 - end - - if get_chat_function[P[1]] then - get_chat_function[P[1]](minetest.get_player_by_name(name), tonumber(P[3]), tonumber(P[2])) - return true - else - return false, S("@1 is not an available potion effect.", P[1]) - end - - end, -}) diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index a712005e7..1083b0c33 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -19,6 +19,7 @@ mcl_potions.LINGERING_FACTOR = 0.25 local modpath = minetest.get_modpath("mcl_potions") dofile(modpath .. "/functions.lua") +dofile(modpath .. "/commands.lua") dofile(modpath .. "/splash.lua") dofile(modpath .. "/lingering.lua") dofile(modpath .. "/tipped_arrow.lua") From 578fbf999e849d62f372459e4eca0dde5e352897 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 10 Aug 2020 10:44:57 +0200 Subject: [PATCH 072/152] Change word in command help --- mods/ITEMS/mcl_potions/commands.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_potions/commands.lua b/mods/ITEMS/mcl_potions/commands.lua index 4c38b394a..ad1d65b7f 100644 --- a/mods/ITEMS/mcl_potions/commands.lua +++ b/mods/ITEMS/mcl_potions/commands.lua @@ -22,7 +22,7 @@ get_chat_function["heal"] = mcl_potions.healing_func minetest.register_chatcommand("effect",{ params = S(" []"), - description = S("Add a status effect to yourself. Arguments: : name of potion effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 = 100%)"), + description = S("Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 = 100%)"), privs = {server = true}, func = function(name, params) @@ -49,7 +49,7 @@ minetest.register_chatcommand("effect",{ get_chat_function[P[1]](minetest.get_player_by_name(name), tonumber(P[3]), tonumber(P[2])) return true else - return false, S("@1 is not an available potion effect.", P[1]) + return false, S("@1 is not an available status effect.", P[1]) end end, From 8573dd69b7a7512cef23ceb3fa54c8195689e9f7 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 10 Aug 2020 10:47:42 +0200 Subject: [PATCH 073/152] Update mcl_potion translation templates --- .../mcl_potions/locale/mcl_potions.de.tr | 28 +++++++++++++------ .../mcl_potions/locale/mcl_potions.es.tr | 19 ++++++------- .../mcl_potions/locale/mcl_potions.fr.tr | 19 ++++++------- .../mcl_potions/locale/mcl_potions.ru.tr | 27 ++++++++++++------ mods/ITEMS/mcl_potions/locale/template.txt | 19 ++++++------- 5 files changed, 62 insertions(+), 50 deletions(-) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index 68ce919d6..938343341 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -1,4 +1,12 @@ # textdomain: mcl_potions + []= [] + +Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)=Ihnen einen Statuseffekt geben. Parameter: : Name des Statuseffekts, z.B. „poison”. : Dauer in Sekunden. : Effektstärkenmultiplikator (1 @= 100%) + +Missing effect parameter!=Fehlender Effektparameter! +Missing or invalid duration parameter!=Fehlender oder ungültiger Dauerparameter! +Invalid factor parameter!=Ungültiger Faktorparameter! +@1 is not an available status effect.=@1 ist kein verfügbarer Statuseffekt. Fermented Spider Eye=Fermentiertes Spinnenauge Glass Bottle=Glasflasche Liquid container=Flüssigkeitsbehälter @@ -26,18 +34,12 @@ Lingering Water Bottle=Verweilwasserflasche A throwable water bottle that will shatter on impact, where it creates a cloud of water vapor that lingers on the ground for a while. This cloud extinguishes fire and hurts mobs that are vulnerable to water.=Eine werfbare Wasserflasche, die beim Einschlag zerbrechen und eine Wolke aus Wasserdunst erzeugen wird, welche Feuer löscht und wasserempfindliche Mobs verletzt. - Glistering Melon=Glitzermelone This shiny melon is full of tiny gold nuggets and would be nice in an item frame. It isn't edible and not useful for anything else.=Diese glänzende Melone ist voller winziger Goldnuggets und sähe ganz nett in einem Rahmen aus. Er ist nicht essbar und auch sonst zu nichts zu gebrauchen. A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.=Ein werfbarer Trank, der bei Kollision zerbrechen wird, wo er eine magische Wolke erzeugt, die für eine gewisse Zeit verweilen wird. Jeder Spieler und jede Mob in der Wolke wird die Trankwirkung erhalten, möglicherweise mehrmals. -Lingering Weakness Potion=Schwächeverweiltrank -Lingering Weakness Potion +=Schwächeverweiltrank + -Lingering Strength Potion=Stärkeverweiltrank -Lingering Strength Potion II=Stärkeverweiltrank II -Lingering Strength Potion +=Stärkeverweiltrank + Use the “Punch” key to throw it.=Benutzen Sie die „Schlagen“-Taste zum Werfen. Use the “Place” key to drink it.=Benutzen Sie die „Platzieren“-Taste zum Trinken. Drinking a potion gives you a particular effect.=Das Trinken eines Tranks gibt Ihnen einen bestimmten Effekt. @@ -109,11 +111,19 @@ No effect=Keine Wirkung A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.=Ein werfbarer Trank, der bei Kollision zerbrechen wird, wo er allen nahen Spielern und Mobs einen Statuseffekt geben wird. +This particular arrow is tipped and will give an effect when it hits a player or mob.=Diese Pfeilspitze dieses Pfeils in einem Trank getränkt und gibt einen Effekt, wenn er einen Spieler oder einen Mob trifft. + + + +##### not used anymore ##### + +Lingering Weakness Potion=Schwächeverweiltrank +Lingering Weakness Potion +=Schwächeverweiltrank + +Lingering Strength Potion=Stärkeverweiltrank +Lingering Strength Potion II=Stärkeverweiltrank II +Lingering Strength Potion +=Stärkeverweiltrank + Weakness Splash Potion=Schwächewurftrank Weakness Splash Potion +=Schwächewurftrank + Strength Splash Potion=Stärkewurftrank Strength Splash Potion II=Stärkewurftrank II Strength Splash Potion +=Stärkewurftrank + - -This particular arrow is tipped and will give an effect when it hits a player or mob.=Diese Pfeilspitze dieses Pfeils in einem Trank getränkt und gibt einen Effekt, wenn er einen Spieler oder einen Mob trifft. - diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr index 5a03a6f9d..27a2cc04b 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr @@ -1,4 +1,12 @@ # textdomain: mcl_potions + []= + +Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)= + +Missing effect parameter!= +Missing or invalid duration parameter!= +Invalid factor parameter!= +@1 is not an available status effect.= Fermented Spider Eye=Ojo de araña fermentado Glass Bottle=Frasco de cristal Liquid container= @@ -32,11 +40,6 @@ This shiny melon is full of tiny gold nuggets and would be nice in an item frame A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= -Lingering Weakness Potion= -Lingering Weakness Potion += -Lingering Strength Potion= -Lingering Strength Potion II= -Lingering Strength Potion += Use the “Punch” key to throw it.= Use the “Place” key to drink it.=Use la tecla "Colocar" para beberlo. Drinking a potion gives you a particular effect.= @@ -108,11 +111,5 @@ No effect= A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= -Weakness Splash Potion= -Weakness Splash Potion += -Strength Splash Potion= -Strength Splash Potion II= -Strength Splash Potion += - This particular arrow is tipped and will give an effect when it hits a player or mob.= diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr index d1ea0f9a6..69c61493a 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr @@ -1,4 +1,12 @@ # textdomain: mcl_potions + []= + +Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)= + +Missing effect parameter!= +Missing or invalid duration parameter!= +Invalid factor parameter!= +@1 is not an available status effect.= Fermented Spider Eye=Oeil d'araignée fermenté Glass Bottle=Bouteille en verre Liquid container=Récipient de liquide @@ -32,11 +40,6 @@ This shiny melon is full of tiny gold nuggets and would be nice in an item frame A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= -Lingering Weakness Potion= -Lingering Weakness Potion += -Lingering Strength Potion= -Lingering Strength Potion II= -Lingering Strength Potion += Use the “Punch” key to throw it.= Use the “Place” key to drink it.=Utilisez la touche "Utiliser" pour le boire. Drinking a potion gives you a particular effect.= @@ -108,11 +111,5 @@ No effect=Aucun effet A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= -Weakness Splash Potion= -Weakness Splash Potion += -Strength Splash Potion= -Strength Splash Potion II= -Strength Splash Potion += - This particular arrow is tipped and will give an effect when it hits a player or mob.= diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr index 150d5e396..d010f4a27 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr @@ -1,4 +1,12 @@ # textdomain: mcl_potions + []= + +Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)= + +Missing effect parameter!= +Missing or invalid duration parameter!= +Invalid factor parameter!= +@1 is not an available status effect.= Fermented Spider Eye=Прокисший паучий глаз Glass Bottle=Стеклянная бутылка Liquid container=Контейнер для жидкостей @@ -32,11 +40,6 @@ This shiny melon is full of tiny gold nuggets and would be nice in an item frame A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.=Зелье, которое можно метать. При ударе оно разбивается, создавая волшебное облако, которое задерживается на некоторое время. Любой игрок или моб внутри облака получит эффект зелья, возможно, неоднократно. -Lingering Weakness Potion=Оседающее зелье слабости -Lingering Weakness Potion +=Оседающее зелье слабости + -Lingering Strength Potion=Оседающее зелье силы -Lingering Strength Potion II=Оседающее зелье силы II -Lingering Strength Potion +=Оседающее зелье силы + Use the “Punch” key to throw it.=Нажмите [Ударить] для метания. Use the “Place” key to drink it.=Нажмите [Разместить] для выпивания. Drinking a potion gives you a particular effect.=Выпивание зелья даёт вам особый эффект. @@ -108,11 +111,19 @@ No effect=Не оказывает эффекта A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.=Зелье, которое можно метать. Оно разбивается при ударе и он дает всем ближайшим игрокам и мобам эффект статуса. +This particular arrow is tipped and will give an effect when it hits a player or mob.=Эта необычная стрела с обработанным наконечником даёт эффект при попадании в игрока или моба. + + + +##### not used anymore ##### + +Lingering Weakness Potion=Оседающее зелье слабости +Lingering Weakness Potion +=Оседающее зелье слабости + +Lingering Strength Potion=Оседающее зелье силы +Lingering Strength Potion II=Оседающее зелье силы II +Lingering Strength Potion +=Оседающее зелье силы + Weakness Splash Potion=Взрывающееся зелье слабости Weakness Splash Potion +=Взрывающееся зелье слабости + Strength Splash Potion=Взрывающееся зелье силы Strength Splash Potion II=Взрывающееся зелье силы II Strength Splash Potion +=Взрывающееся зелье силы + - -This particular arrow is tipped and will give an effect when it hits a player or mob.=Эта необычная стрела с обработанным наконечником даёт эффект при попадании в игрока или моба. - diff --git a/mods/ITEMS/mcl_potions/locale/template.txt b/mods/ITEMS/mcl_potions/locale/template.txt index 99f48a01f..fda4a36c8 100644 --- a/mods/ITEMS/mcl_potions/locale/template.txt +++ b/mods/ITEMS/mcl_potions/locale/template.txt @@ -1,4 +1,12 @@ # textdomain: mcl_potions + []= + +Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)= + +Missing effect parameter!= +Missing or invalid duration parameter!= +Invalid factor parameter!= +@1 is not an available status effect.= Fermented Spider Eye= Glass Bottle= Liquid container= @@ -32,11 +40,6 @@ This shiny melon is full of tiny gold nuggets and would be nice in an item frame A throwable potion that will shatter on impact, where it creates a magic cloud that lingers around for a while. Any player or mob inside the cloud will receive the potion's effect, possibly repeatedly.= -Lingering Weakness Potion= -Lingering Weakness Potion += -Lingering Strength Potion= -Lingering Strength Potion II= -Lingering Strength Potion += Use the “Punch” key to throw it.= Use the “Place” key to drink it.= Drinking a potion gives you a particular effect.= @@ -108,11 +111,5 @@ No effect= A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.= -Weakness Splash Potion= -Weakness Splash Potion += -Strength Splash Potion= -Strength Splash Potion II= -Strength Splash Potion += - This particular arrow is tipped and will give an effect when it hits a player or mob.= From 89b294f8c151fff5011c4d01f8896dc1ea91bdae Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 10 Aug 2020 10:50:48 +0200 Subject: [PATCH 074/152] Fix typo in translation --- mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index 938343341..15ad88fc1 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -1,7 +1,7 @@ # textdomain: mcl_potions []= [] -Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)=Ihnen einen Statuseffekt geben. Parameter: : Name des Statuseffekts, z.B. „poison”. : Dauer in Sekunden. : Effektstärkenmultiplikator (1 @= 100%) +Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)=Ihnen einen Statuseffekt geben. Parameter: : Name des Statuseffekts, z.B. „poison“. : Dauer in Sekunden. : Effektstärkenmultiplikator (1 @= 100%) Missing effect parameter!=Fehlender Effektparameter! Missing or invalid duration parameter!=Fehlender oder ungültiger Dauerparameter! From c424b036b2876769e6f48be4f5af5668d1161ec4 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 10 Aug 2020 16:30:55 +0400 Subject: [PATCH 075/152] Fix furnaces timing when you leave them or skip the nights, https://git.minetest.land/Wuzzy/MineClone2/issues/533 --- mods/ITEMS/mcl_furnaces/init.lua | 213 ++++++++++++++++++++----------- 1 file changed, 135 insertions(+), 78 deletions(-) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index c76b379e6..cb797ff91 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -153,11 +153,52 @@ local function swap_node(pos, name) minetest.swap_node(pos, node) end +local function furnace_reset_delta_time(pos) + local meta = minetest.get_meta(pos) + local time_multiplier = 86400 / (minetest.settings:get('time_speed') or 72) + local current_game_time = .0 + ((minetest.get_day_count() + minetest.get_timeofday()) * time_multiplier) + + -- TODO: Change meta:get/set_string() to get/set_float() for 'last_gametime'. + -- In Windows *_float() works OK but under Linux it returns rounded unusable values like 449540.000000000 + local last_game_time = meta:get_string("last_gametime") + if last_game_time then + last_game_time = tonumber(last_game_time) + end + if not last_game_time or last_game_time < 1 or math.abs(last_game_time - current_game_time) <= 1.5 then + return + end + + meta:set_string("last_gametime", tostring(current_game_time)) +end + +local function furnace_get_delta_time(pos) + local meta = minetest.get_meta(pos) + local time_multiplier = 86400 / (minetest.settings:get('time_speed') or 72) + local current_game_time = .0 + ((minetest.get_day_count() + minetest.get_timeofday()) * time_multiplier) + + local last_game_time = meta:get_string("last_gametime") + if last_game_time then + last_game_time = tonumber(last_game_time) + end + if not last_game_time or last_game_time < 1 then + last_game_time = current_game_time + elseif last_game_time == current_game_time then + current_game_time = current_game_time + 1.0 + end + + local elapsed_game_time = .0 + current_game_time - last_game_time + + meta:set_string("last_gametime", tostring(current_game_time)) + + return meta, elapsed_game_time +end + local function furnace_node_timer(pos, elapsed) -- -- Inizialize metadata -- - local meta = minetest.get_meta(pos) + local meta, elapsed_game_time = furnace_get_delta_time(pos) + local fuel_time = meta:get_float("fuel_time") or 0 local src_time = meta:get_float("src_time") or 0 local src_item = meta:get_string("src_item") or "" @@ -167,98 +208,101 @@ local function furnace_node_timer(pos, elapsed) local srclist, fuellist local cookable, cooked + local active local fuel + srclist = inv:get_list("src") + fuellist = inv:get_list("fuel") + + -- Check if src item has been changed + if srclist[1]:get_name() ~= src_item then + -- Reset cooking progress in this case + src_time = 0 + src_item = srclist[1]:get_name() + end + local update = true - while update do - update = false - - srclist = inv:get_list("src") - fuellist = inv:get_list("fuel") - + while elapsed_game_time > 0.00001 and update do -- -- Cooking -- - -- Check if we have cookable content + local el = elapsed_game_time + + -- Check if we have cookable content: cookable local aftercooked cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) cookable = cooked.time ~= 0 - - -- Check if src item has been changed - if srclist[1]:get_name() ~= src_item then - -- Reset cooking progress in this case - src_time = 0 - src_item = srclist[1]:get_name() - update = true - - -- Check if we have enough fuel to burn - elseif fuel_time < fuel_totaltime then - -- The furnace is currently active and has enough fuel - fuel_time = fuel_time + elapsed - -- If there is a cookable item then check if it is ready yet - if cookable then - -- Successful cooking requires space in dst slot and time - if inv:room_for_item("dst", cooked.item) then - src_time = src_time + elapsed - - -- Place result in dst list if done - if src_time >= cooked.time then - inv:add_item("dst", cooked.item) - inv:set_stack("src", 1, aftercooked.items[1]) - - -- Unique recipe: Pour water into empty bucket after cooking wet sponge successfully - if inv:get_stack("fuel", 1):get_name() == "mcl_buckets:bucket_empty" then - if srclist[1]:get_name() == "mcl_sponges:sponge_wet" then - inv:set_stack("fuel", 1, "mcl_buckets:bucket_water") - -- Also for river water - elseif srclist[1]:get_name() == "mcl_sponges:sponge_wet_river_water" then - inv:set_stack("fuel", 1, "mcl_buckets:bucket_river_water") - end - end - - src_time = 0 - update = true - end - elseif src_time ~= 0 then - -- If output slot is occupied, stop cooking - src_time = 0 - update = true - end + if cookable then + -- Successful cooking requires space in dst slot and time + if not inv:room_for_item("dst", cooked.item) then + cookable = false end - else - -- Furnace ran out of fuel - if cookable then - -- We need to get new fuel - local afterfuel - fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) - - if fuel.time == 0 then - -- No valid fuel in fuel list - fuel_totaltime = 0 - src_time = 0 - else - -- Take fuel from fuel list - inv:set_stack("fuel", 1, afterfuel.items[1]) - update = true - fuel_totaltime = fuel.time + (fuel_time - fuel_totaltime) - src_time = src_time + elapsed - end - else - -- We don't need to get new fuel since there is no cookable item - fuel_totaltime = 0 - src_time = 0 - end - fuel_time = 0 end - elapsed = 0 + if cookable then -- fuel lasts long enough, adjust el to cooking duration + el = math.min(el, cooked.time - src_time) + end + + -- Check if we have enough fuel to burn + active = fuel_time < fuel_totaltime + if cookable and not active then + -- We need to get new fuel + local afterfuel + fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) + + if fuel.time == 0 then + -- No valid fuel in fuel list -- stop + fuel_totaltime = 0 + src_time = 0 + update = false + else + -- Take fuel from fuel list + inv:set_stack("fuel", 1, afterfuel.items[1]) + fuel_time = 0 + fuel_totaltime = fuel.time + el = math.min(el, fuel_totaltime) + active = true + fuellist = inv:get_list("fuel") + end + elseif active then + el = math.min(el, fuel_totaltime - fuel_time) + -- The furnace is currently active and has enough fuel + fuel_time = fuel_time + el + end + + -- If there is a cookable item then check if it is ready yet + if cookable and active then + src_time = src_time + el + -- Place result in dst list if done + if src_time >= cooked.time then + inv:add_item("dst", cooked.item) + inv:set_stack("src", 1, aftercooked.items[1]) + + -- Unique recipe: Pour water into empty bucket after cooking wet sponge successfully + if inv:get_stack("fuel", 1):get_name() == "mcl_buckets:bucket_empty" then + if srclist[1]:get_name() == "mcl_sponges:sponge_wet" then + inv:set_stack("fuel", 1, "mcl_buckets:bucket_water") + fuellist = inv:get_list("fuel") + -- Also for river water + elseif srclist[1]:get_name() == "mcl_sponges:sponge_wet_river_water" then + inv:set_stack("fuel", 1, "mcl_buckets:bucket_river_water") + fuellist = inv:get_list("fuel") + end + end + + srclist = inv:get_list("src") + src_time = 0 + end + end + + elapsed_game_time = elapsed_game_time - el end if fuel and fuel_totaltime > fuel.time then fuel_totaltime = fuel.time end - if srclist[1]:is_empty() then + if srclist and srclist[1]:is_empty() then src_time = 0 end @@ -274,7 +318,7 @@ local function furnace_node_timer(pos, elapsed) local result = false - if fuel_totaltime ~= 0 then + if active then local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) formspec = active_formspec(fuel_percent, item_percent) swap_node(pos, "mcl_furnaces:furnace_active") @@ -292,7 +336,11 @@ local function furnace_node_timer(pos, elapsed) meta:set_float("fuel_totaltime", fuel_totaltime) meta:set_float("fuel_time", fuel_time) meta:set_float("src_time", src_time) - meta:set_string("src_item", srclist[1]:get_name()) + if srclist then + meta:set_string("src_item", srclist[1]:get_name()) + else + meta:set_string("src_item", "") + end meta:set_string("formspec", formspec) return result @@ -347,17 +395,26 @@ minetest.register_node("mcl_furnaces:furnace", { end, on_metadata_inventory_move = function(pos) + -- Reset accumulated game time when player works with furnace: + furnace_reset_delta_time(pos) minetest.get_node_timer(pos):start(1.0) end, on_metadata_inventory_put = function(pos) + -- Reset accumulated game time when player works with furnace: + furnace_reset_delta_time(pos) -- start timer function, it will sort out whether furnace can burn or not. minetest.get_node_timer(pos):start(1.0) end, + on_metadata_inventory_take = function(pos) + -- Reset accumulated game time when player works with furnace: + furnace_reset_delta_time(pos) + -- start timer function, it will helpful if player clears dst slot + minetest.get_node_timer(pos):start(1.0) + end, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_move = allow_metadata_inventory_move, allow_metadata_inventory_take = allow_metadata_inventory_take, - on_metadata_inventory_take = on_metadata_inventory_take, on_receive_fields = receive_fields, _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, From 9537eaead0456ee951be6843e89470c4d5b97511 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 10 Aug 2020 22:04:27 +0400 Subject: [PATCH 076/152] Protect from explosions --- mods/CORE/mcl_explosions/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index 242f0518b..84f3322df 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -195,7 +195,7 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance, fire, break end - if cid ~= minetest.CONTENT_AIR then + if cid ~= minetest.CONTENT_AIR and not minetest.is_protected({x = npos_x, y = npos_y, z = npos_z}, "") then destroy[hash] = idx end end From b8caa2581f14be47037392b5749e47ef4c002dd9 Mon Sep 17 00:00:00 2001 From: kay27 Date: Tue, 11 Aug 2020 01:59:58 +0400 Subject: [PATCH 077/152] Update Russian translation of Brewing --- .../mcl_inventory/locale/mcl_inventory.ru.tr | 2 +- .../mcl_potions/locale/mcl_potions.ru.tr | 54 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/mods/HUD/mcl_inventory/locale/mcl_inventory.ru.tr b/mods/HUD/mcl_inventory/locale/mcl_inventory.ru.tr index ab1c9a420..d378e168b 100644 --- a/mods/HUD/mcl_inventory/locale/mcl_inventory.ru.tr +++ b/mods/HUD/mcl_inventory/locale/mcl_inventory.ru.tr @@ -7,7 +7,7 @@ Building Blocks=Строительные блоки Decoration Blocks=Декоративные блоки Redstone=Редстоун (красный камень) Transportation=Транспорт -Brewing= +Brewing=Зелья Miscellaneous=Прочее Search Items=Искать предметы Foodstuffs=Продовольствие diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr index d010f4a27..6a1d78c6e 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr @@ -1,12 +1,12 @@ # textdomain: mcl_potions - []= + []=<эффект> <длительность> [<фактор>] -Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)= +Add a status effect to yourself. Arguments: : name of status effect, e.g. poison. : duration in seconds. : effect strength multiplier (1 @= 100%)=Добавляет вам эффект состояния. Параметры: <эффект> - название эффекта состояния, например, poison (отравление). <Длительность> - длительность в секундах. <Фактор> - коэффициент силы эффекта (1 @= 100%) -Missing effect parameter!= -Missing or invalid duration parameter!= -Invalid factor parameter!= -@1 is not an available status effect.= +Missing effect parameter!=Отсутствует параметр эффекта! +Missing or invalid duration parameter!=Отсутствует либо неправильно задан параметр длительности! +Invalid factor parameter!=Отсутствует параметр фактора! +@1 is not an available status effect.=@1 не является допустимым эффектом состояния. Fermented Spider Eye=Прокисший паучий глаз Glass Bottle=Стеклянная бутылка Liquid container=Контейнер для жидкостей @@ -46,19 +46,19 @@ Drinking a potion gives you a particular effect.=Выпивание зелья 1 HP/@1s | @2=1 HP/@1с | @2 @1 HP=@1 HP @1 Potion=Зелье @1 -Splash @1 Potion=Взрывающее зелье @1 +Splash @1 Potion=Взрывающееся зелье @1 Lingering @1 Potion=Оседающее зелье @1 -Arrow of @1=Стрельба @1 +Arrow of @1=Стрела @1 II= II IV= IV -@1 Potion@2=@1 Зелье@2 -Splash @1@2 Potion=Взрывающее зелье @1@2 +@1 Potion@2=Зелье @1 @2 +Splash @1@2 Potion=Взрывающееся зелье @1@2 Lingering @1@2 Potion=Оседающее зелье @1@2 -Arrow of @1@2=Стрельба @1@2 -@1 + Potion=@1 + Зелье -Splash @1 + Potion=Взрывающее @1 + Зелье -Lingering @1 + Potion=Оседающее @1 + Зелье -Arrow of @1 +=Стрельба @1 + +Arrow of @1@2=Стрела @1@2 +@1 + Potion=Зелье @1+ +Splash @1 + Potion=Взрывающееся зелье @1+ +Lingering @1 + Potion=Оседающее зелье @1+ +Arrow of @1 +=Стрела @1+ Awkward Potion=Невкусное зелье Awkward Splash Potion=Невкусное взрывающееся зелье Awkward Lingering Potion=Невкусное оседающее зелье @@ -75,31 +75,31 @@ Dragon's Breath=Дыхание дракона This item is used in brewing and can be combined with splash potions to create lingering potions.=Этот предмет используется в зельеварении и может объединяться со взрывающимися зельями, чтобы создать эффект оседания -Healing=Лечение +Healing=исцеления +4 HP=+4 HP +8 HP=+8 HP Instantly heals.=Лечит мгновенно -Harming=Вред +Harming=урона -6 HP=-6 HP -12 HP=-12 HP Instantly deals damage.=Вызывает мгновенную смерть. -Night Vision=Ночное зрение +Night Vision=ночного зрения Grants the ability to see in darkness.=Даёт возможность видеть в темноте -Swiftness=Быстрота +Swiftness=ускорения Increases walking speed.=Увеличивает скорость ходьбы -Slowness=Замедление +Slowness=замедления Decreases walking speed.=Уменьшает скорость ходьбы -Leaping=Прыгучесть +Leaping=прыгучести Increases jump strength.=Увеличивает силу прыжка -Poison=Отрава +Poison=отравления Applies the poison effect which deals damage at a regular interval.=Наносит эффект яда, который вызывает урон через равные промежутки времени. -Regeneration=Восстановление +Regeneration=восстановления Regenerates health over time.=Восстанавливает здоровье со временем. -Invisibility=Невидимость +Invisibility=невидимости Grants invisibility.=Делает невидимым. -Water Breathing=Подводное дыхание +Water Breathing=подводного дыхания Grants limitless breath underwater.=Даёт возможность неограниченно дышать под водой. -Fire Resistance=Огнестойкость +Fire Resistance=огнестойкости Grants immunity to damage from heat sources like fire.=Делает невосприимчивым к урону от источников тепла, например, от огня. Weakness=Слабость Weakness +=Слабость + @@ -109,7 +109,7 @@ Strength +=Сила + Try different combinations to create potions.=Пробуйте разные сочетания для приготовления зелий. No effect=Не оказывает эффекта -A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.=Зелье, которое можно метать. Оно разбивается при ударе и он дает всем ближайшим игрокам и мобам эффект статуса. +A throwable potion that will shatter on impact, where it gives all nearby players and mobs a status effect.=Зелье, которое можно метать. Оно разбивается при ударе и он дает всем ближайшим игрокам и мобам эффект состояния. This particular arrow is tipped and will give an effect when it hits a player or mob.=Эта необычная стрела с обработанным наконечником даёт эффект при попадании в игрока или моба. From cef20edd534a0b17ff388526664e1487aa815691 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 13 Aug 2020 18:16:53 +0200 Subject: [PATCH 078/152] Fix drinking a potion never depleting it --- mods/ITEMS/mcl_potions/potions.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 3a5b513dd..f2fcbedfd 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -62,8 +62,12 @@ function return_on_use(def, effect, dur) end def.on_use(user, effect, dur) - minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) - mcl_potions._use_potion(itemstack, user, def.color) + local old_name, old_count = itemstack:get_name(), itemstack:get_count() + itemstack = minetest.do_item_eat(0, "mcl_potions:glass_bottle", itemstack, user, pointed_thing) + if old_name ~= itemstack:get_name() or old_count ~= itemstack:get_count() then + mcl_potions._use_potion(itemstack, user, def.color) + end + return itemstack end end From 152d69f91f1178b1cd68c3b703734ea3429bfd68 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 13 Aug 2020 18:44:33 +0200 Subject: [PATCH 079/152] mcl_hunger: Remove non-food poison mechanic It was moved to mcl_potions, so it's OK --- mods/PLAYER/mcl_hunger/API.md | 2 +- mods/PLAYER/mcl_hunger/api.lua | 2 -- mods/PLAYER/mcl_hunger/hunger.lua | 21 ++++----------------- mods/PLAYER/mcl_hunger/init.lua | 2 -- 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/mods/PLAYER/mcl_hunger/API.md b/mods/PLAYER/mcl_hunger/API.md index 3daa63519..57d158c48 100644 --- a/mods/PLAYER/mcl_hunger/API.md +++ b/mods/PLAYER/mcl_hunger/API.md @@ -41,7 +41,7 @@ Sets the hunger level of `player` (ObjectRef) to `hunger` immediately. Increase exhaustion of player by `exhaust`. ### `mcl_hunger.stop_poison(player)` -Immediately stops all poisonings for player. +Immediately stops food poisoning for player. ### More functions ... There are more functions (of less importance) available, see `api.lua`. diff --git a/mods/PLAYER/mcl_hunger/api.lua b/mods/PLAYER/mcl_hunger/api.lua index 46dc76fa2..55153b9bf 100644 --- a/mods/PLAYER/mcl_hunger/api.lua +++ b/mods/PLAYER/mcl_hunger/api.lua @@ -113,9 +113,7 @@ if mcl_hunger.active then if not mcl_hunger.active then return end - mcl_hunger.poison_damage[player:get_player_name()] = 0 mcl_hunger.poison_hunger[player:get_player_name()] = 0 - mcl_hunger.reset_bars_poison_damage(player) mcl_hunger.reset_bars_poison_hunger(player) end diff --git a/mods/PLAYER/mcl_hunger/hunger.lua b/mods/PLAYER/mcl_hunger/hunger.lua index a13e2ae4a..42fa219f8 100644 --- a/mods/PLAYER/mcl_hunger/hunger.lua +++ b/mods/PLAYER/mcl_hunger/hunger.lua @@ -67,10 +67,7 @@ function mcl_hunger.eat(hp_change, replace_with_item, itemstack, user, pointed_t return func(itemstack, user, pointed_thing) end --- Reset HUD bars after poisoning -function mcl_hunger.reset_bars_poison_damage(player) - hb.change_hudbar(player, "health", nil, nil, "hudbars_icon_health.png", nil, "hudbars_bar_health.png") -end +-- Reset HUD bars after food poisoning function mcl_hunger.reset_bars_poison_hunger(player) hb.change_hudbar(player, "hunger", nil, nil, "hbhunger_icon.png", nil, "hbhunger_bar.png") @@ -90,23 +87,17 @@ local function poisonp(tick, time, time_left, damage, exhaustion, name) return end local name = player:get_player_name() - -- Abort if poisonings have been stopped - if mcl_hunger.poison_damage[name] == 0 and mcl_hunger.poison_hunger[name] == 0 then + -- Abort if food poisonings have been stopped + if mcl_hunger.poison_hunger[name] == 0 then return end time_left = time_left + tick if time_left < time then minetest.after(tick, poisonp, tick, time, time_left, damage, exhaustion, name) else - -- if damage > 0 then - -- mcl_hunger.poison_damage[name] = mcl_hunger.poison_damage[name] - 1 - -- end if exhaustion > 0 then mcl_hunger.poison_hunger [name] = mcl_hunger.poison_hunger[name] - 1 end - -- if mcl_hunger.poison_damage[name] <= 0 then - -- mcl_hunger.reset_bars_poison_damage(player) - -- end if mcl_hunger.poison_hunger[name] <= 0 then mcl_hunger.reset_bars_poison_hunger(player) end @@ -224,11 +215,7 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso do_poison = true end if do_poison then - -- Set poison bars - -- if poison and poison > 0 then - -- hb.change_hudbar(user, "health", nil, nil, "hbhunger_icon_health_poison.png", nil, "hbhunger_bar_health_poison.png") - -- mcl_hunger.poison_damage[name] = mcl_hunger.poison_damage[name] + 1 - -- end + -- Set food poison bars if exhaust and exhaust > 0 then hb.change_hudbar(user, "hunger", nil, nil, "mcl_hunger_icon_foodpoison.png", nil, "mcl_hunger_bar_foodpoison.png") if mcl_hunger.debug then diff --git a/mods/PLAYER/mcl_hunger/init.lua b/mods/PLAYER/mcl_hunger/init.lua index a90bdb73e..01d74a80d 100644 --- a/mods/PLAYER/mcl_hunger/init.lua +++ b/mods/PLAYER/mcl_hunger/init.lua @@ -63,7 +63,6 @@ end ]] -- Count number of poisonings a player has at once -mcl_hunger.poison_damage = {} -- damaging poison mcl_hunger.poison_hunger = {} -- food poisoning, increasing hunger -- HUD item ids @@ -100,7 +99,6 @@ minetest.register_on_joinplayer(function(player) local name = player:get_player_name() mcl_hunger.init_player(player) init_hud(player) - mcl_hunger.poison_damage[name] = 0 mcl_hunger.poison_hunger[name] = 0 mcl_hunger.last_eat[name] = -1 end) From eff6c4c476a1ad4948dce1a623e2a0a4bea1fc67 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 13 Aug 2020 19:20:52 +0200 Subject: [PATCH 080/152] Clean up poisonous foods --- mods/ITEMS/mcl_farming/potatoes.lua | 10 +++++++++- mods/ITEMS/mcl_fishing/init.lua | 2 +- mods/ITEMS/mcl_mobitems/init.lua | 20 ++++++++++++-------- mods/PLAYER/mcl_hunger/register_foods.lua | 12 ++++-------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/mods/ITEMS/mcl_farming/potatoes.lua b/mods/ITEMS/mcl_farming/potatoes.lua index 2d8978df4..871d67963 100644 --- a/mods/ITEMS/mcl_farming/potatoes.lua +++ b/mods/ITEMS/mcl_farming/potatoes.lua @@ -122,7 +122,6 @@ minetest.register_craftitem("mcl_farming:potato_item_poison", { _doc_items_longdesc = S("This potato doesn't look too healthy. You can eat it to restore hunger points, but there's a 60% chance it will poison you briefly."), stack_max = 64, inventory_image = "farming_potato_poison.png", - -- TODO: Cause status effects on_place = minetest.item_eat(2), on_secondary_use = minetest.item_eat(2), groups = { food = 2, eatable = 2 }, @@ -138,4 +137,13 @@ minetest.register_craft({ mcl_farming:add_plant("plant_potato", "mcl_farming:potato", {"mcl_farming:potato_1", "mcl_farming:potato_2", "mcl_farming:potato_3", "mcl_farming:potato_4", "mcl_farming:potato_5", "mcl_farming:potato_6", "mcl_farming:potato_7"}, 19.75, 20) +minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, user, pointed_thing) + -- 60% chance of poisoning with poisonous potato + if itemstack:get_name() == "mcl_farming:potato_item_poison" then + if math.random(1,10) >= 6 then + mcl_potions.poison_func(user, 1, 5) + end + end + +end ) diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index b705d318f..514cd6cf4 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -434,7 +434,7 @@ minetest.register_craftitem("mcl_fishing:pufferfish_raw", { minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, user, pointed_thing) if itemstack:get_name() == "mcl_fishing:pufferfish_raw" then - mcl_potions.poison_func(user, 1.25, 7) + mcl_potions.poison_func(user, 1/3, 60) end end ) diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index 5c52fdf11..42c8c9f37 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -1,5 +1,3 @@ --- TODO: Add special status effects for raw flesh - local S = minetest.get_translator("mcl_mobitems") minetest.register_craftitem("mcl_mobitems:rotten_flesh", { @@ -136,6 +134,7 @@ minetest.register_craftitem("mcl_mobitems:cooked_rabbit", { stack_max = 64, }) +-- Reset food poisoning and status effects local drink_milk = function(itemstack, player, pointed_thing) local bucket = minetest.do_item_eat(0, "mcl_buckets:bucket_empty", itemstack, player, pointed_thing) -- Check if we were allowed to drink this (eat delay check) @@ -146,7 +145,6 @@ local drink_milk = function(itemstack, player, pointed_thing) return bucket end --- TODO: Clear *all* status effects minetest.register_craftitem("mcl_mobitems:milk_bucket", { description = S("Milk"), _tt_help = minetest.colorize("#00FF00", S("Cures poison and removes all potion effects")), @@ -154,7 +152,6 @@ minetest.register_craftitem("mcl_mobitems:milk_bucket", { _doc_items_usagehelp = "Rightclick to drink the milk.", inventory_image = "mcl_mobitems_bucket_milk.png", wield_image = "mcl_mobitems_bucket_milk.png", - -- Clear poisoning when used on_place = drink_milk, on_secondary_use = drink_milk, stack_max = 1, @@ -223,8 +220,7 @@ minetest.register_craftitem("mcl_mobitems:ghast_tear", { _doc_items_longdesc = S("Place this item in an item frame as decoration."), wield_image = "mcl_mobitems_ghast_tear.png", inventory_image = "mcl_mobitems_ghast_tear.png", - -- TODO: Reveal item when it's useful - groups = { brewitem = 1, not_in_creative_inventory = 0 }, + groups = { brewitem = 1 }, stack_max = 64, }) @@ -270,8 +266,7 @@ minetest.register_craftitem("mcl_mobitems:rabbit_foot", { _doc_items_longdesc = S("Must be your lucky day! Place this item in an item frame for decoration."), wield_image = "mcl_mobitems_rabbit_foot.png", inventory_image = "mcl_mobitems_rabbit_foot.png", - -- TODO: Reveal item when it's useful - groups = { brewitem = 1, not_in_creative_inventory = 0 }, + groups = { brewitem = 1 }, stack_max = 64, }) @@ -440,3 +435,12 @@ minetest.register_craft({ {"mcl_mobitems:slimeball","mcl_mobitems:slimeball","mcl_mobitems:slimeball",}, {"mcl_mobitems:slimeball","mcl_mobitems:slimeball","mcl_mobitems:slimeball",}}, }) + +minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, user, pointed_thing) + + -- poisoning with spider eye + if itemstack:get_name() == "mcl_mobitems:spider_eye" then + mcl_potions.poison_func(user, 1, 4) + end + +end ) diff --git a/mods/PLAYER/mcl_hunger/register_foods.lua b/mods/PLAYER/mcl_hunger/register_foods.lua index d4c933169..a68dde1c1 100644 --- a/mods/PLAYER/mcl_hunger/register_foods.lua +++ b/mods/PLAYER/mcl_hunger/register_foods.lua @@ -1,11 +1,7 @@ --- Apply simple poison effect as long there are no real status effect --- TODO: Remove this when status effects are in place --- TODO: Consider moving these to the respective mods - -mcl_hunger.register_food("mcl_farming:potato_item_poison", 2, "", 4, 1, 0, 60) +-- Apply food poisoning effect as long there are no real status effect. +-- TODO: Remove this when food poisoning a status effect in mcl_potions. +-- Normal poison damage is set to 0 because it's handled elsewhere. mcl_hunger.register_food("mcl_mobitems:rotten_flesh", 4, "", 30, 0, 100, 80) mcl_hunger.register_food("mcl_mobitems:chicken", 2, "", 30, 0, 100, 30) -mcl_hunger.register_food("mcl_mobitems:spider_eye", 2, "", 4, 1, 0) - --- mcl_hunger.register_food("mcl_fishing:pufferfish_raw", 1, "", 60, 1, 300) +mcl_hunger.register_food("mcl_fishing:pufferfish_raw", 1, "", 15, 0, 300) From 2cc76fb9f3995b9145267598a7048c53c2890561 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 13 Aug 2020 19:25:07 +0200 Subject: [PATCH 081/152] Update mcl_mobitmes translation --- mods/ITEMS/mcl_mobitems/init.lua | 8 +-- .../mcl_mobitems/locale/mcl_mobitems.de.tr | 45 ++++++++++++---- .../mcl_mobitems/locale/mcl_mobitems.es.tr | 44 +++++++++++++++- .../mcl_mobitems/locale/mcl_mobitems.fr.tr | 52 +++++++++++++++---- .../mcl_mobitems/locale/mcl_mobitems.ru.tr | 52 +++++++++++++++---- mods/ITEMS/mcl_mobitems/locale/template.txt | 45 ++++++++++++---- 6 files changed, 204 insertions(+), 42 deletions(-) diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index 42c8c9f37..4e7eabc9e 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -147,9 +147,9 @@ end minetest.register_craftitem("mcl_mobitems:milk_bucket", { description = S("Milk"), - _tt_help = minetest.colorize("#00FF00", S("Cures poison and removes all potion effects")), - _doc_items_longdesc = S("Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning and removes potion effects, but restores no hunger points."), - _doc_items_usagehelp = "Rightclick to drink the milk.", + _tt_help = minetest.colorize("#00FF00", S("Removes all status effects")), + _doc_items_longdesc = S("Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will remove all status effects, but restores no hunger points."), + _doc_items_usagehelp = S("Use the placement key to drink the milk."), inventory_image = "mcl_mobitems_bucket_milk.png", wield_image = "mcl_mobitems_bucket_milk.png", on_place = drink_milk, @@ -274,7 +274,7 @@ minetest.register_craftitem("mcl_mobitems:saddle", { description = S("Saddle"), _tt_help = S("Can be placed on animals to ride them"), _doc_items_longdesc = S("Saddles can be put on some animals in order to mount them."), - _doc_items_usagehelp = "Rightclick an animal (with the saddle in your hand) to try put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by rightclicking them again.", + _doc_items_usagehelp = S("Use the placement key with the saddle in your hand to try to put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by using the placement key on them again."), wield_image = "mcl_mobitems_saddle.png", inventory_image = "mcl_mobitems_saddle.png", groups = { transport = 1 }, diff --git a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.de.tr b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.de.tr index dcb605d24..d47b811f0 100644 --- a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.de.tr +++ b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.de.tr @@ -1,32 +1,57 @@ # textdomain: mcl_mobitems Rotten Flesh=Gammelfleisch +80% chance of food poisoning=80% Wahrscheinlichkeit von Lebensmittelvergiftung + Yuck! This piece of flesh clearly has seen better days. If you're really desperate, you can eat it to restore a few hunger points, but there's a 80% chance it causes food poisoning, which increases your hunger for a while.=Igitt! Dieses Stück Fleisch hat wohl bessere Tage gesehen. Wenn Sie es essen, werden Sie sofort vergiftet und erleiden einen Schaden von 4 Trefferpunkten. Aber gezähmte Wölfe können es problemlos fressen. + Raw Mutton=Rohes Hammelfleisch + Raw mutton is the flesh from a sheep and can be eaten safely. Cooking it will greatly increase its nutritional value.=Rohes Hammelfleisch ist das Fleisch eines Schafes und ein Lebensmittel, welches bedenkenlos verzehrt werden kann. Es kann gebraten werden, um seinen Nährwert deutlich zu erhöhen. + Cooked Mutton=Gebratenes Hammelfleisch Cooked mutton is the cooked flesh from a sheep and is used as food.=Gebratenes Hammelfleisch ist das gebratene Fleisch eines Schafs und dient als Lebensmittel. Raw Beef=Rohes Rindfleisch + Raw beef is the flesh from cows and can be eaten safely. Cooking it will greatly increase its nutritional value.=Rohes Rindfleisch ist das Fleisch von Kühen und kann problemlos gegessen werden. Es kann gegart werden, um den Nährwert deutlich zu erhöhen. + Steak=Steak Steak is cooked beef from cows and can be eaten.=Steak ist gebratenes Rindfleisch und kann gegessen werden. Raw Chicken=Rohes Hühnchen +30% chance of food poisoning=30% Wahrscheinlichkeit von Lebensmittelvergiftung + Raw chicken is a food item which is not safe to consume. You can eat it to restore a few hunger points, but there's a 30% chance to suffer from food poisoning, which increases your hunger rate for a while. Cooking raw chicken will make it safe to eat and increases its nutritional value.=Rohes Hühnchen ist ein Lebensmittel, das nicht sicher für den Verzehr ist. Sie können es essen, um ein paar Hungerpunkte zu erhalten, aber mit einer Wahrscheinlichkeit von 30% erleiden Sie eine Lebensmittelvergiftung, die Ihre Hungerrate für eine Weile erhöht. Braten Sie ein rohes Hühnchen, um es sicher zuzubereiten und den Nährwert zu erhöhen. + Cooked Chicken=Gebratenes Hühnchen A cooked chicken is a healthy food item which can be eaten.=Ein gebratenes Hühnchen ist ein gesundes essbares Lebensmittel. Raw Porkchop=Rohes Schweinefleisch + A raw porkchop is the flesh from a pig and can be eaten safely. Cooking it will greatly increase its nutritional value.=Ein rohes Stück Schweinefleisch kann bedenkenlos gegessen werden. Man kann es braten, um seinen Nährwert stark zu erhöhen. + Cooked Porkchop=Gebratenes Schweinefleisch Cooked porkchop is the cooked flesh of a pig and is used as food.=Ein gebratenes Stück Schweinefleisch ist ein gutes Lebensmittel. Raw Rabbit=Rohes Kaninchen + Raw rabbit is a food item from a dead rabbit. It can be eaten safely. Cooking it will increase its nutritional value.=Rohes Kaninchenfleisch ist ein Lebensmittel, welches bedenkenlos verzehrt werden kann. Es kann gebraten werden, um seinen Nährwert zu erhöhen. + Cooked Rabbit=Gebratenes Kaninchen This is a food item which can be eaten.=Dies ist ein essbares Lebensmittel. Milk=Milch -Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points.=Milch ist sehr erfrischend und wird erhalten, wenn ein Eimer an einer Kuh benutzt wird. Wenn es getrunken wird, werden alle Vergiftungserscheinungen kuriert, aber es werden keine Hungerpunkte wiederhergestellt. +Removes all status effects=Entfernt alle Statuseffekte + +Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will remove all status effects, but restores no hunger points.=Milch ist sehr erfrischend. Milch erhält man, indem man einen Eimer an einer Kuh benutzt. Wenn die Milch getrunken wird, werden alle Statuseffekte entfernt, aber es werden keine Hungerpunkte wiederhergestellt. + +Use the placement key to drink the milk.=Platzierungstaste benutzen, um Milch zu trinken. Spider Eye=Spinnenauge +Poisonous=Giftig + Spider eyes are used mainly in crafting. If you're really desperate, you can eat a spider eye, but it will poison you briefly.=Spinnenaugen werden hauptsächlich in der Fertigung benutzt. Wenn Sie wirklich verzweifelt sind, können sie es essen, aber das wird Sie kurz vergiften. + Bone=Knochen + Bones can be used to tame wolves so they will protect you. They are also useful as a crafting ingredient.=Knochen können benutzt werden, um Wölfe zu zähmen, damit sie einen beschützen. Sie außerdem nützlich in der Fertigung. + +Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it.=Halten Sie den Knochen in der Nähe von Wölfen, um sie anzulocken. Benutzen Sie die „Platzieren“-Taste auf dem Wolf, um ihm den Knochen zu geben und ihn zu zähmen. Sie können dem gezähmten Wolf Befehle erteilen, indem Sie die „Platzieren“-Taste auf ihm benutzen. + String=Faden Strings are used in crafting.=Fäden sind nützlich in der Fertigung. Blaze Rod=Lohenrute @@ -38,7 +63,9 @@ Magma cream is a crafting component.=Magmacreme ist eine Fertigungskomponente. Ghast Tear=Ghast-Träne Place this item in an item frame as decoration.=Platzieren Sie diesen Gegenstand in einem Rahmel als Deko. Nether Star=Nether-Stern + A nether star is dropped when the Wither dies. Place it in an item frame to show the world how hardcore you are! Or just as decoration.=Ein Netherstern wird abgeworfen, wenn der Wither stirbt. Platzieren Sie ihn in einen Rahmen, um der Welt zu zeigen, wie großartig Sie sind! + Leather=Leder Leather is a versatile crafting component.=Leder ist eine vielseitige Fertigungskomponente. Feather=Feder @@ -48,7 +75,11 @@ Rabbit hide is used to create leather.=Kaninchenfell wird zur Herstellung von Le Rabbit's Foot=Hasenpfote Must be your lucky day! Place this item in an item frame for decoration.=Muss wohl Ihr Glückstag sein! Platzieren Sie diesen Gegenstand in einen Rahmen zur Dekoration. Saddle=Sattel +Can be placed on animals to ride them=Kann auf Tieren platziert werden, um sie zu reiten Saddles can be put on some animals in order to mount them.=Sattel können auf einigen Tieren platziert werden, um sich aufzusatteln. + +Use the placement key with the saddle in your hand to try to put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by using the placement key on them again.=Platzierungstaste benutzen, während man den Sattel in der Hand hält, um zu versuchen, den Sattel anzulegen. Sattel passen auf Pferde, Maultiere, Esel und Schweine. Pferde, Maultiere und Esel müssen zuerst gezähmt werden, sonst werden sie den Sattel abweisen. Mit der Platzierungstaste kann man aufsatteln. + Rabbit Stew=Kaninchenragout Rabbit stew is a very nutricious food item.=Kaninchenragout ist ein sehr nahrhaftes Lebensmittel. Shulker Shell=Schulkerschale @@ -57,12 +88,8 @@ Slimeball=Schleimkugel Slimeballs are used in crafting. They are dropped from slimes.=Schleimkugeln werden in der Fertigung verwendet. Sie werden von Schleimen fallen gelassen. Gunpowder=Schießpulver Carrot on a Stick=Karottenrute -A carrot on a stick can be used on saddled pigs to ride them.=Eine Karottenrute kann auf gesattelten Schweinen angewendet werden, um sie zu reiten. -Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.=Platzieren Sie sie auf einem Schwein mit Sattel, um sich aufzusatteln. Sie können nun das Schwein wie ein Pferd reiten. Schweine werden auch auf Sie zugehen, wenn Sie einfach nur die Karottenrute halten. -Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it.=Halten Sie den Knochen in der Nähe von Wölfen, um sie anzulocken. Benutzen Sie die „Platzieren“-Taste auf dem Wolf, um ihm den Knochen zu geben und ihn zu zähmen. Sie können dem gezähmten Wolf Befehle erteilen, indem Sie die „Platzieren“-Taste auf ihm benutzen. Lets you ride a saddled pig=Um auf gesattelten Schweinen zu reiten -30% chance of food poisoning=30% Wahrscheinlichkeit von Lebensmittelvergiftung -80% chance of food poisoning=80% Wahrscheinlichkeit von Lebensmittelvergiftung -Cures poison=Kuriert Vergiftung -Can be placed on animals to ride them=Kann auf Tieren platziert werden, um sie zu reiten -Poisonous=Giftig +A carrot on a stick can be used on saddled pigs to ride them.=Eine Karottenrute kann auf gesattelten Schweinen angewendet werden, um sie zu reiten. + +Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.=Platzieren Sie sie auf einem Schwein mit Sattel, um sich aufzusatteln. Sie können nun das Schwein wie ein Pferd reiten. Schweine werden auch auf Sie zugehen, wenn Sie einfach nur die Karottenrute halten. + diff --git a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.es.tr b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.es.tr index e56ef9ee4..746a438b0 100644 --- a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.es.tr +++ b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.es.tr @@ -1,32 +1,57 @@ # textdomain: mcl_mobitems Rotten Flesh=Carne podrida +80% chance of food poisoning= + Yuck! This piece of flesh clearly has seen better days. If you're really desperate, you can eat it to restore a few hunger points, but there's a 80% chance it causes food poisoning, which increases your hunger for a while.=¡Qué asco! Este pedazo de carne claramente ha tenido días mejores. Si está realmente estas desesperado, puedes comerlo para restablecer algunos puntos de hambre, pero hay un 80% de posibilidades de que cause intoxicación alimentaria, lo que aumenta su hambre por un tiempo. + Raw Mutton=Cordero crudo + Raw mutton is the flesh from a sheep and can be eaten safely. Cooking it will greatly increase its nutritional value.=El cordero crudo es la carne de una oveja y se puede comer de manera segura. Cocinarlo aumentará en gran medida su valor nutricional. + Cooked Mutton=Cordero cocinado Cooked mutton is the cooked flesh from a sheep and is used as food.=El cordero cocinado es la carne cocinada de oveja y se usa como alimento. Raw Beef=Filete crudo + Raw beef is the flesh from cows and can be eaten safely. Cooking it will greatly increase its nutritional value.=La carne cruda es la carne de las vacas y se puede comer de manera segura. Cocinarlo aumentará en gran medida su valor nutricional. + Steak=Filete cocinado Steak is cooked beef from cows and can be eaten.=El filete cocinado se cocina con filetes crudos de vaca y se puede comer. Raw Chicken=Pollo crudo +30% chance of food poisoning= + Raw chicken is a food item which is not safe to consume. You can eat it to restore a few hunger points, but there's a 30% chance to suffer from food poisoning, which increases your hunger rate for a while. Cooking raw chicken will make it safe to eat and increases its nutritional value.=El pollo crudo es un alimento que no es seguro consumir. Puedes comerlo para restaurar algunos puntos de hambre, pero hay un 30% de posibilidades de sufrir intoxicación alimentaria, lo que aumenta su tasa de hambre por un tiempo. Cocinar pollo crudo hará que sea seguro comerlo y aumentará su valor nutricional. + Cooked Chicken=Pollo cocinado A cooked chicken is a healthy food item which can be eaten.=Un pollo cocinado es un alimento saludable que se puede comer. Raw Porkchop=Chuleta de cerdo cruda + A raw porkchop is the flesh from a pig and can be eaten safely. Cooking it will greatly increase its nutritional value.=Una chuleta de cerdo cruda es la carne de un cerdo y se puede comer de manera segura. Cocinarlo aumentará en gran medida su valor nutricional. + Cooked Porkchop=Chuleta de cerdo cocinada Cooked porkchop is the cooked flesh of a pig and is used as food.=La chuleta de cerdo cocinada es la carne cocida de un cerdo y se usa como alimento. Raw Rabbit=Conejo crudo + Raw rabbit is a food item from a dead rabbit. It can be eaten safely. Cooking it will increase its nutritional value.=El conejo crudo es un alimento de un conejo muerto. Se puede comer de forma segura. Cocinar aumentará su valor nutricional. + Cooked Rabbit=Conejo cocinado This is a food item which can be eaten.=Este es un alimento que se puede comer. Milk=Leche -Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points.=La leche es muy refrescante y se puede obtener usando un cubo en una vaca. Beberlo curará todas las formas de envenenamiento, pero no restaura los puntos de hambre. +Removes all status effects= + +Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will remove all status effects, but restores no hunger points.= + +Use the placement key to drink the milk.= Spider Eye=Ojo de araña +Poisonous= + Spider eyes are used mainly in crafting. If you're really desperate, you can eat a spider eye, but it will poison you briefly.=Los ojos de araña se utilizan principalmente en la elaboración. Si estás realmente desesperado, puedes comerte un ojo de araña, pero te envenenará brevemente. + Bone=Hueso + Bones can be used to tame wolves so they will protect you. They are also useful as a crafting ingredient.=Los huesos se pueden usar para domar a los lobos para que te protejan. También son útiles como ingrediente de elaboración. + +Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it.=Empuña el hueso cerca de los lobos para atraerlos. Usa la tecla "Colocar" en el lobo para darle un hueso y domesticarlo. Luego puede dar órdenes al lobo domesticado utilizando la tecla "Colocar". + String=Cuerda Strings are used in crafting.=Las cuerdas se usan en la elaboración. Blaze Rod=Vara de blaze @@ -38,7 +63,9 @@ Magma cream is a crafting component.=La crema de magma es un componente de elabo Ghast Tear=Lágrima espectral Place this item in an item frame as decoration.=Coloque este artículo en un marco de artículo como decoración. Nether Star=Estrella del Nether + A nether star is dropped when the Wither dies. Place it in an item frame to show the world how hardcore you are! Or just as decoration.=Se cae una estrella cuando muere un Wither. ¡Colócalo en el marco de un objeto para mostrarle al mundo lo duro que eres! O simplemente como decoración. + Leather=Cuero Leather is a versatile crafting component.=El cuero es un componente de elaboración versátil. Feather=Pluma @@ -48,7 +75,11 @@ Rabbit hide is used to create leather.=La piel de conejo se usa para crear cuero Rabbit's Foot=Pata de conejo Must be your lucky day! Place this item in an item frame for decoration.=¡Debe ser tu día de suerte! Coloque este artículo en un marco de artículos para la decoración. Saddle=Montura +Can be placed on animals to ride them= Saddles can be put on some animals in order to mount them.=Se pueden poner monturas en algunos animales para montarlos. + +Use the placement key with the saddle in your hand to try to put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by using the placement key on them again.= + Rabbit Stew=Estofado de conejo Rabbit stew is a very nutricious food item.=El estofado de conejo es un alimento muy nutritivo. Shulker Shell=Caparazón de shulker @@ -57,6 +88,15 @@ Slimeball=Bola de slime Slimeballs are used in crafting. They are dropped from slimes.=Las bolas de slime se usan en la elaboración. Se obtienen de slimes. Gunpowder=Pólvora Carrot on a Stick=Caña con zanahoria +Lets you ride a saddled pig= A carrot on a stick can be used on saddled pigs to ride them.=La caña con zanahoria se puede usar en cerdos ensillados para montarlos. + Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.=Colóquelo sobre un cerdo ensillado para montarlo. Ahora puedes montar el cerdo como un caballo. Los cerdos también caminarán hacia ti cuando solo manejes la zanahoria en un palo. -Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it.=Empuña el hueso cerca de los lobos para atraerlos. Usa la tecla "Colocar" en el lobo para darle un hueso y domesticarlo. Luego puede dar órdenes al lobo domesticado utilizando la tecla "Colocar". + + + +##### not used anymore ##### + + +Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points.=La leche es muy refrescante y se puede obtener usando un cubo en una vaca. Beberlo curará todas las formas de envenenamiento, pero no restaura los puntos de hambre. + diff --git a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.fr.tr b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.fr.tr index b7c92d83f..36fbac012 100644 --- a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.fr.tr +++ b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.fr.tr @@ -1,32 +1,57 @@ # textdomain: mcl_mobitems Rotten Flesh=Chair Putréfiée +80% chance of food poisoning=80% de chances d'intoxication alimentaire + Yuck! This piece of flesh clearly has seen better days. If you're really desperate, you can eat it to restore a few hunger points, but there's a 80% chance it causes food poisoning, which increases your hunger for a while.=Beurk! Ce morceau de chair a clairement connu des jours meilleurs. Si vous êtes vraiment désespéré, vous pouvez le manger pour restaurer quelques points de faim, mais il y a 80% de chances qu'il provoque une intoxication alimentaire, ce qui augmente votre faim pendant un certain temps. + Raw Mutton=Mouton Cru + Raw mutton is the flesh from a sheep and can be eaten safely. Cooking it will greatly increase its nutritional value.=Le mouton cru est la chair d'un mouton et peut être mangé en toute sécurité. La cuisson augmentera considérablement sa valeur nutritive. + Cooked Mutton=Mouton Cuit Cooked mutton is the cooked flesh from a sheep and is used as food.=Le mouton cuit est la chair cuite d'un mouton et est utilisé comme nourriture. Raw Beef=Boeuf Cru + Raw beef is the flesh from cows and can be eaten safely. Cooking it will greatly increase its nutritional value.=Le boeuf cru est la chair des vaches et peut être mangé en toute sécurité. La cuisson augmentera considérablement sa valeur nutritive. + Steak=Steak Steak is cooked beef from cows and can be eaten.=Le steak est du boeuf cuit et peut être mangé. Raw Chicken=Poulet Cru +30% chance of food poisoning=30% de chances d'intoxication alimentaire + Raw chicken is a food item which is not safe to consume. You can eat it to restore a few hunger points, but there's a 30% chance to suffer from food poisoning, which increases your hunger rate for a while. Cooking raw chicken will make it safe to eat and increases its nutritional value.=Le poulet cru est un aliment qui n'est pas sûr à consommer. Vous pouvez le manger pour restaurer quelques points de faim, mais il y a 30% de chances de souffrir d'intoxication alimentaire, ce qui augmente votre taux de faim pendant un certain temps. La cuisson du poulet cru le rendra sûr à manger et augmentera sa valeur nutritive. + Cooked Chicken=Poulet Cuit A cooked chicken is a healthy food item which can be eaten.=Un poulet cuit est un aliment sain qui peut être mangé. Raw Porkchop=Porc Cru + A raw porkchop is the flesh from a pig and can be eaten safely. Cooking it will greatly increase its nutritional value.=Un porc cru est la chair d'un porc et peut être mangée en toute sécurité. La cuisson augmentera considérablement sa valeur nutritive. + Cooked Porkchop=Parc Cuit Cooked porkchop is the cooked flesh of a pig and is used as food.=Le porc cuit est la chair cuite d'un porc et est utilisé comme aliment. Raw Rabbit=Lapin Cru + Raw rabbit is a food item from a dead rabbit. It can be eaten safely. Cooking it will increase its nutritional value.=Le lapin cru est un aliment provenant d'un lapin mort. Il peut être mangé en toute sécurité. La cuisson augmentera sa valeur nutritive. + Cooked Rabbit=Lapin Cuit This is a food item which can be eaten.=Il s'agit d'un aliment qui peut être mangé. Milk=Lait -Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points.=Le lait est très rafraîchissant et peut être obtenu en utilisant un seau sur une vache. Le boire guérira toutes les formes d'empoisonnement, mais ne restaure pas de points de faim. +Removes all status effects= + +Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will remove all status effects, but restores no hunger points.= + +Use the placement key to drink the milk.= Spider Eye=Oeil d'Araignée +Poisonous=Toxique + Spider eyes are used mainly in crafting. If you're really desperate, you can eat a spider eye, but it will poison you briefly.=Les yeux d'araignée sont utilisés principalement dans l'artisanat. Si vous êtes vraiment désespéré, vous pouvez manger un œil d'araignée, mais cela vous empoisonnera brièvement. + Bone=Os + Bones can be used to tame wolves so they will protect you. They are also useful as a crafting ingredient.=Les os peuvent être utilisés pour apprivoiser les loups afin de vous protéger. Ils sont également utiles comme ingrédient d'artisanat. + +Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it.=Maniez l'os près des loups pour les attirer. Utilisez la touche «Placer» sur le loup pour lui donner un os et l'apprivoiser. Vous pouvez ensuite donner des commandes au loup apprivoisé en utilisant la touche "Placer" sur celui-ci. + String=Ficelle Strings are used in crafting.=Les ficelles sont utilisées dans l'artisanat. Blaze Rod=Bâton de Blaze @@ -38,7 +63,9 @@ Magma cream is a crafting component.=La crème de magma est un composant artisan Ghast Tear=Larme de Ghast Place this item in an item frame as decoration.=Placez cet article dans un cadre d'article comme décoration. Nether Star=Étoile du Nether + A nether star is dropped when the Wither dies. Place it in an item frame to show the world how hardcore you are! Or just as decoration.=Une étoile du Nether est lâchée lorsque le Wither meurt. Placez-le dans un cadre d'objet pour montrer au monde à quel point vous êtes génial! Ou tout simplement comme décoration. + Leather=Cuir Leather is a versatile crafting component.=Le cuir est un élément d'artisanat polyvalent. Feather=Plume @@ -48,7 +75,11 @@ Rabbit hide is used to create leather.=La peau de lapin est utilisée pour crée Rabbit's Foot=Patte de Lapin Must be your lucky day! Place this item in an item frame for decoration.=Ce doit être votre jour de chance! Placez cet article dans un cadre d'article pour la décoration. Saddle=Selle +Can be placed on animals to ride them=Peut être placé sur les animaux pour les monter Saddles can be put on some animals in order to mount them.=Des selles peuvent être posées sur certains animaux afin de les monter. + +Use the placement key with the saddle in your hand to try to put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by using the placement key on them again.= + Rabbit Stew=Ragout de Lapin Rabbit stew is a very nutricious food item.=Le ragoût de lapin est un aliment très nutritif. Shulker Shell=Carapace de Shulker @@ -57,12 +88,15 @@ Slimeball=Boule de Slime Slimeballs are used in crafting. They are dropped from slimes.=Les boules de slime sont utilisées dans l'artisanat. Ils sont lâchés par les Slimes. Gunpowder=Poudre à canon Carrot on a Stick=Carotte sur un Batôn -A carrot on a stick can be used on saddled pigs to ride them.=Une carotte sur un bâton peut être utilisée sur les porcs sellés pour les monter. -Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.=Placez-le sur un cochon sellé pour le monter. Vous pouvez maintenant monter le cochon comme un cheval. Les porcs marcheront également vers vous lorsque vous brandirez la carotte sur un bâton. -Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it.=Maniez l'os près des loups pour les attirer. Utilisez la touche «Placer» sur le loup pour lui donner un os et l'apprivoiser. Vous pouvez ensuite donner des commandes au loup apprivoisé en utilisant la touche "Placer" sur celui-ci. Lets you ride a saddled pig=Vous permet de monter un cochon sellé -30% chance of food poisoning=30% de chances d'intoxication alimentaire -80% chance of food poisoning=80% de chances d'intoxication alimentaire -Cures poison=Guérit le poison -Can be placed on animals to ride them=Peut être placé sur les animaux pour les monter -Poisonous=Toxique +A carrot on a stick can be used on saddled pigs to ride them.=Une carotte sur un bâton peut être utilisée sur les porcs sellés pour les monter. + +Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.=Placez-le sur un cochon sellé pour le monter. Vous pouvez maintenant monter le cochon comme un cheval. Les porcs marcheront également vers vous lorsque vous brandirez la carotte sur un bâton. + + + +##### not used anymore ##### + + +Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points.=Le lait est très rafraîchissant et peut être obtenu en utilisant un seau sur une vache. Le boire guérira toutes les formes d'empoisonnement, mais ne restaure pas de points de faim. + diff --git a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.ru.tr b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.ru.tr index 4d4dbdc2b..a247fb6f6 100644 --- a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.ru.tr +++ b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.ru.tr @@ -1,32 +1,57 @@ # textdomain: mcl_mobitems Rotten Flesh=Гнилое мясо +80% chance of food poisoning=Вероятность отравления 80% + Yuck! This piece of flesh clearly has seen better days. If you're really desperate, you can eat it to restore a few hunger points, but there's a 80% chance it causes food poisoning, which increases your hunger for a while.=БУЭ! Этот кусок гнили явно знавал лучшие времена. Если вы отчаялись, то можете съесть его, восстановив несколько очков голода, но с вероятностью 80% вы получите пищевое отравление, которое усилит ваш голод на некоторое время. + Raw Mutton=Сырая баранина + Raw mutton is the flesh from a sheep and can be eaten safely. Cooking it will greatly increase its nutritional value.=Сырая баранина это мясо овцы, его можно безопасно есть. Приготовление значительно увеличивает его питательную ценность. + Cooked Mutton=Жареная баранина Cooked mutton is the cooked flesh from a sheep and is used as food.=Жареная баранина это запечённое мясо овцы, употребляемое в пищу. Raw Beef=Сырая говядина + Raw beef is the flesh from cows and can be eaten safely. Cooking it will greatly increase its nutritional value.=Сырая говядина это мясо коровы, его можно безопасно есть. Приготовление значительно увеличивает его питательную ценность. + Steak=Стейк Steak is cooked beef from cows and can be eaten.=Стейк это приготовленное мясо коровы, его можно есть. Raw Chicken=Сырая курица +30% chance of food poisoning=Вероятность отравления 30% + Raw chicken is a food item which is not safe to consume. You can eat it to restore a few hunger points, but there's a 30% chance to suffer from food poisoning, which increases your hunger rate for a while. Cooking raw chicken will make it safe to eat and increases its nutritional value.=Сырая курица это продуктовый предмет, небезопасный для употребления. Вы можете его съесть для восстановления нескольких очков голода, но с вероятностью 30% вы пострадаете от пищевого отравление, которое усилит ваш голод на некоторое время. Приготовление сырой курицы сделает её безопасной для еды, значительно увеличив питательную ценность. + Cooked Chicken=Жареный цыплёнок A cooked chicken is a healthy food item which can be eaten.=Жареный цыплёнок это здоровый питательный продукт, его можно есть. Raw Porkchop=Сырая свинина + A raw porkchop is the flesh from a pig and can be eaten safely. Cooking it will greatly increase its nutritional value.=Сырая свинина это мясо свиньи, его можно безопасно есть. Приготовление значительно увеличивает его питательную ценность. + Cooked Porkchop=Свиная отбивная Cooked porkchop is the cooked flesh of a pig and is used as food.=Свиная отбивная это приготовленное мясо свиньи, его можно есть. Raw Rabbit=Сырая крольчатина + Raw rabbit is a food item from a dead rabbit. It can be eaten safely. Cooking it will increase its nutritional value.=Сырая крольчатина это мясо кролика, его можно безопасно есть. Приготовление значительно увеличивает его питательную ценность. + Cooked Rabbit=Приготовленный кролик This is a food item which can be eaten.=Это пищевой продукт, его можно есть. Milk=Молоко -Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points.=Молоко отлично освежает, его можно получить, применив ведро к корове. Выпив молока, вы излечитесь от всех видом отравлений, но не восстановите очков голода. +Removes all status effects= + +Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will remove all status effects, but restores no hunger points.= + +Use the placement key to drink the milk.= Spider Eye=Паучий глаз +Poisonous=Ядовито + Spider eyes are used mainly in crafting. If you're really desperate, you can eat a spider eye, but it will poison you briefly.=Паучьи глаза в основном используются для крафтинга. Если вы отчаялись, то можете съесть их, но они вас на некоторое время отравят. + Bone=Кость + Bones can be used to tame wolves so they will protect you. They are also useful as a crafting ingredient.=Кости можно использовать для приручения волков, чтобы они защищали вас. + +Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it.=Положите кость рядом с волками, чтобы привлечь их. Используйте клавишу “Разместить” на волке, чтобы дать ему кость и приручить его. Вы можете командовать приручёнными волками с помощью клавиши “Разместить”. + String=Нити Strings are used in crafting.=Нити используются для крафтинга Blaze Rod=Огненный стержень @@ -38,7 +63,9 @@ Magma cream is a crafting component.=Лавовый крем это крафти Ghast Tear=Слеза гаста Place this item in an item frame as decoration.=Поместите это в рамку как украшение. Nether Star=Звезда Ада + A nether star is dropped when the Wither dies. Place it in an item frame to show the world how hardcore you are! Or just as decoration.=Звезда Ада выбрасывается при смерти иссушителя. Поместите её в рамку, чтобы показать миру ваше величие! Либо просто как украшение. + Leather=Кожа Leather is a versatile crafting component.=Кожа это универсальный крафт-компонент. Feather=Перо @@ -48,7 +75,11 @@ Rabbit hide is used to create leather.=Кроличья шкурка испол Rabbit's Foot=Кроличья лапка Must be your lucky day! Place this item in an item frame for decoration.=У вас счастливый день! Поместите этот предмет в рамку как украшение. Saddle=Седло +Can be placed on animals to ride them=Можно устанавливать на животных, чтобы ездить на них Saddles can be put on some animals in order to mount them.=Седло можно поставить на некоторых животных, чтобы закрепляться на них. + +Use the placement key with the saddle in your hand to try to put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by using the placement key on them again.= + Rabbit Stew=Рагу из кролика Rabbit stew is a very nutricious food item.=Рагу из кролика это очень питательный продукт. Shulker Shell=Панцирь шалкера @@ -57,12 +88,15 @@ Slimeball=Слизь Slimeballs are used in crafting. They are dropped from slimes.=Слизь используется для крафтинга. Она выпадает из слизняков. Gunpowder=Порох Carrot on a Stick=Удочка с морковью -A carrot on a stick can be used on saddled pigs to ride them.=Удочку с морковью можно использовать, чтобы оседлать свинью и поехать на ней. -Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.=Поместите это на осёдланную свинью, чтобы закрепиться на ней. Теперь вы можете ехать на ней, как на лошади. Свиньи также идут вперёд, когда вы просто держите удочку с морковью. -Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it.=Положите кость рядом с волками, чтобы привлечь их. Используйте клавишу “Разместить” на волке, чтобы дать ему кость и приручить его. Вы можете командовать приручёнными волками с помощью клавиши “Разместить”. Lets you ride a saddled pig=Позволяет вам ездить на осёдланной свинье -30% chance of food poisoning=Вероятность отравления 30% -80% chance of food poisoning=Вероятность отравления 80% -Cures poison=Лечит отравление -Can be placed on animals to ride them=Можно устанавливать на животных, чтобы ездить на них -Poisonous=Ядовито +A carrot on a stick can be used on saddled pigs to ride them.=Удочку с морковью можно использовать, чтобы оседлать свинью и поехать на ней. + +Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.=Поместите это на осёдланную свинью, чтобы закрепиться на ней. Теперь вы можете ехать на ней, как на лошади. Свиньи также идут вперёд, когда вы просто держите удочку с морковью. + + + +##### not used anymore ##### + + +Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points.=Молоко отлично освежает, его можно получить, применив ведро к корове. Выпив молока, вы излечитесь от всех видом отравлений, но не восстановите очков голода. + diff --git a/mods/ITEMS/mcl_mobitems/locale/template.txt b/mods/ITEMS/mcl_mobitems/locale/template.txt index e5cf32e4e..ce5bbcabe 100644 --- a/mods/ITEMS/mcl_mobitems/locale/template.txt +++ b/mods/ITEMS/mcl_mobitems/locale/template.txt @@ -1,32 +1,57 @@ # textdomain: mcl_mobitems Rotten Flesh= +80% chance of food poisoning= + Yuck! This piece of flesh clearly has seen better days. If you're really desperate, you can eat it to restore a few hunger points, but there's a 80% chance it causes food poisoning, which increases your hunger for a while.= + Raw Mutton= + Raw mutton is the flesh from a sheep and can be eaten safely. Cooking it will greatly increase its nutritional value.= + Cooked Mutton= Cooked mutton is the cooked flesh from a sheep and is used as food.= Raw Beef= + Raw beef is the flesh from cows and can be eaten safely. Cooking it will greatly increase its nutritional value.= + Steak= Steak is cooked beef from cows and can be eaten.= Raw Chicken= +30% chance of food poisoning= + Raw chicken is a food item which is not safe to consume. You can eat it to restore a few hunger points, but there's a 30% chance to suffer from food poisoning, which increases your hunger rate for a while. Cooking raw chicken will make it safe to eat and increases its nutritional value.= + Cooked Chicken= A cooked chicken is a healthy food item which can be eaten.= Raw Porkchop= + A raw porkchop is the flesh from a pig and can be eaten safely. Cooking it will greatly increase its nutritional value.= + Cooked Porkchop= Cooked porkchop is the cooked flesh of a pig and is used as food.= Raw Rabbit= + Raw rabbit is a food item from a dead rabbit. It can be eaten safely. Cooking it will increase its nutritional value.= + Cooked Rabbit= This is a food item which can be eaten.= Milk= -Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points.= +Removes all status effects= + +Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will remove all status effects, but restores no hunger points.= + +Use the placement key to drink the milk.= Spider Eye= +Poisonous= + Spider eyes are used mainly in crafting. If you're really desperate, you can eat a spider eye, but it will poison you briefly.= + Bone= + Bones can be used to tame wolves so they will protect you. They are also useful as a crafting ingredient.= + +Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it.= + String= Strings are used in crafting.= Blaze Rod= @@ -38,7 +63,9 @@ Magma cream is a crafting component.= Ghast Tear= Place this item in an item frame as decoration.= Nether Star= + A nether star is dropped when the Wither dies. Place it in an item frame to show the world how hardcore you are! Or just as decoration.= + Leather= Leather is a versatile crafting component.= Feather= @@ -48,7 +75,11 @@ Rabbit hide is used to create leather.= Rabbit's Foot= Must be your lucky day! Place this item in an item frame for decoration.= Saddle= +Can be placed on animals to ride them= Saddles can be put on some animals in order to mount them.= + +Use the placement key with the saddle in your hand to try to put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by using the placement key on them again.= + Rabbit Stew= Rabbit stew is a very nutricious food item.= Shulker Shell= @@ -57,12 +88,8 @@ Slimeball= Slimeballs are used in crafting. They are dropped from slimes.= Gunpowder= Carrot on a Stick= -A carrot on a stick can be used on saddled pigs to ride them.= -Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.= -Wield the bone near wolves to attract them. Use the “Place” key on the wolf to give it a bone and tame it. You can then give commands to the tamed wolf by using the “Place” key on it.= Lets you ride a saddled pig= -30% chance of food poisoning= -80% chance of food poisoning= -Cures poison= -Can be placed on animals to ride them= -Poisonous= +A carrot on a stick can be used on saddled pigs to ride them.= + +Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.= + From ff24052e7ff338cdbfe91f85ed46970b6ebcf7c7 Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 14 Aug 2020 00:38:19 +0400 Subject: [PATCH 082/152] Update mcl_mobitems.ru.tr --- mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.ru.tr | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.ru.tr b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.ru.tr index a247fb6f6..f51e4f562 100644 --- a/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.ru.tr +++ b/mods/ITEMS/mcl_mobitems/locale/mcl_mobitems.ru.tr @@ -36,11 +36,11 @@ Raw rabbit is a food item from a dead rabbit. It can be eaten safely. Cooking it Cooked Rabbit=Приготовленный кролик This is a food item which can be eaten.=Это пищевой продукт, его можно есть. Milk=Молоко -Removes all status effects= +Removes all status effects=Убирает все эффекты состояния -Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will remove all status effects, but restores no hunger points.= +Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will remove all status effects, but restores no hunger points.=Молоко отлично освежает, его можно получить, применив ведро к корове. Выпив молока, вы избавитесь от всех эффектов состояния, но не восстановите очков голода. -Use the placement key to drink the milk.= +Use the placement key to drink the milk.=Используйте клавишу размещения, чтобы выпить молоко. Spider Eye=Паучий глаз Poisonous=Ядовито @@ -78,7 +78,7 @@ Saddle=Седло Can be placed on animals to ride them=Можно устанавливать на животных, чтобы ездить на них Saddles can be put on some animals in order to mount them.=Седло можно поставить на некоторых животных, чтобы закрепляться на них. -Use the placement key with the saddle in your hand to try to put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by using the placement key on them again.= +Use the placement key with the saddle in your hand to try to put on the saddle. Saddles fit on horses, mules, donkeys and pigs. Horses, mules and donkeys need to be tamed first, otherwise they'll reject the saddle. Saddled animals can be mounted by using the placement key on them again.=Используйте клавишу размещения, держа седло в руке, чтобы попытаться надеть его. Сёдла подходят для лошадей, мулов, осликов и свиней. Лошади, мулы и ослики должны быть предварительно приручены, иначе они откажутся от седла. На осёдланных животных можно сесть, снова нажав на них клавишу размещения. Rabbit Stew=Рагу из кролика Rabbit stew is a very nutricious food item.=Рагу из кролика это очень питательный продукт. @@ -93,10 +93,3 @@ A carrot on a stick can be used on saddled pigs to ride them.=Удочку с м Place it on a saddled pig to mount it. You can now ride the pig like a horse. Pigs will also walk towards you when you just wield the carrot on a stick.=Поместите это на осёдланную свинью, чтобы закрепиться на ней. Теперь вы можете ехать на ней, как на лошади. Свиньи также идут вперёд, когда вы просто держите удочку с морковью. - - -##### not used anymore ##### - - -Milk is very refreshing and can be obtained by using a bucket on a cow. Drinking it will cure all forms of poisoning, but restores no hunger points.=Молоко отлично освежает, его можно получить, применив ведро к корове. Выпив молока, вы излечитесь от всех видом отравлений, но не восстановите очков голода. - From b2ad6b79bd1fd4b5086a1aaf6c90aff7040924b0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 10:39:44 +0200 Subject: [PATCH 083/152] Fix night vision conflicting with weather skycolor --- mods/ENVIRONMENT/mcl_weather/skycolor.lua | 30 ++++++++++++++++++----- mods/ITEMS/mcl_potions/functions.lua | 12 +++++---- mods/ITEMS/mcl_potions/mod.conf | 2 +- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_weather/skycolor.lua b/mods/ENVIRONMENT/mcl_weather/skycolor.lua index a79410739..8618bdbb7 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor.lua @@ -1,4 +1,5 @@ local mods_loaded = false +local NIGHT_VISION_RATIO = 0.45 mcl_weather.skycolor = { -- Should be activated before do any effect. @@ -51,6 +52,23 @@ mcl_weather.skycolor = { end end, + -- Wrapper for updating day/night ratio that respects night vision + override_day_night_ratio = function(player, ratio) + local meta = player:get_meta() + local night_vision = meta:get_int("night_vision") + local arg + if night_vision == 1 then + if ratio == nil then + arg = NIGHT_VISION_RATIO + else + arg = math.max(ratio, NIGHT_VISION_RATIO) + end + else + arg = ratio + end + player:override_day_night_ratio(arg) + end, + -- Update sky color. If players not specified update sky for all players. update_sky_color = function(players) -- Override day/night ratio as well @@ -76,7 +94,7 @@ mcl_weather.skycolor = { player:set_sun({visible = true, sunrise_visible = true}) player:set_moon({visible = true}) player:set_stars({visible = true}) - player:override_day_night_ratio(nil) + mcl_weather.skycolor.override_day_night_ratio(player, nil) else -- Weather skies local day_color = mcl_weather.skycolor.get_sky_layer_color(0.5) @@ -99,7 +117,7 @@ mcl_weather.skycolor = { local lf = mcl_weather.get_current_light_factor() if mcl_weather.skycolor.current_layer_name() == "lightning" then - player:override_day_night_ratio(1) + mcl_weather.skycolor.override_day_night_ratio(player, 1) elseif lf then local w = minetest.get_timeofday() local light = (w * (lf*2)) @@ -107,9 +125,9 @@ mcl_weather.skycolor = { light = 1 - (light - 1) end light = (light * lf) + 0.15 - player:override_day_night_ratio(light) + mcl_weather.skycolor.override_day_night_ratio(player, light) else - player:override_day_night_ratio(nil) + mcl_weather.skycolor.override_day_night_ratio(player, nil) end end elseif dim == "end" then @@ -122,7 +140,7 @@ mcl_weather.skycolor = { player:set_sun({visible = false , sunrise_visible = false}) player:set_moon({visible = false}) player:set_stars({visible = false}) - player:override_day_night_ratio(0.5) + mcl_weather.skycolor.override_day_night_ratio(player, 0.5) elseif dim == "nether" then player:set_sky({ type = "plain", base_color = "#300808", @@ -131,7 +149,7 @@ mcl_weather.skycolor = { player:set_sun({visible = false , sunrise_visible = false}) player:set_moon({visible = false}) player:set_stars({visible = false}) - player:override_day_night_ratio(nil) + mcl_weather.skycolor.override_day_night_ratio(player, nil) elseif dim == "void" then player:set_sky({ type = "plain", base_color = "#000000", diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 263427921..1ffa8402f 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -211,16 +211,14 @@ minetest.register_globalstep(function(dtime) is_cat[player].timer = is_cat[player].timer + dtime if player:get_pos() then mcl_potions._add_spawner(player, "#1010AA") end - if minetest.get_timeofday() > 0.8 or minetest.get_timeofday() < 0.2 then - player:override_day_night_ratio(0.45) - else player:override_day_night_ratio(nil) - end if is_cat[player].timer >= is_cat[player].dur then is_cat[player] = nil meta = player:get_meta() meta:set_string("_is_cat", minetest.serialize(is_cat[player])) + meta:set_int("night_vision", 0) end + mcl_weather.skycolor.update_sky_color({player}) else is_cat[player] = nil @@ -366,7 +364,8 @@ function mcl_potions._reset_player_effects(player) playerphysics.remove_physics_factor(player, "speed", "mcl_potions:swiftness") is_cat[player] = nil - player:override_day_night_ratio(nil) + meta:set_int("night_vision", 0) + mcl_weather.skycolor.update_sky_color({player}) is_fire_proof[player] = nil @@ -826,6 +825,7 @@ end function mcl_potions.night_vision_func(player, null, duration) + meta = player:get_meta() if not is_cat[player] then is_cat[player] = {dur = duration, timer = 0} @@ -838,6 +838,8 @@ function mcl_potions.night_vision_func(player, null, duration) victim.timer = 0 end + meta:set_int("night_vision", 1) + mcl_weather.skycolor.update_sky_color({player}) end diff --git a/mods/ITEMS/mcl_potions/mod.conf b/mods/ITEMS/mcl_potions/mod.conf index 0fe50a64e..3d6fd0011 100644 --- a/mods/ITEMS/mcl_potions/mod.conf +++ b/mods/ITEMS/mcl_potions/mod.conf @@ -1,2 +1,2 @@ name = mcl_potions -depends = mcl_core, mcl_farming, mcl_mobitems, mcl_fishing, mcl_bows, mcl_end, playerphysics +depends = mcl_core, mcl_farming, mcl_mobitems, mcl_fishing, mcl_bows, mcl_end, mcl_weather, playerphysics From 3bdd95fe47bd8dee794d768ffc4bae51175b31ce Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 10:40:07 +0200 Subject: [PATCH 084/152] Change night vision description --- mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr | 2 +- mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr | 2 +- mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr | 2 +- mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr | 3 ++- mods/ITEMS/mcl_potions/locale/template.txt | 2 +- mods/ITEMS/mcl_potions/potions.lua | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr index 15ad88fc1..36f5280b9 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.de.tr @@ -84,7 +84,7 @@ Harming=Verletzung -12 HP=-12 TP Instantly deals damage.=Richtet sofort Schaden an. Night Vision=Nachtsicht -Grants the ability to see in darkness.=Gibt die Fähigkeit, in der Dunkelheit zu sehen. +Increases the perceived brightness of light under a dark sky.=Erhöht die wahrgenommene Helligkeit des Lichts unter einem dunklem Himmel. Swiftness=Schnelligkeit Increases walking speed.=Erhöht Gehgeschwindigkeit. Slowness=Langsamkeit diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr index 27a2cc04b..efa990247 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.es.tr @@ -84,7 +84,7 @@ Harming= -12 HP= Instantly deals damage.= Night Vision= -Grants the ability to see in darkness.= +Increases the perceived brightness of light under a dark sky.= Swiftness= Increases walking speed.= Slowness= diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr index 69c61493a..7cfe1f188 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.fr.tr @@ -84,7 +84,7 @@ Harming= -12 HP= Instantly deals damage.= Night Vision= -Grants the ability to see in darkness.= +Increases the perceived brightness of light under a dark sky.= Swiftness= Increases walking speed.= Slowness= diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr index 6a1d78c6e..9640e07dc 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr @@ -84,7 +84,7 @@ Harming=урона -12 HP=-12 HP Instantly deals damage.=Вызывает мгновенную смерть. Night Vision=ночного зрения -Grants the ability to see in darkness.=Даёт возможность видеть в темноте +Increases the perceived brightness of light under a dark sky.= Swiftness=ускорения Increases walking speed.=Увеличивает скорость ходьбы Slowness=замедления @@ -127,3 +127,4 @@ Weakness Splash Potion +=Взрывающееся зелье слабости + Strength Splash Potion=Взрывающееся зелье силы Strength Splash Potion II=Взрывающееся зелье силы II Strength Splash Potion +=Взрывающееся зелье силы + +Grants the ability to see in darkness.=Даёт возможность видеть в темноте diff --git a/mods/ITEMS/mcl_potions/locale/template.txt b/mods/ITEMS/mcl_potions/locale/template.txt index fda4a36c8..1420dabee 100644 --- a/mods/ITEMS/mcl_potions/locale/template.txt +++ b/mods/ITEMS/mcl_potions/locale/template.txt @@ -84,7 +84,7 @@ Harming= -12 HP= Instantly deals damage.= Night Vision= -Grants the ability to see in darkness.= +Increases the perceived brightness of light under a dark sky.= Swiftness= Increases walking speed.= Slowness= diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index f2fcbedfd..8b7380302 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -471,7 +471,7 @@ local night_vision_def = { name = "night_vision", description = S("Night Vision"), _tt = nil, - _longdesc = S("Grants the ability to see in darkness."), + _longdesc = S("Increases the perceived brightness of light under a dark sky."), color = "#1010AA", effect = nil, is_dur = true, From 1816324fe5d26d03bf78fdafcdf2e60b063fd352 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 10:53:44 +0200 Subject: [PATCH 085/152] Tweak night vision conditions --- mods/ENVIRONMENT/mcl_weather/skycolor.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_weather/skycolor.lua b/mods/ENVIRONMENT/mcl_weather/skycolor.lua index 8618bdbb7..6cc94b5c1 100644 --- a/mods/ENVIRONMENT/mcl_weather/skycolor.lua +++ b/mods/ENVIRONMENT/mcl_weather/skycolor.lua @@ -55,9 +55,13 @@ mcl_weather.skycolor = { -- Wrapper for updating day/night ratio that respects night vision override_day_night_ratio = function(player, ratio) local meta = player:get_meta() - local night_vision = meta:get_int("night_vision") + local has_night_vision = meta:get_int("night_vision") == 1 local arg - if night_vision == 1 then + -- Apply night vision only for dark sky + local is_dark = minetest.get_timeofday() > 0.8 or minetest.get_timeofday() < 0.2 or mcl_weather.state ~= "none" + local pos = player:get_pos() + local dim = mcl_worlds.pos_to_dimension(pos) + if has_night_vision and is_dark and dim ~= "nether" and dim ~= "end" then if ratio == nil then arg = NIGHT_VISION_RATIO else From b2e2f2793526016ec57fabf3b8980b9f66a09be2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 11:04:32 +0200 Subject: [PATCH 086/152] Add German translation for Sea Pickle --- mods/ITEMS/mcl_ocean/locale/mcl_ocean.de.tr | 1 + mods/ITEMS/mcl_ocean/locale/mcl_ocean.es.tr | 1 + 2 files changed, 2 insertions(+) diff --git a/mods/ITEMS/mcl_ocean/locale/mcl_ocean.de.tr b/mods/ITEMS/mcl_ocean/locale/mcl_ocean.de.tr index 79384cd71..fc7e8b56e 100644 --- a/mods/ITEMS/mcl_ocean/locale/mcl_ocean.de.tr +++ b/mods/ITEMS/mcl_ocean/locale/mcl_ocean.de.tr @@ -54,3 +54,4 @@ Grows in water on dirt, sand, gravel=Wächst im Wasser auf Erde, Sand, Kies Glows in the water=Leuchtet im Wasser 4 possible sizes=4 mögliche Größen Grows on dead brain coral block=Wächst auf totem Hirnkorallenblock +Sea Pickle=Meeresgurke diff --git a/mods/ITEMS/mcl_ocean/locale/mcl_ocean.es.tr b/mods/ITEMS/mcl_ocean/locale/mcl_ocean.es.tr index 1e27376c6..294da64b0 100644 --- a/mods/ITEMS/mcl_ocean/locale/mcl_ocean.es.tr +++ b/mods/ITEMS/mcl_ocean/locale/mcl_ocean.es.tr @@ -48,3 +48,4 @@ Corals fans grow on top of coral blocks and need to be inside a water source to Seagrass grows inside water on top of dirt, sand or gravel.=La hierba marina crece dentro del agua sobre tierra, arena o grava. A decorative block that serves as a great furnace fuel.=Un bloque decorativo que sirve como un gran combustible de horno. Dried kelp is a food item.=Las algas secas son un alimento. +Sea Pickle= From 80e54bf44db024b3d72083a2f45a35d5cff0cedb Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 12:20:12 +0200 Subject: [PATCH 087/152] Noteblock spawns note particle --- .../REDSTONE/mesecons_noteblock/init.lua | 37 ++++++++++++++++++ .../textures/mesecons_noteblock_note.png | Bin 0 -> 126 bytes 2 files changed, 37 insertions(+) create mode 100644 mods/ITEMS/REDSTONE/mesecons_noteblock/textures/mesecons_noteblock_note.png diff --git a/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua b/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua index f521638f5..a449a1495 100644 --- a/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua @@ -98,6 +98,32 @@ local soundnames_piano = { "mesecons_noteblock_b2", } +local function param2_to_note_color(param2) + local r, g, b + if param2 < 8 then -- 0..7 + -- More red, less green + r = param2 / 8 * 255 + g = (8-param2) / 8 * 255 + b = 0 + elseif param2 < 16 then -- 0..15 + -- More blue, less red + r = (8-(param2 - 8)) / 8 * 255 + g = 0 + b = (param2 - 8) / 8 * 255 + else -- 16..24 + -- More green, less blue + r = 0 + g = (param2 - 16) / 9 * 255 + b = (9-(param2 - 16)) / 9 * 255 + end + r = math.floor(r) + g = math.floor(g) + b = math.floor(b) + local color = 0x10000 * r + 0x100 * g + b + -- Convert to ColorString + return string.format("#%06X", color) +end + mesecon.noteblock_play = function (pos, param2) local block_above_name = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name if block_above_name ~= "air" then @@ -154,6 +180,17 @@ mesecon.noteblock_play = function (pos, param2) pitch = param2_to_pitch(param2) end + local note_color = param2_to_note_color(param2) + + minetest.add_particle({ + texture = "mesecons_noteblock_note.png^[colorize:"..note_color..":92", + pos = { x = pos.x, y = pos.y + 0.35, z = pos.z }, + velocity = { x = 0, y = 2, z = 0 }, + acceleration = { x = 0, y = -2, z = 0 }, + expirationtime = 1.0, + collisiondetection = false, + size = 3, + }) minetest.sound_play(soundname, {pos = pos, gain = 1.0, max_hear_distance = 48, pitch = pitch}) end diff --git a/mods/ITEMS/REDSTONE/mesecons_noteblock/textures/mesecons_noteblock_note.png b/mods/ITEMS/REDSTONE/mesecons_noteblock/textures/mesecons_noteblock_note.png new file mode 100644 index 0000000000000000000000000000000000000000..9fb2c923a1a6b570662f468c22f0137ba5568164 GIT binary patch literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^93afZ3?z3ZhDiV^o&cW^S0HU~XRWKFEhj5;dikkN zAfK@$$S;_|;n|HeAVfod5%UHx3vIVCg!0O$Q9lK=n! literal 0 HcmV?d00001 From f91ae540c26f2294890cb44bd5fee1e3085bc576 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 12:56:54 +0200 Subject: [PATCH 088/152] Add leafdecay and anvil damage particles --- mods/ITEMS/mcl_anvils/init.lua | 43 +++++++++++++++++++++ mods/ITEMS/mcl_core/functions.lua | 62 +++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index 7eb31f4d1..e3f9cc41e 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -212,6 +212,46 @@ local function drop_anvil_items(pos, meta) end end +local function damage_particles(pos, node) + minetest.add_particlespawner({ + amount = 30, + time = 0.1, + minpos = vector.add(pos, {x=-0.5, y=-0.5, z=-0.5}), + maxpos = vector.add(pos, {x=0.5, y=-0.25, z=0.5}), + minvel = {x=-0.5, y=0.05, z=-0.5}, + maxvel = {x=0.5, y=0.3, z=0.5}, + minacc = {x=0, y=-9.81, z=0}, + maxacc = {x=0, y=-9.81, z=0}, + minexptime = 0.1, + maxexptime = 0.5, + minsize = 0.4, + maxsize = 0.5, + collisiondetection = true, + vertical = false, + node = node, + }) +end + +local function destroy_particles(pos, node) + minetest.add_particlespawner({ + amount = math.random(20, 30), + time = 0.1, + minpos = vector.add(pos, {x=-0.4, y=-0.4, z=-0.4}), + maxpos = vector.add(pos, {x=0.4, y=0.4, z=0.4}), + minvel = {x=-0.5, y=-0.1, z=-0.5}, + maxvel = {x=0.5, y=0.2, z=0.5}, + minacc = {x=0, y=-9.81, z=0}, + maxacc = {x=0, y=-9.81, z=0}, + minexptime = 0.2, + maxexptime = 0.65, + minsize = 0.8, + maxsize = 1.2, + collisiondetection = true, + vertical = false, + node = node, + }) +end + -- Damage the anvil by 1 level. -- Destroy anvil when at highest damage level. -- Returns true if anvil was destroyed. @@ -220,10 +260,12 @@ local function damage_anvil(pos) local new if node.name == "mcl_anvils:anvil" then minetest.swap_node(pos, {name="mcl_anvils:anvil_damage_1", param2=node.param2}) + damage_particles(pos, node) minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dig, {pos=pos, max_hear_distance=16}, true) return false elseif node.name == "mcl_anvils:anvil_damage_1" then minetest.swap_node(pos, {name="mcl_anvils:anvil_damage_2", param2=node.param2}) + damage_particles(pos, node) minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dig, {pos=pos, max_hear_distance=16}, true) return false elseif node.name == "mcl_anvils:anvil_damage_2" then @@ -232,6 +274,7 @@ local function damage_anvil(pos) drop_anvil_items(pos, meta) minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dug, {pos=pos, max_hear_distance=16}, true) minetest.remove_node(pos) + destroy_particles(pos, node) minetest.check_single_for_falling({x=pos.x, y=pos.y+1, z=pos.z}) return true end diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index b0a604594..847b97001 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -1092,6 +1092,64 @@ minetest.register_abm({ action = grow_acacia, }) +local function leafdecay_particles(pos, node) + minetest.add_particlespawner({ + amount = math.random(10, 20), + time = 0.1, + minpos = vector.add(pos, {x=-0.4, y=-0.4, z=-0.4}), + maxpos = vector.add(pos, {x=0.4, y=0.4, z=0.4}), + minvel = {x=-0.2, y=-0.2, z=-0.2}, + maxvel = {x=0.2, y=0.1, z=0.2}, + minacc = {x=0, y=-9.81, z=0}, + maxacc = {x=0, y=-9.81, z=0}, + minexptime = 0.1, + maxexptime = 0.5, + minsize = 0.5, + maxsize = 1.5, + collisiondetection = true, + vertical = false, + node = node, + }) +end + +local function vinedecay_particles(pos, node) + local dir = minetest.wallmounted_to_dir(node.param2) + local relpos1, relpos2 + if dir.x < 0 then + relpos1 = { x = -0.45, y = -0.4, z = -0.5 } + relpos2 = { x = -0.4, y = 0.4, z = 0.5 } + elseif dir.x > 0 then + relpos1 = { x = 0.4, y = -0.4, z = -0.5 } + relpos2 = { x = 0.45, y = 0.4, z = 0.5 } + elseif dir.z < 0 then + relpos1 = { x = -0.5, y = -0.4, z = -0.45 } + relpos2 = { x = 0.5, y = 0.4, z = -0.4 } + elseif dir.z > 0 then + relpos1 = { x = -0.5, y = -0.4, z = 0.4 } + relpos2 = { x = 0.5, y = 0.4, z = 0.45 } + else + return + end + + minetest.add_particlespawner({ + amount = math.random(8, 16), + time = 0.1, + minpos = vector.add(pos, relpos1), + maxpos = vector.add(pos, relpos2), + minvel = {x=-0.2, y=-0.2, z=-0.2}, + maxvel = {x=0.2, y=0.1, z=0.2}, + minacc = {x=0, y=-9.81, z=0}, + maxacc = {x=0, y=-9.81, z=0}, + minexptime = 0.1, + maxexptime = 0.5, + minsize = 0.5, + maxsize = 1.0, + collisiondetection = true, + vertical = false, + node = node, + }) +end + --------------------- -- Vine generating -- --------------------- @@ -1105,6 +1163,7 @@ minetest.register_abm({ -- First of all, check if we are even supported, otherwise, let's die! if not mcl_core.check_vines_supported(pos, node) then minetest.remove_node(pos) + vinedecay_particles(pos, node) core.check_for_falling(pos) return end @@ -1267,6 +1326,7 @@ minetest.register_abm({ end -- Remove node minetest.remove_node(p0) + leafdecay_particles(p0, n0) core.check_for_falling(p0) -- Kill depending vines immediately to skip the vines decay delay @@ -1283,6 +1343,7 @@ minetest.register_abm({ local surround_inverse = vector.multiply(surround[s], -1) if maybe_vine.name == "mcl_core:vine" and (not mcl_core.check_vines_supported(spos, maybe_vine)) then minetest.remove_node(spos) + vinedecay_particles(spos, maybe_vine) core.check_for_falling(spos) end end @@ -1305,6 +1366,7 @@ minetest.register_abm({ if not mcl_core.check_vines_supported(p0, node) then -- Vines must die! minetest.remove_node(p0) + vinedecay_particles(p0, node) -- Just in case a falling node happens to float above vines core.check_for_falling(p0) end From 7f1e90ada9c27090c6b50ed3d1ba229c435f6e69 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 13:29:13 +0200 Subject: [PATCH 089/152] Move note particle to mcl_particles --- .../mcl_particles/textures/mcl_particles_note.png} | Bin mods/ITEMS/REDSTONE/mesecons_noteblock/depends.txt | 1 + mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) rename mods/{ITEMS/REDSTONE/mesecons_noteblock/textures/mesecons_noteblock_note.png => CORE/mcl_particles/textures/mcl_particles_note.png} (100%) diff --git a/mods/ITEMS/REDSTONE/mesecons_noteblock/textures/mesecons_noteblock_note.png b/mods/CORE/mcl_particles/textures/mcl_particles_note.png similarity index 100% rename from mods/ITEMS/REDSTONE/mesecons_noteblock/textures/mesecons_noteblock_note.png rename to mods/CORE/mcl_particles/textures/mcl_particles_note.png diff --git a/mods/ITEMS/REDSTONE/mesecons_noteblock/depends.txt b/mods/ITEMS/REDSTONE/mesecons_noteblock/depends.txt index acaa92412..77b6f4da3 100644 --- a/mods/ITEMS/REDSTONE/mesecons_noteblock/depends.txt +++ b/mods/ITEMS/REDSTONE/mesecons_noteblock/depends.txt @@ -1 +1,2 @@ mesecons +mcl_particles diff --git a/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua b/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua index a449a1495..279e98ba6 100644 --- a/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_noteblock/init.lua @@ -183,7 +183,7 @@ mesecon.noteblock_play = function (pos, param2) local note_color = param2_to_note_color(param2) minetest.add_particle({ - texture = "mesecons_noteblock_note.png^[colorize:"..note_color..":92", + texture = "mcl_particles_note.png^[colorize:"..note_color..":92", pos = { x = pos.x, y = pos.y + 0.35, z = pos.z }, velocity = { x = 0, y = 2, z = 0 }, acceleration = { x = 0, y = -2, z = 0 }, From fa9ce11ddd5a816161e57885b4ed0feabd05172c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 14:12:51 +0200 Subject: [PATCH 090/152] Move potion particles to mcl_particles --- .../textures/mcl_particles_bubble.png | Bin 938 -> 126 bytes .../textures/mcl_particles_droplet_bottle.png | Bin 0 -> 164 bytes .../textures/mcl_particles_effect.png | Bin 0 -> 137 bytes mods/ITEMS/mcl_potions/lingering.lua | 8 ++++---- mods/ITEMS/mcl_potions/splash.lua | 4 ++-- .../textures/mcl_potions_droplet.png | Bin 85 -> 0 bytes .../mcl_potions/textures/mcl_potions_sprite.png | Bin 1181 -> 0 bytes 7 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 mods/CORE/mcl_particles/textures/mcl_particles_droplet_bottle.png create mode 100644 mods/CORE/mcl_particles/textures/mcl_particles_effect.png delete mode 100644 mods/ITEMS/mcl_potions/textures/mcl_potions_droplet.png delete mode 100644 mods/ITEMS/mcl_potions/textures/mcl_potions_sprite.png diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_bubble.png b/mods/CORE/mcl_particles/textures/mcl_particles_bubble.png index c64ceea39088ba890107a6c0adf686899539f8bf..a29c95bbcb05900cf2194f2aceeea3900f568b36 100644 GIT binary patch delta 107 zcmZ3*UN=E9m5G6Y!8=#;4v=Ci3GxdD(m;^6jC~@IGWK+F45?sDR^SPXtuU(o-uh3p z`hx4joE9@hW> delta 926 zcmb*}E@v&fC(zV$Z4z zPk?M7V*qP1K9-UwH{nd&3Bi=46%=O!KRqeO-YxNZ< zqt*or9 zt*vcrY;0|9?d;3%$0s;a91A~Hsf`fxYLPA1AL&L(t!o$NOA|fIqBcr0CqNAf@Vq#)r zW8>oD;^X5J5)u*<6O)pXl9Q8DQc_Y=Q`6GY($mv3GBPqVGqbX?va_>ua&mHWbMx}@ z^7Hcx3JMAf3yX@1ii?X&N=iygOUug2fKIQdsHm*0udJ%7s;;iCsi~>0t*xu8tFNzb zXlQ6`Y;0<3YHn_BX=!O~ZEb67Yj1Dw=;-L|>;%S3cXxMBPfu@eZ(m`Dt01Z&_ba4!+n3J5~z$7y#MnI}# t=K_-%M>*3toLmm_7f4u_bxCyD+FT1Tr*mrSzWxif|Tq zL>4nJa0`PlBg3pY5H=O_9q;|JX{9PJ|-Rm3K@F3IEF}EPEL@pd2nW?@x%0U zb2#0_(_Mn6oH}qof%mDMsiEOa-pR>}j=Tz4ak80}fx&vZ0FV2RE;pcN22WQ%mvv4F FO#sV`EYko0 literal 0 HcmV?d00001 diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_effect.png b/mods/CORE/mcl_particles/textures/mcl_particles_effect.png new file mode 100644 index 0000000000000000000000000000000000000000..259e03c5deef04b7c48a4ef185245bd7a1d3f4f1 GIT binary patch literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^oIuRQ#0(^*v*+l71Oj|QT!Hk=nKRFvIdh`M<|mND zSQ6wH%;50sMjDW#=jq}YQo)#<5Pj%?!hsV9E|?r_T-dy{ap7Usj&Ku$9R?N#7He5f g85$TA_$DwgtkL1n&)s`%Do`hbr>mdKI;Vst0FE;$O8@`> literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index c74143233..cb327accc 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -29,9 +29,9 @@ minetest.register_globalstep(function(dtime) local d = 4 * (vals.timer / 30.0) local texture if vals.is_water then - texture = "mcl_potions_droplet.png" + texture = "mcl_particles_droplet_bottle.png" else - texture = "mcl_potions_sprite.png" + texture = "mcl_particles_effect.png" end minetest.add_particlespawner({ amount = 10 * d^2, @@ -141,11 +141,11 @@ minetest.register_entity(id.."_flying",{ add_lingering_effect(pos, color, def, name == "water") local texture, minacc, maxacc if name == "water" then - texture = "mcl_potions_droplet.png" + texture = "mcl_particles_droplet_bottle.png" minacc = {x=-0.2, y=-0.05, z=-0.2} maxacc = {x=0.2, y=0.05, z=0.2} else - texture = "mcl_potions_sprite.png" + texture = "mcl_particles_effect.png" minacc = {x=-0.2, y=0, z=-0.2} maxacc = {x=0.2, y=.05, z=0.2} end diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 2f7fbf77f..fb47ebd8a 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -68,10 +68,10 @@ function mcl_potions.register_splash(name, descr, color, def) minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) local texture, acc if name == "water" then - texture = "mcl_potions_droplet.png" + texture = "mcl_particles_droplet_bottle.png" acc = {x=0, y=-GRAVITY, z=0} else - texture = "mcl_potions_sprite.png" + texture = "mcl_particles_effect.png" acc = {x=0, y=0, z=0} end minetest.add_particlespawner({ diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_droplet.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_droplet.png deleted file mode 100644 index e85767d321eed3e6abdc309e04a13af21c7233db..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 85 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4$#}XrhEy;nOSn8ZGt-z?!6!h_ iXqkuNva8MP3=HSXl{RueN<0Tt$KdJe=d#Wzp$P!<;}w7a diff --git a/mods/ITEMS/mcl_potions/textures/mcl_potions_sprite.png b/mods/ITEMS/mcl_potions/textures/mcl_potions_sprite.png deleted file mode 100644 index 17391b1fd60aebe926edaadfdae5e5895c6b2b34..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1181 zcmds#ziU)c5QR?&!fr5YV`Z=p1Z@Vf5;P>3h=iCQgOtLkSjpG)5a~w76VtsB2cZr+c+O+EPV$q(`+~DA>&KOwYnSP@MG&uk^wm zd4S1n;=n%;ID{H8prPa_95hB7X|$@7>uqXQMpOrhKiX1dMi#kZ7Ya6`GKw5YngHP9 zI6>o>* z!T2xN--f#IIqq_Hd~faMRGNJ3XXg3RWPv{~uCH9#8O5c8_hVfieYkb>d+)`;bob}} z+UV7ZH|G|Q@4q~Gc=~wp)Q|0FPtT9vUYjl*eVY8z*DuQ#-t9j8-VE!j8!NAuZ$J72 DvG+&^ From 4acf953334cbe4c1e0704d60d5ff388fc63cee40 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 14:45:37 +0200 Subject: [PATCH 091/152] Add critical hit particles for bow --- .../textures/mcl_particles_crit.png | Bin 0 -> 128 bytes mods/ITEMS/mcl_bows/arrow.lua | 28 ++++++++++++++++++ mods/ITEMS/mcl_bows/bow.lua | 11 ++++--- mods/ITEMS/mcl_bows/depends.txt | 1 + 4 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 mods/CORE/mcl_particles/textures/mcl_particles_crit.png diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_crit.png b/mods/CORE/mcl_particles/textures/mcl_particles_crit.png new file mode 100644 index 0000000000000000000000000000000000000000..5b7fd3f6ef29a02c38e25dfd323c8a905b59abd2 GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1SGw4HSYi^wvr&fU?2?ydCS-*0x45Z7srqa z#^f2c)n%2Hmdrd1Hys2uUf= BOW_CHARGE_TIME_FULL then speed = BOW_MAX_SPEED local r = math.random(1,5) if r == 1 then -- 20% chance for critical hit damage = 10 + is_critical = true else damage = 9 end @@ -207,7 +210,7 @@ controls.register_on_release(function(player, key, time) damage = math.max(1, math.floor(9 * charge_ratio)) end - has_shot = player_shoot_arrow(wielditem, player, speed, damage) + has_shot = player_shoot_arrow(wielditem, player, speed, damage, is_critical) wielditem:set_name("mcl_bows:bow") if has_shot and not minetest.is_creative_enabled(player:get_player_name()) then diff --git a/mods/ITEMS/mcl_bows/depends.txt b/mods/ITEMS/mcl_bows/depends.txt index 08132ddbf..130c4acea 100644 --- a/mods/ITEMS/mcl_bows/depends.txt +++ b/mods/ITEMS/mcl_bows/depends.txt @@ -7,3 +7,4 @@ playerphysics? doc? doc_identifier? mesecons_button? +mcl_particles From de8183f07aeb44051a9751e3c1ad02f0c2008153 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 14:48:14 +0200 Subject: [PATCH 092/152] Fix German translation mistake --- mods/ITEMS/mcl_core/locale/mcl_core.de.tr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_core/locale/mcl_core.de.tr b/mods/ITEMS/mcl_core/locale/mcl_core.de.tr index 2092fa337..57ef530a0 100644 --- a/mods/ITEMS/mcl_core/locale/mcl_core.de.tr +++ b/mods/ITEMS/mcl_core/locale/mcl_core.de.tr @@ -41,7 +41,7 @@ Block of Gold=Goldblock Block of Iron=Eisenblock Blocks of coal are useful as a compact storage of coal and very useful as a furnace fuel. A block of coal is as efficient as 10 coal.=Kohleblöcke sind für eine kompakte Aufbewahrung von Kohle nützlich und sehr nützlich als Ofenbrennstoff. Ein Kohleblock ist so effizient wie 10 mal Kohle. Blue Stained Glass=Blaues Buntglas -Bone Block=Knockenblock +Bone Block=Knochenblock Bone blocks are decorative blocks and a compact storage of bone meal.=Knochenblöcke sind Deko-Blöcke und geeignet zur kompakten Aufbewahrung von Knochenmehl. Bowl=Schale Bowls are mainly used to hold tasty soups.=Schalen werden hauptsächlich für leckere Suppen gebraucht. From 988056ad08c57288a09afe1ac54f67d97d7592c0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 15:05:23 +0200 Subject: [PATCH 093/152] Fix bow in creative mode not having inf. ammo --- mods/ITEMS/mcl_bows/bow.lua | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mods/ITEMS/mcl_bows/bow.lua b/mods/ITEMS/mcl_bows/bow.lua index 12c99b358..9f49eb158 100644 --- a/mods/ITEMS/mcl_bows/bow.lua +++ b/mods/ITEMS/mcl_bows/bow.lua @@ -75,24 +75,30 @@ end local player_shoot_arrow = function(itemstack, player, power, damage, is_critical) local arrow_stack, arrow_stack_id = get_arrow(player) - local arrow_itemstring = arrow_stack:get_name() + local arrow_itemstring - if not minetest.is_creative_enabled(player:get_player_name()) then + if minetest.is_creative_enabled(player:get_player_name()) then + if arrow_stack then + arrow_itemstring = arrow_stack:get_name() + else + arrow_itemstring = "mcl_bows:arrow" + end + else if not arrow_stack then return false end - -- arrow_itemstring = arrow_stack:get_name() + arrow_itemstring = arrow_stack:get_name() arrow_stack:take_item() local inv = player:get_inventory() inv:set_stack("main", arrow_stack_id, arrow_stack) end + if not arrow_itemstring then + return false + end local playerpos = player:get_pos() local dir = player:get_look_dir() local yaw = player:get_look_horizontal() - if not arrow_itemstring then - arrow_itemstring = "mcl_bows:arrow" - end mcl_bows.shoot_arrow(arrow_itemstring, {x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, dir, yaw, player, power, damage, is_critical) return true end @@ -222,14 +228,14 @@ controls.register_on_release(function(player, key, time) end) controls.register_on_hold(function(player, key, time) - if key ~= "RMB" or not get_arrow(player) then + local name = player:get_player_name() + local creative = minetest.is_creative_enabled(name) + if key ~= "RMB" or not (creative or get_arrow(player)) then return end - local name = player:get_player_name() local inv = minetest.get_inventory({type="player", name=name}) local wielditem = player:get_wielded_item() - local creative = minetest.is_creative_enabled(name) - if bow_load[name] == nil and wielditem:get_name()=="mcl_bows:bow" and (creative or get_arrow(player)) then --inv:contains_item("main", "mcl_bows:arrow")) then + if bow_load[name] == nil and wielditem:get_name()=="mcl_bows:bow" and (creative or get_arrow(player)) then wielditem:set_name("mcl_bows:bow_0") player:set_wielded_item(wielditem) if minetest.get_modpath("playerphysics") then From b14eb70241661035c3f4aea6bdf93da613dba004 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 16:27:56 +0200 Subject: [PATCH 094/152] Add after_rotate in screwdriver API --- mods/ITEMS/screwdriver/API.md | 8 ++++++++ mods/ITEMS/screwdriver/init.lua | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/mods/ITEMS/screwdriver/API.md b/mods/ITEMS/screwdriver/API.md index 03cc6fdd4..0c17ee683 100644 --- a/mods/ITEMS/screwdriver/API.md +++ b/mods/ITEMS/screwdriver/API.md @@ -18,3 +18,11 @@ To use it, add the `on_rotate` function to the node definition. * use `on_rotate = false` to always disallow rotation * use `on_rotate = screwdriver.rotate_simple` to allow only face rotation * use `on_rotate = screwdriver.rotate_3way` (MineClone 2 extension) for pillar-like nodes that should only have 3 possible orientations) + + + +`after_rotate(pos)` (MineClone 2 extension) + +Called after the rotation has been completed + + * `pos`: Position of the node that the screwdriver was used on diff --git a/mods/ITEMS/screwdriver/init.lua b/mods/ITEMS/screwdriver/init.lua index 1fb9745ab..ec4f1a2ad 100644 --- a/mods/ITEMS/screwdriver/init.lua +++ b/mods/ITEMS/screwdriver/init.lua @@ -157,7 +157,11 @@ screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses) if should_rotate and new_param2 ~= node.param2 then node.param2 = new_param2 minetest.swap_node(pos, node) + minetest.check_for_falling(pos) + if ndef.after_rotate then + ndef.after_rotate(vector.new(pos)) + end end if not (minetest.is_creative_enabled(user:get_player_name())) then From 2a1273b7e3f81e626e1a992d548dc90196d5f515 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 16:29:20 +0200 Subject: [PATCH 095/152] Add flame particles to torches and furnaces --- mods/CORE/mcl_particles/init.lua | 35 +++++++ .../textures/mcl_particles_flame.png | Bin 0 -> 145 bytes mods/ITEMS/mcl_furnaces/depends.txt | 1 + mods/ITEMS/mcl_furnaces/init.lua | 63 +++++++++++- mods/ITEMS/mcl_torches/depends.txt | 1 + mods/ITEMS/mcl_torches/init.lua | 97 +++++++++++++++++- 6 files changed, 191 insertions(+), 6 deletions(-) create mode 100644 mods/CORE/mcl_particles/textures/mcl_particles_flame.png diff --git a/mods/CORE/mcl_particles/init.lua b/mods/CORE/mcl_particles/init.lua index e69de29bb..f4ebd85e5 100644 --- a/mods/CORE/mcl_particles/init.lua +++ b/mods/CORE/mcl_particles/init.lua @@ -0,0 +1,35 @@ +local particle_nodes = {} + +mcl_particles = {} + +-- Add a particlespawner that is assigned to a given node position. +-- * pos: Node positon. MUST use rounded values! +-- * particlespawner_definition: definition for minetest.add_particlespawner +-- NOTE: All particlespawners are automatically removed on shutdown. +-- Returns particlespawner ID on succcess and nil on failure +function mcl_particles.add_node_particlespawner(pos, particlespawner_definition) + local poshash = minetest.hash_node_position(pos) + if not poshash then + return + end + local id = minetest.add_particlespawner(particlespawner_definition) + if id == -1 then + return + end + particle_nodes[poshash] = id + return id +end + +-- Deleted a particlespawner that is assigned to a node position, if one exists. +-- Otherwise, this does nothing. +-- pos: Node positon. MUST use rounded values! +-- Returns true if particlespawner could be removed and false if none existed +function mcl_particles.delete_node_particlespawner(pos) + local poshash = minetest.hash_node_position(pos) + local id = particle_nodes[poshash] + if id then + minetest.delete_particlespawner(id) + return true + end + return false +end diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_flame.png b/mods/CORE/mcl_particles/textures/mcl_particles_flame.png new file mode 100644 index 0000000000000000000000000000000000000000..92efed2900df9263e78e43c7dd8df18c42b57de1 GIT binary patch literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^93afX3?$7I7w-U4q5(c3u89QOl|geZ%dOL4hT%Y644$rjF6*2UngD*~EkFPO literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_furnaces/depends.txt b/mods/ITEMS/mcl_furnaces/depends.txt index 365076c1f..ca05945f1 100644 --- a/mods/ITEMS/mcl_furnaces/depends.txt +++ b/mods/ITEMS/mcl_furnaces/depends.txt @@ -4,5 +4,6 @@ mcl_core mcl_sounds mcl_craftguide mcl_achievements +mcl_particles doc? screwdriver? diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index cb797ff91..b2d69ad1d 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -1,6 +1,8 @@ local S = minetest.get_translator("mcl_furnaces") +local LIGHT_ACTIVE_FURNACE = 13 + -- -- Formspecs -- @@ -346,9 +348,48 @@ local function furnace_node_timer(pos, elapsed) return result end -local on_rotate +local function spawn_flames(pos, param2) + local minrelpos, maxrelpos + local dir = minetest.facedir_to_dir(param2) + if dir.x > 0 then + minrelpos = { x = -0.6, y = -0.05, z = -0.25 } + maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } + elseif dir.x < 0 then + minrelpos = { x = 0.55, y = -0.05, z = -0.25 } + maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } + elseif dir.z > 0 then + minrelpos = { x = -0.25, y = -0.05, z = -0.6 } + maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } + elseif dir.z < 0 then + minrelpos = { x = -0.25, y = -0.05, z = 0.55 } + maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } + else + return + end + mcl_particles.add_node_particlespawner(pos, { + amount = 4, + time = 0, + minpos = vector.add(pos, minrelpos), + maxpos = vector.add(pos, maxrelpos), + minvel = { x = -0.01, y = 0, z = -0.01 }, + maxvel = { x = 0.01, y = 0.1, z = 0.01 }, + minexptime = 0.3, + maxexptime = 0.6, + minsize = 0.4, + maxsize = 0.8, + texture = "mcl_particles_flame.png", + glow = LIGHT_ACTIVE_FURNACE, + }) +end + +local on_rotate, after_rotate_active if minetest.get_modpath("screwdriver") then on_rotate = screwdriver.rotate_simple + after_rotate_active = function(pos) + local node = minetest.get_node(pos) + mcl_particles.delete_node_particlespawner(pos) + spawn_flames(pos, node.param2) + end end minetest.register_node("mcl_furnaces:furnace", { @@ -431,7 +472,7 @@ minetest.register_node("mcl_furnaces:furnace_active", { }, paramtype2 = "facedir", paramtype = "light", - light_source = 13, + light_source = LIGHT_ACTIVE_FURNACE, drop = "mcl_furnaces:furnace", groups = {pickaxey=1, container=4, deco_block=1, not_in_creative_inventory=1, material_stone=1}, is_ground_content = false, @@ -453,6 +494,13 @@ minetest.register_node("mcl_furnaces:furnace_active", { meta:from_table(meta2:to_table()) end, + on_construct = function(pos) + local node = minetest.get_node(pos) + spawn_flames(pos, node.param2) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawner(pos) + end, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_move = allow_metadata_inventory_move, @@ -462,6 +510,7 @@ minetest.register_node("mcl_furnaces:furnace_active", { _mcl_blast_resistance = 3.5, _mcl_hardness = 3.5, on_rotate = on_rotate, + after_rotate = after_rotate_active, }) minetest.register_craft({ @@ -478,6 +527,16 @@ if minetest.get_modpath("doc") then doc.add_entry_alias("nodes", "mcl_furnaces:furnace", "nodes", "mcl_furnaces:furnace_active") end +minetest.register_lbm({ + label = "Active furnace flame particles", + name = "mcl_furnaces:flames", + nodenames = {"mcl_furnaces:furnace_active"}, + run_at_every_load = true, + action = function(pos, node) + spawn_flames(pos, node.param2) + end, +}) + -- Legacy minetest.register_lbm({ label = "Update furnace formspecs (0.60.0", diff --git a/mods/ITEMS/mcl_torches/depends.txt b/mods/ITEMS/mcl_torches/depends.txt index cbc0405cc..d15228bce 100644 --- a/mods/ITEMS/mcl_torches/depends.txt +++ b/mods/ITEMS/mcl_torches/depends.txt @@ -1,3 +1,4 @@ mcl_core mcl_sounds +mcl_particles doc? diff --git a/mods/ITEMS/mcl_torches/init.lua b/mods/ITEMS/mcl_torches/init.lua index 86cb917b9..c9ec1370c 100644 --- a/mods/ITEMS/mcl_torches/init.lua +++ b/mods/ITEMS/mcl_torches/init.lua @@ -1,4 +1,60 @@ local S = minetest.get_translator("mcl_torches") +local LIGHT_TORCH = minetest.LIGHT_MAX + +local spawn_flames_floor = function(pos) + return mcl_particles.add_node_particlespawner(pos, { + amount = 8, + time = 0, + minpos = vector.add(pos, { x = -0.1, y = 0.05, z = -0.1 }), + maxpos = vector.add(pos, { x = 0.1, y = 0.15, z = 0.1 }), + minvel = { x = -0.01, y = 0, z = -0.01 }, + maxvel = { x = 0.01, y = 0.1, z = 0.01 }, + minexptime = 0.3, + maxexptime = 0.6, + minsize = 0.7, + maxsize = 2, + texture = "mcl_particles_flame.png", + glow = LIGHT_TORCH, + }) +end + +local spawn_flames_wall = function(pos, param2) + local minrelpos, maxrelpos + local dir = minetest.wallmounted_to_dir(param2) + if dir.x < 0 then + minrelpos = { x = -0.38, y = 0.04, z = -0.1 } + maxrelpos = { x = -0.2, y = 0.14, z = 0.1 } + elseif dir.x > 0 then + minrelpos = { x = 0.2, y = 0.04, z = -0.1 } + maxrelpos = { x = 0.38, y = 0.14, z = 0.1 } + elseif dir.z < 0 then + minrelpos = { x = -0.1, y = 0.04, z = -0.38 } + maxrelpos = { x = 0.1, y = 0.14, z = -0.2 } + elseif dir.z > 0 then + minrelpos = { x = -0.1, y = 0.04, z = 0.2 } + maxrelpos = { x = 0.1, y = 0.14, z = 0.38 } + else + return + end + return mcl_particles.add_node_particlespawner(pos, { + amount = 8, + time = 0, + minpos = vector.add(pos, minrelpos), + maxpos = vector.add(pos, maxrelpos), + minvel = { x = -0.01, y = 0, z = -0.01 }, + maxvel = { x = 0.01, y = 0.1, z = 0.01 }, + minexptime = 0.3, + maxexptime = 0.6, + minsize = 0.7, + maxsize = 2, + texture = "mcl_particles_flame.png", + glow = LIGHT_TORCH, + }) +end + +local remove_flames = function(pos) + mcl_particles.delete_node_particlespawner(pos) +end -- -- 3d torch part @@ -43,7 +99,7 @@ end mcl_torches = {} -mcl_torches.register_torch = function(substring, description, doc_items_longdesc, doc_items_usagehelp, icon, mesh_floor, mesh_wall, tiles, light, groups, sounds, moredef) +mcl_torches.register_torch = function(substring, description, doc_items_longdesc, doc_items_usagehelp, icon, mesh_floor, mesh_wall, tiles, light, groups, sounds, moredef, moredef_floor, moredef_wall) local itemstring = minetest.get_current_modname()..":"..substring local itemstring_wall = minetest.get_current_modname()..":"..substring.."_wall" @@ -138,6 +194,11 @@ mcl_torches.register_torch = function(substring, description, doc_items_longdesc floordef[k] = v end end + if moredef_floor ~= nil then + for k,v in pairs(moredef_floor) do + floordef[k] = v + end + end minetest.register_node(itemstring, floordef) local groups_wall = table.copy(groups) @@ -169,6 +230,11 @@ mcl_torches.register_torch = function(substring, description, doc_items_longdesc walldef[k] = v end end + if moredef_wall ~= nil then + for k,v in pairs(moredef_wall) do + walldef[k] = v + end + end minetest.register_node(itemstring_wall, walldef) @@ -189,11 +255,20 @@ mcl_torches.register_torch("torch", name = "default_torch_on_floor_animated.png", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.3} }}, - minetest.LIGHT_MAX, + LIGHT_TORCH, {dig_immediate=3, torch=1, deco_block=1}, mcl_sounds.node_sound_wood_defaults(), - {_doc_items_hidden = false}) - + {_doc_items_hidden = false, + on_destruct = function(pos) + remove_flames(pos) + end}, + {on_construct = function(pos) + spawn_flames_floor(pos) + end}, + {on_construct = function(pos) + local node = minetest.get_node(pos) + spawn_flames_wall(pos, node.param2) + end}) minetest.register_craft({ output = "mcl_torches:torch 4", @@ -203,3 +278,17 @@ minetest.register_craft({ } }) +minetest.register_lbm({ + label = "Torch flame particles", + name = "mcl_torches:flames", + nodenames = {"mcl_torches:torch", "mcl_torches:torch_wall"}, + run_at_every_load = true, + action = function(pos, node) + if node.name == "mcl_torches:torch" then + spawn_flames_floor(pos) + elseif node.name == "mcl_torches:torch_wall" then + spawn_flames_wall(pos, node.param2) + end + end, +}) + From 9f43d6a5a5b19bd35f15849eaafdac000009a712 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 16:37:28 +0200 Subject: [PATCH 096/152] Add setting to disable node particles --- mods/CORE/mcl_particles/init.lua | 9 +++++++++ settingtypes.txt | 3 +++ 2 files changed, 12 insertions(+) diff --git a/mods/CORE/mcl_particles/init.lua b/mods/CORE/mcl_particles/init.lua index f4ebd85e5..4a89d733e 100644 --- a/mods/CORE/mcl_particles/init.lua +++ b/mods/CORE/mcl_particles/init.lua @@ -2,12 +2,18 @@ local particle_nodes = {} mcl_particles = {} +-- Node particles can be disabled via setting +local node_particles_allowed = minetest.settings:get_bool("mcl_node_particles", true) + -- Add a particlespawner that is assigned to a given node position. -- * pos: Node positon. MUST use rounded values! -- * particlespawner_definition: definition for minetest.add_particlespawner -- NOTE: All particlespawners are automatically removed on shutdown. -- Returns particlespawner ID on succcess and nil on failure function mcl_particles.add_node_particlespawner(pos, particlespawner_definition) + if not node_particles_allowed then + return + end local poshash = minetest.hash_node_position(pos) if not poshash then return @@ -25,6 +31,9 @@ end -- pos: Node positon. MUST use rounded values! -- Returns true if particlespawner could be removed and false if none existed function mcl_particles.delete_node_particlespawner(pos) + if not node_particles_allowed then + return false + end local poshash = minetest.hash_node_position(pos) local id = particle_nodes[poshash] if id then diff --git a/settingtypes.txt b/settingtypes.txt index 0b6ffb742..1e2129cec 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -27,6 +27,9 @@ mcl_doTileDrops (Blocks have drops) bool true # If enabled, TNT explosions destroy blocks. mcl_tnt_griefing (TNT destroys blocks) bool true +# If enabled, some blocks will emit decorative particles like flames. +mcl_node_particles (Block particles) bool true + [Players] # If enabled, players respawn at the bed they last lay on instead of normal # spawn. From 91d174b4378663b205f483e15d8e25c544a7b3fd Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 17:07:53 +0200 Subject: [PATCH 097/152] Fix incorrect particle name in mcl_potions --- mods/ITEMS/mcl_potions/functions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 1ffa8402f..317744e2f 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -555,7 +555,7 @@ function mcl_potions._use_potion(item, obj, color) maxsize = 1, collisiondetection = true, vertical = false, - texture = "mcl_potions_sprite.png^[colorize:"..color..":127", + texture = "mcl_particles_effect.png^[colorize:"..color..":127", }) end @@ -578,7 +578,7 @@ function mcl_potions._add_spawner(obj, color) maxsize = 1, collisiondetection = false, vertical = false, - texture = "mcl_potions_sprite.png^[colorize:"..color..":127", + texture = "mcl_particles_effect.png^[colorize:"..color..":127", }) end From 7c0c0d4d0c17c7b4d57e1fef32f907c2a97a41f0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 17:37:41 +0200 Subject: [PATCH 098/152] Change particle for instant effects --- .../textures/mcl_particles_crit.png | Bin 128 -> 127 bytes .../textures/mcl_particles_droplet_bottle.png | Bin 164 -> 91 bytes .../textures/mcl_particles_instant_effect.png | Bin 0 -> 125 bytes mods/ITEMS/mcl_potions/lingering.lua | 10 ++++++++-- mods/ITEMS/mcl_potions/potions.lua | 14 ++++++++++++++ mods/ITEMS/mcl_potions/splash.lua | 6 +++++- 6 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 mods/CORE/mcl_particles/textures/mcl_particles_instant_effect.png diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_crit.png b/mods/CORE/mcl_particles/textures/mcl_particles_crit.png index 5b7fd3f6ef29a02c38e25dfd323c8a905b59abd2..25d5615b292b0a929c40869a6222b01ca2aeb8ce 100644 GIT binary patch delta 79 zcmZo*te;@!Y2xYP7*fHQe1JXe{Jhw>IKJmhHys2uUf=4$rBm(iTt4jB!Tc_Oa>tEboFyt=akR{0JFVdQ&MBb@09Jz&O8@`> delta 135 zcma!E!Z<;to-N7S-GxD&A&{YgE2aMo0|NtRfk$L90|U1(2s1Lwnj--eWH0gbb!C6T zA~*2NZap+L;;}&g7k( kyy(cQkQFDJSs56trwj17|LAf9YG&|s^>bP0l)%^o01q}Py#N3J diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_instant_effect.png b/mods/CORE/mcl_particles/textures/mcl_particles_instant_effect.png new file mode 100644 index 0000000000000000000000000000000000000000..bae450282c44fee7f70ac6b96b2937bc645c280b GIT binary patch literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1SGw4HSYi^wvr&fU?2?ydCS-*0x2U;7srqa z#^eL+Y3Jwl20yv6G5P7!rw(irST-$ORA3jN=)$_|+xqzZPCSZBm@o6ytYc!hCakYe S{@<<}WQwP&pUXO@geCw;wInwH literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index cb327accc..bfeff88f6 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -10,7 +10,7 @@ end local lingering_effect_at = {} -local function add_lingering_effect(pos, color, def, is_water) +local function add_lingering_effect(pos, color, def, is_water, instant) lingering_effect_at[pos] = {color = color, timer = 30, def = def, is_water = is_water} @@ -30,6 +30,8 @@ minetest.register_globalstep(function(dtime) local texture if vals.is_water then texture = "mcl_particles_droplet_bottle.png" + elseif vals.def.instant then + texture = "mcl_particles_instant_effect.png" else texture = "mcl_particles_effect.png" end @@ -145,7 +147,11 @@ minetest.register_entity(id.."_flying",{ minacc = {x=-0.2, y=-0.05, z=-0.2} maxacc = {x=0.2, y=0.05, z=0.2} else - texture = "mcl_particles_effect.png" + if def.instant then + texture = "mcl_particles_instant_effect.png" + else + texture = "mcl_particles_effect.png" + end minacc = {x=-0.2, y=0, z=-0.2} maxacc = {x=0.2, y=.05, z=0.2} end diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 8b7380302..9202196a8 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -177,6 +177,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_splash_fun(def.effect, splash_dur), no_effect = def.no_effect, + instant = def.instant, } local ling_def @@ -186,6 +187,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_lingering_fun(def.effect*mcl_potions.LINGERING_FACTOR, ling_dur), no_effect = def.no_effect, + instant = def.instant, } else ling_def = { @@ -193,6 +195,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_lingering_fun(def.effect, ling_dur), no_effect = def.no_effect, + instant = def.instant, } end @@ -201,6 +204,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_arrow_fun(def.effect, dur/8.), no_effect = def.no_effect, + instant = def.instant, } if def.color and not def.no_throwable then @@ -270,6 +274,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_splash_fun(7, splash_dur_2), no_effect = def.no_effect, + instant = def.instant, } else splash_def_2 = { @@ -277,6 +282,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_splash_fun(effect_II, splash_dur_2), no_effect = def.no_effect, + instant = def.instant, } end @@ -288,6 +294,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_lingering_fun(effect_II*mcl_potions.LINGERING_FACTOR, ling_dur_2), no_effect = def.no_effect, + instant = def.instant, } else ling_def_2 = { @@ -295,6 +302,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_lingering_fun(effect_II, ling_dur_2), no_effect = def.no_effect, + instant = def.instant, } end @@ -303,6 +311,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_arrow_fun(effect_II, dur_2/8.), no_effect = def.no_effect, + instant = def.instant, } if def.color and not def.no_throwable then @@ -346,18 +355,21 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_splash_fun(def.effect, splash_dur_pl), no_effect = def.no_effect, + instant = def.instant, } local ling_def_pl = { tt = get_tt(def._tt_plus, def.effect, ling_dur_pl), longdesc = def._longdesc, potion_fun = get_lingering_fun(def.effect, ling_dur_pl), no_effect = def.no_effect, + instant = def.instant, } local arrow_def_pl = { tt = get_tt(def._tt_pl, def.effect, dur_pl/8.), longdesc = def._longdesc, potion_fun = get_arrow_fun(def.effect, dur_pl/8.), no_effect = def.no_effect, + instant = def.instant, } if def.color and not def.no_throwable then mcl_potions.register_splash(def.name.."_plus", S("Splash @1 + Potion", def.description), def.color, splash_def_pl) @@ -449,6 +461,7 @@ local healing_def = { _longdesc = S("Instantly heals."), color = "#CC0000", effect = 4, + instant = true, on_use = mcl_potions.healing_func, is_II = true, } @@ -462,6 +475,7 @@ local harming_def = { _longdesc = S("Instantly deals damage."), color = "#660099", effect = -6, + instant = true, on_use = mcl_potions.healing_func, is_II = true, is_inv = true, diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index fb47ebd8a..14c7f455e 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -71,7 +71,11 @@ function mcl_potions.register_splash(name, descr, color, def) texture = "mcl_particles_droplet_bottle.png" acc = {x=0, y=-GRAVITY, z=0} else - texture = "mcl_particles_effect.png" + if def.instant then + texture = "mcl_particles_instant_effect.png" + else + texture = "mcl_particles_effect.png" + end acc = {x=0, y=0, z=0} end minetest.add_particlespawner({ From 28aead0a60c1e7454a93a55d7ef168c25a840127 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 18:31:45 +0200 Subject: [PATCH 099/152] Tweak mob death particles --- mods/ENTITIES/mcl_mobs/api.lua | 34 ++++++++++++++++++++++++++++-- mods/ENTITIES/mcl_mobs/api.txt | 8 ++++++- mods/ENTITIES/mobs_mc/creeper.lua | 1 + mods/ENTITIES/mobs_mc/enderman.lua | 5 +++-- mods/ENTITIES/mobs_mc/horse.lua | 2 ++ mods/ENTITIES/mobs_mc/llama.lua | 1 + mods/ENTITIES/mobs_mc/pig.lua | 2 +- mods/ENTITIES/mobs_mc/snowman.lua | 25 +++++++++++++++++++++- mods/ENTITIES/mobs_mc/villager.lua | 1 + 9 files changed, 72 insertions(+), 7 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index ad112ef58..aa5809cdc 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -495,6 +495,31 @@ local damage_effect = function(self, damage) end end +mobs.death_effect = function(pos, collisionbox) + local min, max + if collisionbox then + min = {x=collisionbox[1], y=collisionbox[2], z=collisionbox[3]} + max = {x=collisionbox[4], y=collisionbox[5], z=collisionbox[6]} + else + min = { x = -0.5, y = 0, z = -0.5 } + max = { x = 0.5, y = 0.5, z = 0.5 } + end + + minetest.add_particlespawner({ + amount = 40, + time = 0.1, + minpos = vector.add(pos, min), + maxpos = vector.add(pos, max), + minvel = {x = -0.2, y = -0.1, z = -0.2}, + maxvel = {x = 0.2, y = 0.1, z = 0.2}, + minexptime = 0.5, + maxexptime = 1.5, + minsize = 0.5, + maxsize = 1.5, + texture = "tnt_smoke.png", + }) +end + local update_tag = function(self) self.object:set_properties({ nametag = self.nametag, @@ -629,6 +654,11 @@ local check_for_death = function(self, cause, cmi_cause) return true end + local collisionbox + if self.collisionbox then + collisionbox = table.copy(self.collisionbox) + end + -- default death function and die animation (if defined) if self.animation and self.animation.die_start @@ -656,6 +686,7 @@ local check_for_death = function(self, cause, cmi_cause) end self.object:remove() + mobs.death_effect(pos) end, self) else @@ -664,10 +695,9 @@ local check_for_death = function(self, cause, cmi_cause) end self.object:remove() + mobs.death_effect(pos, collisionbox) end - effect(pos, 20, "tnt_smoke.png") - return true end diff --git a/mods/ENTITIES/mcl_mobs/api.txt b/mods/ENTITIES/mcl_mobs/api.txt index 8b7f71192..e585c9950 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -283,7 +283,9 @@ Along with the above mob registry settings we can also use custom functions to enhance mob functionality and have them do many interesting things: 'on_die' a function that is called when the mob is killed the - parameters are (self, pos) + parameters are (self, pos). When this function is used, + the death particles will be skipped on death. You can get + them back by calling mobs:death_effect manually 'on_rightclick' its same as in minetest.register_entity() 'on_blast' is called when an explosion happens near mob when using TNT functions, parameters are (object, damage) and returns @@ -410,6 +412,10 @@ This function spawns a mob as a child. The parameter mob_type is the entitystring of the new mob. This function returns the mob on success and nil otherwise. +mobs:death_effect(pos, collisionbox) + +Create death particles at pos with the given collisionbox. + Making Arrows ------------- diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index c1d582bb0..ddba6523e 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -81,6 +81,7 @@ mobs:register_mob("mobs_mc:creeper", { local r = math.random(1, #mobs_mc.items.music_discs) minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, mobs_mc.items.music_discs[r]) end + mobs.death_effect(pos, self.collisionbox) end, maxdrops = 2, drops = { diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index 3ecff4e38..3f62bdb2a 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -267,8 +267,8 @@ mobs:register_mob("mobs_mc:enderman", { self.state = "" else if self.attack then - target = self.attack - pos = target:get_pos() + local target = self.attack + local pos = target:get_pos() if pos ~= nil then if vector.distance(self.object:get_pos(), target:get_pos()) > 10 then self:teleport(target) @@ -507,6 +507,7 @@ mobs:register_mob("mobs_mc:enderman", { if self._taken_node ~= nil and self._taken_node ~= "" then minetest.add_item(pos, self._taken_node) end + mobs.death_effect(pos, self.collisionbox) end, do_punch = function(self, hitter, tflp, tool_caps, dir) -- damage from rain caused by itself so we don't want it to attack itself. diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index bb4a93e2c..fd4926d2f 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -175,6 +175,8 @@ local horse = { mobs.detach(self.driver, {x = 1, y = 0, z = 1}) end + mobs.death_effect(pos, self.collisionbox) + end, on_rightclick = function(self, clicker) diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 6391e867c..8cb32a165 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -111,6 +111,7 @@ mobs:register_mob("mobs_mc:llama", { if self.driver then mobs.detach(self.driver, {x = 1, y = 0, z = 1}) end + mobs.death_effect(pos, self.collisionbox) end, diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index 259f45d95..3ed821b34 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -79,7 +79,7 @@ mobs:register_mob("mobs_mc:pig", { if self.driver then mobs.detach(self.driver, {x = 1, y = 0, z = 1}) end - + mobs.death_effect(pos, self.collisionbox) end, on_rightclick = function(self, clicker) diff --git a/mods/ENTITIES/mobs_mc/snowman.lua b/mods/ENTITIES/mobs_mc/snowman.lua index 02c1178e8..983391e0a 100644 --- a/mods/ENTITIES/mobs_mc/snowman.lua +++ b/mods/ENTITIES/mobs_mc/snowman.lua @@ -128,6 +128,26 @@ mobs:register_mob("mobs_mc:snowman", { end, }) +local summon_particles = function(obj) + local lua = obj:get_luaentity() + local min = {x=lua.collisionbox[1], y=lua.collisionbox[2], z=lua.collisionbox[3]} + local max = {x=lua.collisionbox[4], y=lua.collisionbox[5], z=lua.collisionbox[6]} + local pos = obj:get_pos() + minetest.add_particlespawner({ + amount = 60, + time = 0.1, + minpos = vector.add(pos, min), + maxpos = vector.add(pos, max), + minvel = {x = -0.1, y = -0.1, z = -0.1}, + maxvel = {x = 0.1, y = 0.1, z = 0.1}, + minexptime = 1.0, + maxexptime = 2.0, + minsize = 2.0, + maxsize = 3.0, + texture = "tnt_smoke.png", + }) +end + -- This is to be called when a pumpkin or jack'o lantern has been placed. Recommended: In the on_construct function -- of the node. -- This summons a snow golen when pos is next to a row of two snow blocks. @@ -157,7 +177,10 @@ mobs_mc.tools.check_snow_golem_summon = function(pos) core.check_for_falling(pos) core.check_for_falling(b1) core.check_for_falling(b2) - minetest.add_entity(place, "mobs_mc:snowman") + local obj = minetest.add_entity(place, "mobs_mc:snowman") + if obj then + summon_particles(obj) + end break end end diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 9788d58c6..babb1d573 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -1053,6 +1053,7 @@ mobs:register_mob("mobs_mc:villager", { return_fields(player) end end + mobs.death_effect(pos, self.collisionbox) end, }) From f00dc212527ca8b39cd2a4497726444b241486d2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 18:38:38 +0200 Subject: [PATCH 100/152] Make dying mobs non-pointable --- mods/ENTITIES/mcl_mobs/api.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index aa5809cdc..098485f32 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -674,6 +674,9 @@ local check_for_death = function(self, cause, cmi_cause) self.blinktimer = 0 self.passive = true self.state = "die" + self.object:set_properties({ + pointable = false, + }) set_velocity(self, 0) set_animation(self, "die") From 731f42ac88c31c8e2e7def0e867b3e351fb97f70 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 18:47:58 +0200 Subject: [PATCH 101/152] Rename and move texture: tnt_smoke --- mods/CORE/mcl_explosions/init.lua | 2 +- mods/CORE/mcl_explosions/mod.conf | 1 + .../textures/mcl_particles_smoke.png} | Bin mods/ENTITIES/mcl_mobs/api.lua | 16 ++++++++-------- mods/ENTITIES/mcl_mobs/mod.conf | 1 + mods/ENTITIES/mobs_mc/depends.txt | 1 + mods/ENTITIES/mobs_mc/snowman.lua | 2 +- mods/ITEMS/REDSTONE/mesecons_torch/init.lua | 2 +- mods/ITEMS/mcl_tnt/depends.txt | 1 + mods/ITEMS/mcl_tnt/init.lua | 6 +++--- tools/Conversion_Table.csv | 2 +- 11 files changed, 19 insertions(+), 15 deletions(-) rename mods/{ITEMS/mcl_tnt/textures/tnt_smoke.png => CORE/mcl_particles/textures/mcl_particles_smoke.png} (100%) diff --git a/mods/CORE/mcl_explosions/init.lua b/mods/CORE/mcl_explosions/init.lua index 84f3322df..fdf1d6ad1 100644 --- a/mods/CORE/mcl_explosions/init.lua +++ b/mods/CORE/mcl_explosions/init.lua @@ -124,7 +124,7 @@ local function add_particles(pos, radius) maxexptime = 1.0, minsize = radius * 0.5, maxsize = radius * 1.0, - texture = "tnt_smoke.png", + texture = "mcl_particles_smoke.png", }) end diff --git a/mods/CORE/mcl_explosions/mod.conf b/mods/CORE/mcl_explosions/mod.conf index 7ce4b678d..4ec206e17 100644 --- a/mods/CORE/mcl_explosions/mod.conf +++ b/mods/CORE/mcl_explosions/mod.conf @@ -1,3 +1,4 @@ name = mcl_explosions description = A common API to create explosions. +depends = mcl_particles optional_depends = mcl_fire diff --git a/mods/ITEMS/mcl_tnt/textures/tnt_smoke.png b/mods/CORE/mcl_particles/textures/mcl_particles_smoke.png similarity index 100% rename from mods/ITEMS/mcl_tnt/textures/tnt_smoke.png rename to mods/CORE/mcl_particles/textures/mcl_particles_smoke.png diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 098485f32..7dd4b7068 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -516,7 +516,7 @@ mobs.death_effect = function(pos, collisionbox) maxexptime = 1.5, minsize = 0.5, maxsize = 1.5, - texture = "tnt_smoke.png", + texture = "mcl_particles_smoke.png", }) end @@ -841,7 +841,7 @@ local do_env_damage = function(self) if not (mod_weather and (mcl_weather.rain.raining or mcl_weather.state == "snow") and mcl_weather.is_outdoor(pos)) then self.health = self.health - damage - effect(pos, 5, "tnt_smoke.png") + effect(pos, 5, "mcl_particles_smoke.png") if check_for_death(self, "light", {type = "light"}) then return true @@ -907,7 +907,7 @@ local do_env_damage = function(self) self.health = self.health - self.water_damage - effect(pos, 5, "tnt_smoke.png", nil, nil, 1, nil) + effect(pos, 5, "mcl_particles_smoke.png", nil, nil, 1, nil) if check_for_death(self, "water", {type = "environment", pos = pos, node = self.standing_in}) then @@ -952,7 +952,7 @@ local do_env_damage = function(self) self.health = self.health - nodef.damage_per_second - effect(pos, 5, "tnt_smoke.png") + effect(pos, 5, "mcl_particles_smoke.png") if check_for_death(self, "dps", {type = "environment", pos = pos, node = self.standing_in}) then @@ -2327,7 +2327,7 @@ local do_states = function(self, dtime) }, true) entity_physics(pos, entity_damage_radius) - effect(pos, 32, "tnt_smoke.png", nil, nil, node_break_radius, 1, 0) + effect(pos, 32, "mcl_particles_smoke.png", nil, nil, node_break_radius, 1, 0) end end self.object:remove() @@ -2643,7 +2643,7 @@ local falling = function(self, pos) if damage > 0 then self.health = self.health - damage - effect(pos, 5, "tnt_smoke.png", 1, 2, 2, nil) + effect(pos, 5, "mcl_particles_smoke.png", 1, 2, 2, nil) if check_for_death(self, "fall", {type = "fall"}) then return true @@ -3960,7 +3960,7 @@ function mobs:safe_boom(self, pos, strength) }, true) local radius = strength entity_physics(pos, radius) - effect(pos, 32, "tnt_smoke.png", radius * 3, radius * 5, radius, 1, 0) + effect(pos, 32, "mcl_particles_smoke.png", radius * 3, radius * 5, radius, 1, 0) end @@ -4181,7 +4181,7 @@ function mobs:spawn_child(pos, mob_type) end local ent = child:get_luaentity() - effect(pos, 15, "tnt_smoke.png", 1, 2, 2, 15, 5) + effect(pos, 15, "mcl_particles_smoke.png", 1, 2, 2, 15, 5) ent.child = true diff --git a/mods/ENTITIES/mcl_mobs/mod.conf b/mods/ENTITIES/mcl_mobs/mod.conf index a32827a65..d1840c697 100644 --- a/mods/ENTITIES/mcl_mobs/mod.conf +++ b/mods/ENTITIES/mcl_mobs/mod.conf @@ -1,2 +1,3 @@ name = mcl_mobs +depends = mcl_particles optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor diff --git a/mods/ENTITIES/mobs_mc/depends.txt b/mods/ENTITIES/mobs_mc/depends.txt index b37d4adb9..4a2756661 100644 --- a/mods/ENTITIES/mobs_mc/depends.txt +++ b/mods/ENTITIES/mobs_mc/depends.txt @@ -1,4 +1,5 @@ mcl_init +mcl_particles default? mcl_mobs mcl_tnt? diff --git a/mods/ENTITIES/mobs_mc/snowman.lua b/mods/ENTITIES/mobs_mc/snowman.lua index 983391e0a..5069240bd 100644 --- a/mods/ENTITIES/mobs_mc/snowman.lua +++ b/mods/ENTITIES/mobs_mc/snowman.lua @@ -144,7 +144,7 @@ local summon_particles = function(obj) maxexptime = 2.0, minsize = 2.0, maxsize = 3.0, - texture = "tnt_smoke.png", + texture = "mcl_particles_smoke.png", }) end diff --git a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua index 5e68306ff..c7c4a4ca2 100644 --- a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua @@ -56,7 +56,7 @@ local torch_overheated = function(pos) velocity = {x = 0, y = 0.6, z = 0}, expirationtime = 1.2, size = 1.5, - texture = "tnt_smoke.png", + texture = "mcl_particles_smoke.png", }) local timer = minetest.get_node_timer(pos) timer:start(TORCH_COOLOFF) diff --git a/mods/ITEMS/mcl_tnt/depends.txt b/mods/ITEMS/mcl_tnt/depends.txt index e4c208ea6..6a2354764 100644 --- a/mods/ITEMS/mcl_tnt/depends.txt +++ b/mods/ITEMS/mcl_tnt/depends.txt @@ -1,4 +1,5 @@ mcl_explosions +mcl_particles mcl_sounds? mcl_mobitems? mcl_death_messages? diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index 14865febf..ef4fb33c2 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -28,7 +28,7 @@ tnt.smoke_step = function(pos) expirationtime = 0.15 + math.random() * 0.25, size = 1.0 + math.random(), collisiondetection = false, - texture = "tnt_smoke.png" + texture = "mcl_particles_smoke.png" }) end @@ -130,12 +130,12 @@ local function add_effects(pos, radius, drops) maxexptime = 2.5, minsize = radius * 1, maxsize = radius * 3, - texture = "tnt_smoke.png", + texture = "mcl_particles_smoke.png", }) -- we just dropped some items. Look at the items entities and pick -- one of them to use as texture - local texture = "tnt_smoke.png" --fallback texture + local texture = "mcl_particles_smoke.png" --fallback texture local most = 0 for name, stack in pairs(drops) do local count = stack:get_count() diff --git a/tools/Conversion_Table.csv b/tools/Conversion_Table.csv index 987ab64e1..0cad45eaf 100644 --- a/tools/Conversion_Table.csv +++ b/tools/Conversion_Table.csv @@ -776,7 +776,7 @@ Source path,Source file,Target path,Target file,xs,ys,xl,yl,xt,yt,Blacklisted? /assets/minecraft/textures/gui,icons.png,/mods/PLAYER/mcl_hunger/textures,hbhunger_icon_health_poison.png,88,0,9,9,0,0,y /assets/minecraft/textures/gui,icons.png,/mods/PLAYER/mcl_hunger/textures,hbhunger_icon.png,52,27,9,9,0,0,y /assets/minecraft/textures/gui,icons.png,/mods/PLAYER/mcl_hunger/textures,mcl_hunger_icon_foodpoison.png,88,27,9,9,0,0,y -/assets/minecraft/textures/particle,particles.png,/mods/ITEMS/mcl_tnt/textures,tnt_smoke.png,56,0,8,8,0,0,y +/assets/minecraft/textures/particle,particles.png,/mods/CORE/mcl_particles/textures,mcl_particles_smoke.png,56,0,8,8,0,0,y /assets/minecraft/textures/blocks,shulker_top_black.png,/mods/ITEMS/mcl_chests/textures,mcl_chests_black_shulker_box_top.png,,,,,,,y /assets/minecraft/textures/blocks,shulker_top_blue.png,/mods/ITEMS/mcl_chests/textures,mcl_chests_blue_shulker_box_top.png,,,,,,,y /assets/minecraft/textures/blocks,shulker_top_brown.png,/mods/ITEMS/mcl_chests/textures,mcl_chests_brown_shulker_box_top.png,,,,,,,y From 8a394747931e77303044def73e41e19dff47b52b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 19:14:37 +0200 Subject: [PATCH 102/152] Add smoke particles at torches --- mods/CORE/mcl_particles/init.lua | 33 +++++++----- .../textures/mcl_particles_smoke.png | Bin 945 -> 126 bytes .../textures/mcl_particles_smoke_anim.png | Bin 0 -> 216 bytes mods/ITEMS/mcl_furnaces/init.lua | 4 +- mods/ITEMS/mcl_torches/init.lua | 48 ++++++++++++++++-- 5 files changed, 68 insertions(+), 17 deletions(-) create mode 100644 mods/CORE/mcl_particles/textures/mcl_particles_smoke_anim.png diff --git a/mods/CORE/mcl_particles/init.lua b/mods/CORE/mcl_particles/init.lua index 4a89d733e..d3b4d02a5 100644 --- a/mods/CORE/mcl_particles/init.lua +++ b/mods/CORE/mcl_particles/init.lua @@ -1,12 +1,15 @@ -local particle_nodes = {} - mcl_particles = {} +-- Table of particlespawner IDs on a per-node hash basis +-- Keys: node position hashes +-- Values: Tables of particlespawner IDs (each node pos can have an arbitrary number of particlespawners) +local particle_nodes = {} + -- Node particles can be disabled via setting local node_particles_allowed = minetest.settings:get_bool("mcl_node_particles", true) -- Add a particlespawner that is assigned to a given node position. --- * pos: Node positon. MUST use rounded values! +-- * pos: Node positon. MUST use integer values! -- * particlespawner_definition: definition for minetest.add_particlespawner -- NOTE: All particlespawners are automatically removed on shutdown. -- Returns particlespawner ID on succcess and nil on failure @@ -22,22 +25,28 @@ function mcl_particles.add_node_particlespawner(pos, particlespawner_definition) if id == -1 then return end - particle_nodes[poshash] = id + if not particle_nodes[poshash] then + particle_nodes[poshash] = {} + end + table.insert(particle_nodes[poshash], id) return id end --- Deleted a particlespawner that is assigned to a node position, if one exists. --- Otherwise, this does nothing. --- pos: Node positon. MUST use rounded values! --- Returns true if particlespawner could be removed and false if none existed -function mcl_particles.delete_node_particlespawner(pos) +-- Deletes all particlespawners that are assigned to a node position. +-- If no particlespawners exist for this position, nothing happens. +-- pos: Node positon. MUST use integer values! +-- Returns true if particlespawner could be removed and false if not +function mcl_particles.delete_node_particlespawners(pos) if not node_particles_allowed then return false end local poshash = minetest.hash_node_position(pos) - local id = particle_nodes[poshash] - if id then - minetest.delete_particlespawner(id) + local ids = particle_nodes[poshash] + if ids then + for i=1, #ids do + minetest.delete_particlespawner(ids[i]) + end + particle_nodes[poshash] = nil return true end return false diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_smoke.png b/mods/CORE/mcl_particles/textures/mcl_particles_smoke.png index 6551db5b553170a796f8b03c61228a83aefeb18e..709cecf16169d37e4d88e24b78c2483dc67bc1e1 100644 GIT binary patch delta 108 zcmdnUUN=D^jft6ofnjH2m;{jG3GfMV1=5!1$UZ@$o`aczf#LH-znu&W%nSiOA+A8~s#U8lU%uSc)%E}X|Jl1Qbk5t-zhcj- z3r~P-AmiML-A^Cg+PZ4)G$EbKS{B(HN#R&xS2Rp)@oZX^yyBd?Un$T{SFc{(ym|AaNt4RU%dM=e ztgWqWY;0_8ZSCyr?CtFx92^`S9i5zizxw0|Ej90|SGCf`WsCLqbAALqo&D!otJDBO)RqBO{}tqN1atV`5@r zV`Jmu;^O1u6A}^<6BCn?l9H2?Q&Lh=Q&ZE@($dq@GcqzVGc&WYva++Yb8>QWb93|Z z^78ZZ3knJf3k!>iii(SiOG-*gOH0ej%79LeQ*zrcIkZefo?UGiJ`5IcwG|V93vzGiUDHx%1}Dn?Ha4f&~i} zE?l^1(W1qR>lZIsvSjJfrOTErTfThxiWMtXu3QO>{?)5juUWHZ?b@~L)~#E=e*K0G z8#Zp-xM|ZSV6bo5vSsVmt=qP3+rEAKjvYI8?%cU+*RI{WckkJ=XYby<`}XbIzkmOM z0|yQsJb38Pp~Hs{A31X5=+UFVC_jGu_=yuIPM$n@>eQ*zr%#_bbLQ;Xv-RiBojZU2 z{Dlh_E?&HN>Cz=&y1R1a3NV7NUAuPu`t=((Zrr?i^VY3fw{PFRbLY<8yLa#1yLbQo z{Ra;oJbd`@(W6I?A3uKbgPoF(|_Wb$t7cXACeEIU#t5>gIzkc)P&D*zc-@SYH z{{8z8A3l8i`0>-HPoF=3{_^DuFb#hD_U-%k??38){P_9v=dWMCe*gac=g*(NfB*jb z_YauFj@`0f3d{+nB|(0{3_v~uFiwFKaR3-->-dzIW&jP)_H=O!shA_%`(6V?X?Hl5?L7^=1+Sc`3-fq~c`C6W50YfaS>5meiJ_b)$KbLh*2~7ad CJ|Lz5 diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_smoke_anim.png b/mods/CORE/mcl_particles/textures/mcl_particles_smoke_anim.png new file mode 100644 index 0000000000000000000000000000000000000000..6c85a6feb9d0a654c51b7738e7e43336653ddf0c GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^96;>A#0(^(vhGO&DV_kI5LY05`SRset5$UZ!TwiP zKt5whkY6x^!?PP{Ku(pXi(^OyV^RWdf31t~u@93(iHG=5!L&Cn; Date: Wed, 19 Aug 2020 19:27:59 +0200 Subject: [PATCH 103/152] Fire nodes spawn smoke particles --- mods/ITEMS/mcl_fire/depends.txt | 1 + mods/ITEMS/mcl_fire/init.lua | 40 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/mods/ITEMS/mcl_fire/depends.txt b/mods/ITEMS/mcl_fire/depends.txt index 3d76c6484..97699f211 100644 --- a/mods/ITEMS/mcl_fire/depends.txt +++ b/mods/ITEMS/mcl_fire/depends.txt @@ -1,4 +1,5 @@ mcl_core mcl_worlds mcl_sounds +mcl_particles mcl_portals? diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index 3212d7432..a25aecdb0 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -5,6 +5,28 @@ mcl_fire = {} local S = minetest.get_translator("mcl_fire") local N = function(s) return s end +local spawn_smoke = function(pos) + mcl_particles.add_node_particlespawner(pos, { + amount = 0.1, + time = 0, + minpos = vector.add(pos, { x = -0.45, y = -0.45, z = -0.45 }), + maxpos = vector.add(pos, { x = 0.45, y = 0.45, z = 0.45 }), + minvel = { x = 0, y = 0.5, z = 0 }, + maxvel = { x = 0, y = 0.6, z = 0 }, + minexptime = 2.0, + maxexptime = 2.0, + minsize = 3.0, + maxsize = 4.0, + texture = "mcl_particles_smoke_anim.png^[colorize:#000000:127", + animation = { + type = "vertical_frames", + aspect_w = 8, + aspect_h = 8, + length = 2.05, + }, + }) +end + -- -- Items -- @@ -172,6 +194,10 @@ minetest.register_node("mcl_fire:fire", { end fire_timer(pos) + spawn_smoke(pos) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) end, _mcl_blast_resistance = 0, }) @@ -232,6 +258,10 @@ minetest.register_node("mcl_fire:eternal_fire", { if minetest.get_modpath("mcl_portals") then mcl_portals.light_nether_portal(pos) end + spawn_smoke(pos) + end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) end, sounds = {}, drop = "", @@ -451,6 +481,16 @@ mcl_fire.set_fire = function(pointed_thing, player, allow_on_fire) end end +minetest.register_lbm({ + label = "Smoke particles from fire", + name = "mcl_fire:smoke", + nodenames = {"group:fire"}, + run_at_every_load = true, + action = function(pos, node) + spawn_smoke(pos) + end, +}) + minetest.register_alias("mcl_fire:basic_flame", "mcl_fire:fire") minetest.register_alias("fire:basic_flame", "mcl_fire:fire") minetest.register_alias("fire:permanent_flame", "mcl_fire:eternal_flame") From c0aeb2f15f7b1da46cdfcafcaec1df1bd7723762 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 20:17:04 +0200 Subject: [PATCH 104/152] Add lava particles --- .../textures/mcl_particles_lava.png | Bin 0 -> 183 bytes mods/ITEMS/mcl_core/depends.txt | 1 + mods/ITEMS/mcl_core/nodes_liquid.lua | 49 ++++++++++++++++-- 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 mods/CORE/mcl_particles/textures/mcl_particles_lava.png diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_lava.png b/mods/CORE/mcl_particles/textures/mcl_particles_lava.png new file mode 100644 index 0000000000000000000000000000000000000000..b4a8fd58fec52b82001d139b17a4f7881f075876 GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqY)RhkE)41nfeZ~?Dg9@FBAf*t zk;M!Qe1|}oQB=dL0Vv2`;_2(k{)9tVP?pI)y5%!a$i>seF+}2Wa>4?wAA2vp{J&nV z|Nn_3pA(aOwEQI{LhB6`w38YQ|J_eZ{&8I4?1%qm(ue Date: Wed, 19 Aug 2020 20:39:05 +0200 Subject: [PATCH 105/152] Disable some demanding particles by default Fire smoke, lava droplets --- mods/CORE/mcl_particles/init.lua | 23 +++++++++++++++++++---- mods/ITEMS/mcl_core/nodes_liquid.lua | 2 +- mods/ITEMS/mcl_fire/init.lua | 2 +- mods/ITEMS/mcl_furnaces/init.lua | 2 +- mods/ITEMS/mcl_torches/init.lua | 8 ++++---- settingtypes.txt | 7 +++++-- 6 files changed, 31 insertions(+), 13 deletions(-) diff --git a/mods/CORE/mcl_particles/init.lua b/mods/CORE/mcl_particles/init.lua index d3b4d02a5..049ec36d0 100644 --- a/mods/CORE/mcl_particles/init.lua +++ b/mods/CORE/mcl_particles/init.lua @@ -6,15 +6,30 @@ mcl_particles = {} local particle_nodes = {} -- Node particles can be disabled via setting -local node_particles_allowed = minetest.settings:get_bool("mcl_node_particles", true) +local node_particles_allowed = minetest.settings:get("mcl_node_particles") or "medium" + +local levels = { + high = 3, + medium = 2, + low = 1, + none = 0, +} + +allowed_level = levels[node_particles_allowed] +if not allowed_level then + allowed_level = levels["medium"] +end + -- Add a particlespawner that is assigned to a given node position. -- * pos: Node positon. MUST use integer values! -- * particlespawner_definition: definition for minetest.add_particlespawner +-- * level: detail level of particles. "high", "medium" or "low". High detail levels are for +-- CPU-demanding particles, like smoke of fire (which occurs frequently) -- NOTE: All particlespawners are automatically removed on shutdown. -- Returns particlespawner ID on succcess and nil on failure -function mcl_particles.add_node_particlespawner(pos, particlespawner_definition) - if not node_particles_allowed then +function mcl_particles.add_node_particlespawner(pos, particlespawner_definition, level) + if allowed_level == 0 or levels[level] > allowed_level then return end local poshash = minetest.hash_node_position(pos) @@ -37,7 +52,7 @@ end -- pos: Node positon. MUST use integer values! -- Returns true if particlespawner could be removed and false if not function mcl_particles.delete_node_particlespawners(pos) - if not node_particles_allowed then + if allowed_level == 0 then return false end local poshash = minetest.hash_node_position(pos) diff --git a/mods/ITEMS/mcl_core/nodes_liquid.lua b/mods/ITEMS/mcl_core/nodes_liquid.lua index 68213e0c1..57b3e588f 100644 --- a/mods/ITEMS/mcl_core/nodes_liquid.lua +++ b/mods/ITEMS/mcl_core/nodes_liquid.lua @@ -227,7 +227,7 @@ local emit_lava_particle = function(pos) }) end -if minetest.settings:get_bool("mcl_node_particles", true) then +if minetest.settings:get("mcl_node_particles") == "full" then minetest.register_abm({ label = "Lava particles", nodenames = {"group:lava_source"}, diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index a25aecdb0..81b963eab 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -24,7 +24,7 @@ local spawn_smoke = function(pos) aspect_h = 8, length = 2.05, }, - }) + }, "high") end -- diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index 19304961e..ce58b8c9a 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -379,7 +379,7 @@ local function spawn_flames(pos, param2) maxsize = 0.8, texture = "mcl_particles_flame.png", glow = LIGHT_ACTIVE_FURNACE, - }) + }, "low") end local on_rotate, after_rotate_active diff --git a/mods/ITEMS/mcl_torches/init.lua b/mods/ITEMS/mcl_torches/init.lua index 90751d495..179308358 100644 --- a/mods/ITEMS/mcl_torches/init.lua +++ b/mods/ITEMS/mcl_torches/init.lua @@ -16,7 +16,7 @@ local spawn_flames_floor = function(pos) maxsize = 2, texture = "mcl_particles_flame.png", glow = LIGHT_TORCH, - }) + }, "low") -- Smoke mcl_particles.add_node_particlespawner(pos, { amount = 0.5, @@ -36,7 +36,7 @@ local spawn_flames_floor = function(pos) aspect_h = 8, length = 2.05, }, - }) + }, "medium") end local spawn_flames_wall = function(pos, param2) @@ -71,7 +71,7 @@ local spawn_flames_wall = function(pos, param2) maxsize = 2, texture = "mcl_particles_flame.png", glow = LIGHT_TORCH, - }) + }, "low") -- Smoke mcl_particles.add_node_particlespawner(pos, { amount = 0.5, @@ -91,7 +91,7 @@ local spawn_flames_wall = function(pos, param2) aspect_h = 8, length = 2.05, }, - }) + }, "medium") end local remove_flames = function(pos) diff --git a/settingtypes.txt b/settingtypes.txt index 1e2129cec..eed0a6b0a 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -27,8 +27,11 @@ mcl_doTileDrops (Blocks have drops) bool true # If enabled, TNT explosions destroy blocks. mcl_tnt_griefing (TNT destroys blocks) bool true -# If enabled, some blocks will emit decorative particles like flames. -mcl_node_particles (Block particles) bool true +# Some blocks will emit decorative particles like flames. This setting +# specifies the detail level of particles, with higher levels being +# more CPU demanding. +# WARNING: The "high" level is really CPU intensive, use with care! +mcl_node_particles (Block particles detail level) enum medium high,medium,low,none [Players] # If enabled, players respawn at the bed they last lay on instead of normal From ce0b31123bde488936b0bc22c36e1cc0fb9a6496 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 20:44:12 +0200 Subject: [PATCH 106/152] Increase smoke anim duration for fire smoke --- mods/ITEMS/mcl_fire/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index 81b963eab..7d27eff92 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -22,7 +22,7 @@ local spawn_smoke = function(pos) type = "vertical_frames", aspect_w = 8, aspect_h = 8, - length = 2.05, + length = 2.1, }, }, "high") end From c7627f05173e10f08c85af8f3938581fe8db2b20 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 20 Aug 2020 19:44:47 +0200 Subject: [PATCH 107/152] Fix minor typo --- mods/ITEMS/mcl_furnaces/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index ce58b8c9a..cd2b6b41e 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -539,7 +539,7 @@ minetest.register_lbm({ -- Legacy minetest.register_lbm({ - label = "Update furnace formspecs (0.60.0", + label = "Update furnace formspecs (0.60.0)", name = "mcl_furnaces:update_formspecs_0_60_0", -- Only update inactive furnaces because active ones should update themselves nodenames = { "mcl_furnaces:furnace" }, From 723a306e1ec3138a5568ab3c05b02ce0cc047a59 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 20 Aug 2020 19:52:00 +0200 Subject: [PATCH 108/152] Anvils: Add tt tooltip to damaged anvils --- mods/ITEMS/mcl_anvils/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index e3f9cc41e..ce74a10d9 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -304,6 +304,7 @@ end local anvildef = { groups = {pickaxey=1, falling_node=1, falling_node_damage=1, crush_after_fall=1, deco_block=1, anvil=1}, tiles = {"mcl_anvils_anvil_top_damaged_0.png^[transformR90", "mcl_anvils_anvil_base.png", "mcl_anvils_anvil_side.png"}, + _tt_help = S("Repair and rename items"), paramtype = "light", sunlight_propagates = true, is_ground_content = false, @@ -496,7 +497,6 @@ S("• Tool + Tool: Place two tools of the same type in the input slots. The “ S("• Tool + Material: Some tools can also be repaired by combining them with an item that it's made of. For example, iron pickaxes can be repaired with iron ingots. This repairs the tool by 25%.").."\n".. S("Armor counts as a tool. It is possible to repair and rename a tool in a single step.").."\n\n".. S("The anvil has limited durability and 3 damage levels: undamaged, slightly damaged and very damaged. Each time you repair or rename something, there is a 12% chance the anvil gets damaged. Anvils also have a chance of being damaged when they fall by more than 1 block. If a very damaged anvil is damaged again, it is destroyed.") -anvildef0._tt_help = S("Repair and rename items") local anvildef1 = table.copy(anvildef) anvildef1.description = S("Slightly Damaged Anvil") @@ -536,7 +536,7 @@ end -- Legacy minetest.register_lbm({ - label = "Update anvil formspecs (0.60.0", + label = "Update anvil formspecs (0.60.0)", name = "mcl_anvils:update_formspec_0_60_0", nodenames = { "group:anvil" }, run_at_every_load = false, From 1878870886e0ce64d6b08f37706c245796bc53da Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 21 Aug 2020 12:36:35 +0200 Subject: [PATCH 109/152] Disable node particles by default --- settingtypes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settingtypes.txt b/settingtypes.txt index eed0a6b0a..d0b793e8a 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -31,7 +31,7 @@ mcl_tnt_griefing (TNT destroys blocks) bool true # specifies the detail level of particles, with higher levels being # more CPU demanding. # WARNING: The "high" level is really CPU intensive, use with care! -mcl_node_particles (Block particles detail level) enum medium high,medium,low,none +mcl_node_particles (Block particles detail level) enum none high,medium,low,none [Players] # If enabled, players respawn at the bed they last lay on instead of normal From 9c8098c2037cb65b1e67f2b8cf6bbba63994052c Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 21 Aug 2020 15:23:15 +0400 Subject: [PATCH 110/152] try to fix https://git.minetest.land/Wuzzy/MineClone2/issues/821 --- mods/ITEMS/mcl_furnaces/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index cd2b6b41e..97e0e3e8a 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -210,7 +210,7 @@ local function furnace_node_timer(pos, elapsed) local srclist, fuellist local cookable, cooked - local active + local active = true local fuel srclist = inv:get_list("src") From 6efed858668c1fd9b91c4d7432835f18a6a0b3cb Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 21 Aug 2020 15:58:17 +0400 Subject: [PATCH 111/152] prevent divizion by zero in mcl_furnaces --- mods/ITEMS/mcl_furnaces/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index 97e0e3e8a..8f4f34d88 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -321,7 +321,10 @@ local function furnace_node_timer(pos, elapsed) local result = false if active then - local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) + local fuel_percent = 0 + if fuel_totaltime > 0 then + fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) + end formspec = active_formspec(fuel_percent, item_percent) swap_node(pos, "mcl_furnaces:furnace_active") -- make sure timer restarts automatically From a728974d8a82431fa0c037f2de8fd442a37fc0d2 Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 21 Aug 2020 16:07:50 +0400 Subject: [PATCH 112/152] prevent furnaces flashing on fuel load --- mods/ITEMS/mcl_furnaces/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index 8f4f34d88..7a84d10b8 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -183,7 +183,7 @@ local function furnace_get_delta_time(pos) last_game_time = tonumber(last_game_time) end if not last_game_time or last_game_time < 1 then - last_game_time = current_game_time + last_game_time = current_game_time + 0.1 elseif last_game_time == current_game_time then current_game_time = current_game_time + 1.0 end From e4ca1beacb5938b6473c7b34e5c7b0c44b1f1373 Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 21 Aug 2020 22:19:23 +0400 Subject: [PATCH 113/152] prevent furnaces flashes on fuel load more correctly --- mods/ITEMS/mcl_furnaces/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index 7a84d10b8..07213e40d 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -183,7 +183,7 @@ local function furnace_get_delta_time(pos) last_game_time = tonumber(last_game_time) end if not last_game_time or last_game_time < 1 then - last_game_time = current_game_time + 0.1 + last_game_time = current_game_time - 0.1 elseif last_game_time == current_game_time then current_game_time = current_game_time + 1.0 end From a672d901f825f0ff771fc3222235f04bc1337f9c Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 21 Aug 2020 22:22:55 +0400 Subject: [PATCH 114/152] Translate new line in mcl_potions.ru.tr --- mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr index 9640e07dc..3d309cbba 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr @@ -84,7 +84,7 @@ Harming=урона -12 HP=-12 HP Instantly deals damage.=Вызывает мгновенную смерть. Night Vision=ночного зрения -Increases the perceived brightness of light under a dark sky.= +Increases the perceived brightness of light under a dark sky.=Усиливает восприятие яркости освещени под тёмным небом. Swiftness=ускорения Increases walking speed.=Увеличивает скорость ходьбы Slowness=замедления From 81cf500611fcd97f30b0cc2c0024bc76f3d9cecd Mon Sep 17 00:00:00 2001 From: kay27 Date: Sat, 22 Aug 2020 05:05:55 +0400 Subject: [PATCH 115/152] fix furnace flame particles --- mods/ITEMS/mcl_furnaces/init.lua | 79 ++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index 07213e40d..108a60877 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -146,6 +146,40 @@ local function on_metadata_inventory_take(pos, listname, index, stack, player) end end +local function spawn_flames(pos, param2) + local minrelpos, maxrelpos + local dir = minetest.facedir_to_dir(param2) + if dir.x > 0 then + minrelpos = { x = -0.6, y = -0.05, z = -0.25 } + maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } + elseif dir.x < 0 then + minrelpos = { x = 0.55, y = -0.05, z = -0.25 } + maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } + elseif dir.z > 0 then + minrelpos = { x = -0.25, y = -0.05, z = -0.6 } + maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } + elseif dir.z < 0 then + minrelpos = { x = -0.25, y = -0.05, z = 0.55 } + maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } + else + return + end + mcl_particles.add_node_particlespawner(pos, { + amount = 4, + time = 0, + minpos = vector.add(pos, minrelpos), + maxpos = vector.add(pos, maxrelpos), + minvel = { x = -0.01, y = 0, z = -0.01 }, + maxvel = { x = 0.01, y = 0.1, z = 0.01 }, + minexptime = 0.3, + maxexptime = 0.6, + minsize = 0.4, + maxsize = 0.8, + texture = "mcl_particles_flame.png", + glow = LIGHT_ACTIVE_FURNACE, + }, "low") +end + local function swap_node(pos, name) local node = minetest.get_node(pos) if node.name == name then @@ -153,6 +187,11 @@ local function swap_node(pos, name) end node.name = name minetest.swap_node(pos, node) + if name == "mcl_furnaces:furnace_active" then + spawn_flames(pos, node.param2) + else + mcl_particles.delete_node_particlespawners(pos) + end end local function furnace_reset_delta_time(pos) @@ -351,46 +390,15 @@ local function furnace_node_timer(pos, elapsed) return result end -local function spawn_flames(pos, param2) - local minrelpos, maxrelpos - local dir = minetest.facedir_to_dir(param2) - if dir.x > 0 then - minrelpos = { x = -0.6, y = -0.05, z = -0.25 } - maxrelpos = { x = -0.55, y = -0.45, z = 0.25 } - elseif dir.x < 0 then - minrelpos = { x = 0.55, y = -0.05, z = -0.25 } - maxrelpos = { x = 0.6, y = -0.45, z = 0.25 } - elseif dir.z > 0 then - minrelpos = { x = -0.25, y = -0.05, z = -0.6 } - maxrelpos = { x = 0.25, y = -0.45, z = -0.55 } - elseif dir.z < 0 then - minrelpos = { x = -0.25, y = -0.05, z = 0.55 } - maxrelpos = { x = 0.25, y = -0.45, z = 0.6 } - else - return - end - mcl_particles.add_node_particlespawner(pos, { - amount = 4, - time = 0, - minpos = vector.add(pos, minrelpos), - maxpos = vector.add(pos, maxrelpos), - minvel = { x = -0.01, y = 0, z = -0.01 }, - maxvel = { x = 0.01, y = 0.1, z = 0.01 }, - minexptime = 0.3, - maxexptime = 0.6, - minsize = 0.4, - maxsize = 0.8, - texture = "mcl_particles_flame.png", - glow = LIGHT_ACTIVE_FURNACE, - }, "low") -end - local on_rotate, after_rotate_active if minetest.get_modpath("screwdriver") then on_rotate = screwdriver.rotate_simple after_rotate_active = function(pos) local node = minetest.get_node(pos) mcl_particles.delete_node_particlespawners(pos) + if node.name == "mcl_furnaces:furnace" then + return + end spawn_flames(pos, node.param2) end end @@ -437,6 +445,9 @@ minetest.register_node("mcl_furnaces:furnace", { inv:set_size('fuel', 1) inv:set_size('dst', 1) end, + on_destruct = function(pos) + mcl_particles.delete_node_particlespawners(pos) + end, on_metadata_inventory_move = function(pos) -- Reset accumulated game time when player works with furnace: From 82c31429137cca4772c536a7cb3dd86b13ae6df9 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sat, 22 Aug 2020 05:13:17 +0400 Subject: [PATCH 116/152] fix a typo in mcl_potions.ru.tr --- mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr index 3d309cbba..ca685c202 100644 --- a/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr +++ b/mods/ITEMS/mcl_potions/locale/mcl_potions.ru.tr @@ -84,7 +84,7 @@ Harming=урона -12 HP=-12 HP Instantly deals damage.=Вызывает мгновенную смерть. Night Vision=ночного зрения -Increases the perceived brightness of light under a dark sky.=Усиливает восприятие яркости освещени под тёмным небом. +Increases the perceived brightness of light under a dark sky.=Усиливает восприятие яркости освещения под тёмным небом. Swiftness=ускорения Increases walking speed.=Увеличивает скорость ходьбы Slowness=замедления From 3a57a5800b7be7388c2a77d29bf57a68011c6dea Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 22 Aug 2020 11:18:45 +0200 Subject: [PATCH 117/152] Smoother lingering potion particles in 1st second --- mods/ITEMS/mcl_potions/lingering.lua | 61 ++++++++++------------------ 1 file changed, 22 insertions(+), 39 deletions(-) diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index bfeff88f6..f04b655f4 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -16,6 +16,25 @@ local function add_lingering_effect(pos, color, def, is_water, instant) end +local function linger_particles(pos, d, texture, color) + minetest.add_particlespawner({ + amount = 10 * d^2, + time = 1, + minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, + maxpos = {x=pos.x+d, y=pos.y+1, z=pos.z+d}, + minvel = {x=-0.5, y=0, z=-0.5}, + maxvel = {x=0.5, y=0.5, z=0.5}, + minacc = {x=-0.2, y=0, z=-0.2}, + maxacc = {x=0.2, y=.05, z=0.2}, + minexptime = 1, + maxexptime = 2, + minsize = 2, + maxsize = 4, + collisiondetection = true, + vertical = false, + texture = texture.."^[colorize:"..color..":127", + }) +end local lingering_timer = 0 minetest.register_globalstep(function(dtime) @@ -35,23 +54,7 @@ minetest.register_globalstep(function(dtime) else texture = "mcl_particles_effect.png" end - minetest.add_particlespawner({ - amount = 10 * d^2, - time = 1, - minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, - maxpos = {x=pos.x+d, y=pos.y+1, z=pos.z+d}, - minvel = {x=-0.5, y=0, z=-0.5}, - maxvel = {x=0.5, y=0.5, z=0.5}, - minacc = {x=-0.2, y=0, z=-0.2}, - maxacc = {x=0.2, y=.05, z=0.2}, - minexptime = 1, - maxexptime = 2, - minsize = 2, - maxsize = 4, - collisiondetection = true, - vertical = false, - texture = texture.."^[colorize:"..vals.color..":127", - }) + linger_particles(pos, d, texture, vals.color) -- Extinguish fire if water bottle if vals.is_water then @@ -141,37 +144,17 @@ minetest.register_entity(id.."_flying",{ if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) add_lingering_effect(pos, color, def, name == "water") - local texture, minacc, maxacc + local texture if name == "water" then texture = "mcl_particles_droplet_bottle.png" - minacc = {x=-0.2, y=-0.05, z=-0.2} - maxacc = {x=0.2, y=0.05, z=0.2} else if def.instant then texture = "mcl_particles_instant_effect.png" else texture = "mcl_particles_effect.png" end - minacc = {x=-0.2, y=0, z=-0.2} - maxacc = {x=0.2, y=.05, z=0.2} end - minetest.add_particlespawner({ - amount = 40, - time = 1, - minpos = {x=pos.x-d, y=pos.y+0.5, z=pos.z-d}, - maxpos = {x=pos.x+d, y=pos.y+1, z=pos.z+d}, - minvel = {x=-0.5, y=0, z=-0.5}, - maxvel = {x=0.5, y=0.5, z=0.5}, - minacc = minacc, - maxacc = maxacc, - minexptime = 1, - maxexptime = 2, - minsize = 1, - maxsize = 2, - collisiondetection = true, - vertical = false, - texture = texture.."^[colorize:"..color..":127", - }) + linger_particles(pos, d, texture, color) if name == "water" then mcl_potions._extinguish_nearby_fire(pos, d) end From b726dd7689021f2f2db0d447c552ff6eca8afe8e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 22 Aug 2020 11:26:45 +0200 Subject: [PATCH 118/152] Credit kay27 for coding work --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ce507f275..177d8e6a4 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,7 @@ There are so many people to list (sorry). Check out the respective mod directori * [ryvnf](https://github.com/ryvnf): Explosion mechanics * MysticTempest: Bugfixes * [bzoss](https://github.com/bzoss): Status effects, potions, brewing stand +* kay27 : Bugfixes, optimizations * Lots of other people: TO BE WRITTEN (see mod directories for details) #### Mod credits (summary) From 5787b43117524d7212246f46801e257baab26dae Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 22 Aug 2020 11:28:36 +0200 Subject: [PATCH 119/152] Version 0.67.0 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 177d8e6a4..2fdcffd11 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. Developed by Wuzzy and contributors. Not developed or endorsed by Mojang AB. -Version: 0.66.2 +Version: 0.67.0 ### Gameplay You start in a randomly-generated world made entirely of cubes. You can explore @@ -116,6 +116,8 @@ The following main features are available: * The Nether, a fiery underworld in another dimension * Redstone circuits (partially) * Minecarts (partial) +* Status effects (partial) +* Brewing, potions, tipped arrow (partial) * Boats * Fire * Buidling blocks: Stairs, slabs, doors, trapdoors, fences, fence gates, walls @@ -146,8 +148,6 @@ The following features are incomplete: * The End * Enchanting * Experience -* Status effects -* Brewing, potions, tipped arrows * Special minecarts * A couple of non-trivial blocks and items From 4fb0ead10edf40066a414a7a07ab91aed2afaf5c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 22 Aug 2020 12:12:31 +0200 Subject: [PATCH 120/152] Make all brewing stand versions use metal sound --- mods/ITEMS/mcl_brewing/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index 944b32aa3..178914921 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -408,7 +408,7 @@ minetest.register_node("mcl_brewing:stand_000", { {0/16, 3/16 , 4/16 , 1/16, 6/16, 5/16 }, -- line 3 } }, - sounds = mcl_sounds.node_sound_glass_defaults(), + sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 1, _mcl_hardness = 1, on_destruct = on_destruct, From 87ffe2e8f5e81759a702b10f42f0176cbfbb4f4c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 23 Aug 2020 12:05:08 +0200 Subject: [PATCH 121/152] Set default node particle level to "none" --- mods/CORE/mcl_particles/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/CORE/mcl_particles/init.lua b/mods/CORE/mcl_particles/init.lua index 049ec36d0..757c0452f 100644 --- a/mods/CORE/mcl_particles/init.lua +++ b/mods/CORE/mcl_particles/init.lua @@ -6,7 +6,7 @@ mcl_particles = {} local particle_nodes = {} -- Node particles can be disabled via setting -local node_particles_allowed = minetest.settings:get("mcl_node_particles") or "medium" +local node_particles_allowed = minetest.settings:get("mcl_node_particles") or "none" local levels = { high = 3, @@ -17,14 +17,14 @@ local levels = { allowed_level = levels[node_particles_allowed] if not allowed_level then - allowed_level = levels["medium"] + allowed_level = levels["none"] end -- Add a particlespawner that is assigned to a given node position. -- * pos: Node positon. MUST use integer values! -- * particlespawner_definition: definition for minetest.add_particlespawner --- * level: detail level of particles. "high", "medium" or "low". High detail levels are for +-- * level: detail level of particles. "high", "medium", "low" or "none". High detail levels are for -- CPU-demanding particles, like smoke of fire (which occurs frequently) -- NOTE: All particlespawners are automatically removed on shutdown. -- Returns particlespawner ID on succcess and nil on failure From e5d6e90913a5355c2f2133df669957e44532511b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 23 Aug 2020 12:07:35 +0200 Subject: [PATCH 122/152] Mark mcl_node_particles as an experimental setting --- settingtypes.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/settingtypes.txt b/settingtypes.txt index d0b793e8a..18471d7bf 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -27,12 +27,6 @@ mcl_doTileDrops (Blocks have drops) bool true # If enabled, TNT explosions destroy blocks. mcl_tnt_griefing (TNT destroys blocks) bool true -# Some blocks will emit decorative particles like flames. This setting -# specifies the detail level of particles, with higher levels being -# more CPU demanding. -# WARNING: The "high" level is really CPU intensive, use with care! -mcl_node_particles (Block particles detail level) enum none high,medium,low,none - [Players] # If enabled, players respawn at the bed they last lay on instead of normal # spawn. @@ -119,3 +113,10 @@ mcl_generate_fallen_logs (Generate fallen logs) bool false # in “normal” Flat. # But creating new flat worlds after changing this setting should be safe. mcl_superflat_classic (Classic superflat map generation) bool false + +# Make some blocks emit decorative particles like flames. This setting +# specifies the detail level of particles, with higher levels being +# more CPU demanding. +# WARNING: This setting has quite poor performance and can slow down your +# game by a lot. +mcl_node_particles (Block particles detail level) enum none high,medium,low,none From 8453dac1db434ceb11d504e99434efbddb9a9580 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 24 Aug 2020 09:35:11 +0200 Subject: [PATCH 123/152] Fix MISSING_ENGINE_FEATURES.md typo --- MISSING_ENGINE_FEATURES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MISSING_ENGINE_FEATURES.md b/MISSING_ENGINE_FEATURES.md index 313c535f4..16f7e1572 100644 --- a/MISSING_ENGINE_FEATURES.md +++ b/MISSING_ENGINE_FEATURES.md @@ -1,7 +1,7 @@ # Missing features in Minetest to recreate Minecraft features A side goal of the MineClone 2 project is to find any shortcomings of Minetest which make it impossible to recreate a Minecraft feature exactly. -This file lists some of the missing features in Minetest which MineClone 2 would require.MineClone 2 would require.MineClone 2 would require.MineClone 2 would require. +This file lists some of the missing features in Minetest which MineClone 2 would require. ## No workaround possible For these features, no easy Lua workaround could be found. From 2f6afe34ba53441392b1b06a7af107f92cb4239d Mon Sep 17 00:00:00 2001 From: MysticTempest Date: Wed, 26 Aug 2020 00:46:07 -0500 Subject: [PATCH 124/152] Fix crash when night_vision tries to apply to a mob. --- mods/ITEMS/mcl_potions/functions.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 317744e2f..99d39b95d 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -838,7 +838,13 @@ function mcl_potions.night_vision_func(player, null, duration) victim.timer = 0 end - meta:set_int("night_vision", 1) + + is_player = player:is_player() + if is_player then + meta:set_int("night_vision", 1) + else + return -- Do not attempt to set night_vision on mobs + end mcl_weather.skycolor.update_sky_color({player}) end From ae4ede757a204482c9279d84ebbe950f89d88f32 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 26 Aug 2020 12:58:22 +0200 Subject: [PATCH 125/152] Version 0.67.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2fdcffd11..3fb2de290 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. Developed by Wuzzy and contributors. Not developed or endorsed by Mojang AB. -Version: 0.67.0 +Version: 0.67.1 ### Gameplay You start in a randomly-generated world made entirely of cubes. You can explore From 09ee912096b9f5f8395ba36766d432195652265e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 29 Aug 2020 10:53:44 +0200 Subject: [PATCH 126/152] Fix crash when mob dies after poison/regen --- mods/ITEMS/mcl_potions/functions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 99d39b95d..dab96351e 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -87,7 +87,7 @@ minetest.register_globalstep(function(dtime) end - if is_poisoned[player].timer >= is_poisoned[player].dur then + if is_poisoned[player] and is_poisoned[player].timer >= is_poisoned[player].dur then is_poisoned[player] = nil if is_player then meta = player:get_meta() @@ -123,7 +123,7 @@ minetest.register_globalstep(function(dtime) end - if is_regenerating[player].timer >= is_regenerating[player].dur then + if is_regenerating[player] and is_regenerating[player].timer >= is_regenerating[player].dur then is_regenerating[player] = nil if is_player then meta = player:get_meta() From e361b3572425d8fd25bd8cf27ff63c47fcb792f2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 29 Aug 2020 10:57:33 +0200 Subject: [PATCH 127/152] Fix crash delete item entity with empty itemstring --- mods/ENTITIES/mcl_item_entity/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index a6f3fe110..d7c76f199 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -519,6 +519,7 @@ minetest.register_entity(":__builtin:item", { minetest.log("warning", "Item entity with empty itemstring found at "..minetest.pos_to_string(self.object:get_pos()).. "! Deleting it now.") self._removed = true self.object:remove() + return end local p = self.object:get_pos() From 9d101ce9239b153184357b46d6a85e35cd955dca Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 29 Aug 2020 11:11:40 +0200 Subject: [PATCH 128/152] Version 0.67.2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3fb2de290..34dc387ef 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. Developed by Wuzzy and contributors. Not developed or endorsed by Mojang AB. -Version: 0.67.1 +Version: 0.67.2 ### Gameplay You start in a randomly-generated world made entirely of cubes. You can explore From 766c76831d0ec8f8e9eb819b17e08a3eab76fd74 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 31 Aug 2020 11:19:00 +0400 Subject: [PATCH 129/152] Restore furnaces work when time_speed set to 0 (but for emegred areas only, as it was in 0.66.2) --- mods/ITEMS/mcl_furnaces/init.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index 108a60877..39103f18f 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -196,7 +196,11 @@ end local function furnace_reset_delta_time(pos) local meta = minetest.get_meta(pos) - local time_multiplier = 86400 / (minetest.settings:get('time_speed') or 72) + local time_speed = tonumber(minetest.settings:get('time_speed') or 72) + if (time_speed < 0.1) then + return + end + local time_multiplier = 86400 / time_speed local current_game_time = .0 + ((minetest.get_day_count() + minetest.get_timeofday()) * time_multiplier) -- TODO: Change meta:get/set_string() to get/set_float() for 'last_gametime'. @@ -212,10 +216,16 @@ local function furnace_reset_delta_time(pos) meta:set_string("last_gametime", tostring(current_game_time)) end -local function furnace_get_delta_time(pos) +local function furnace_get_delta_time(pos, elapsed) local meta = minetest.get_meta(pos) - local time_multiplier = 86400 / (minetest.settings:get('time_speed') or 72) - local current_game_time = .0 + ((minetest.get_day_count() + minetest.get_timeofday()) * time_multiplier) + local time_speed = tonumber(minetest.settings:get('time_speed') or 72) + local current_game_time + if (time_speed < 0.1) then + return meta, elapsed + else + local time_multiplier = 86400 / time_speed + current_game_time = .0 + ((minetest.get_day_count() + minetest.get_timeofday()) * time_multiplier) + end local last_game_time = meta:get_string("last_gametime") if last_game_time then @@ -238,7 +248,7 @@ local function furnace_node_timer(pos, elapsed) -- -- Inizialize metadata -- - local meta, elapsed_game_time = furnace_get_delta_time(pos) + local meta, elapsed_game_time = furnace_get_delta_time(pos, elapsed) local fuel_time = meta:get_float("fuel_time") or 0 local src_time = meta:get_float("src_time") or 0 From f2d68d909ee302f418bddccc35d107283079a564 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sat, 5 Sep 2020 21:49:12 +0400 Subject: [PATCH 130/152] Add some growth for unloaded farming plants --- mods/ITEMS/mcl_farming/shared_functions.lua | 106 ++++++++++++++++++-- 1 file changed, 97 insertions(+), 9 deletions(-) diff --git a/mods/ITEMS/mcl_farming/shared_functions.lua b/mods/ITEMS/mcl_farming/shared_functions.lua index e066092c3..6c682f839 100644 --- a/mods/ITEMS/mcl_farming/shared_functions.lua +++ b/mods/ITEMS/mcl_farming/shared_functions.lua @@ -1,22 +1,74 @@ local plant_lists = {} +local plant_nodename_to_id_list = {} + +local function get_intervals_counter(pos, interval, chance) + local meta = minetest.get_meta(pos) + local time_speed = tonumber(minetest.settings:get('time_speed') or 72) + local current_game_time + if time_speed == nil then + return 1 + end + if (time_speed < 0.1) then + return 1 + end + local time_multiplier = 86400 / time_speed + current_game_time = .0 + ((minetest.get_day_count() + minetest.get_timeofday()) * time_multiplier) + + local approx_interval = math.max(interval, 1) * math.max(chance, 1) + + local last_game_time = meta:get_string("last_gametime") + if last_game_time then + last_game_time = tonumber(last_game_time) + end + if not last_game_time or last_game_time < 1 then + last_game_time = current_game_time - approx_interval / 10 + elseif last_game_time == current_game_time then + current_game_time = current_game_time + approx_interval + end + + local elapsed_game_time = .0 + current_game_time - last_game_time + + meta:set_string("last_gametime", tostring(current_game_time)) + + return elapsed_game_time / approx_interval +end + +local function get_avg_light_level(pos) + local node_light = tonumber(minetest.get_node_light(pos) or 0) + local meta = minetest.get_meta(pos) + local counter = meta:get_int("avg_light_count") + local summary = meta:get_int("avg_light_summary") + if counter > 99 then + counter = 51 + summary = math.ceil((summary + 0.0) / 2.0) + else + counter = counter + 1 + end + summary = summary + node_light + meta:set_int("avg_light_count", counter) + meta:set_int("avg_light_summary", summary) + return math.ceil((summary + 0.0) / counter) +end function mcl_farming:add_plant(identifier, full_grown, names, interval, chance) plant_lists[identifier] = {} plant_lists[identifier].full_grown = full_grown plant_lists[identifier].names = names + plant_lists[identifier].interval = interval + plant_lists[identifier].chance = chance minetest.register_abm({ label = string.format("Farming plant growth (%s)", identifier), nodenames = names, interval = interval, chance = chance, action = function(pos, node) - if minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name ~= "mcl_farming:soil_wet" and math.random(0, 9) > 0 then - return - else - mcl_farming:grow_plant(identifier, pos, node) - end + local low_speed = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name ~= "mcl_farming:soil_wet" + mcl_farming:grow_plant(identifier, pos, node, false, false, low_speed) end, }) + for _, nodename in pairs(names) do + plant_nodename_to_id_list[nodename] = identifier + end end -- Attempts to advance a plant at pos by one or more growth stages (if possible) @@ -28,15 +80,34 @@ end -- Returns true if plant has been grown by 1 or more stages. -- Returns false if nothing changed. -function mcl_farming:grow_plant(identifier, pos, node, stages, ignore_light) - if not minetest.get_node_light(pos) and not ignore_light then +function mcl_farming:grow_plant(identifier, pos, node, stages, ignore_light, low_speed) + local average_light_level = get_avg_light_level(pos) + local plant_info = plant_lists[identifier] + local intervals_counter = get_intervals_counter(pos, plant_info.interval, plant_info.chance) + local low_speed = low_speed or false + if low_speed then + if intervals_counter < 1.01 and math.random(0, 9) > 0 then + return + else + intervals_counter = intervals_counter / 10 + end + end + if not minetest.get_node_light(pos) and not ignore_light and intervals_counter < 1.5 then return false end - if minetest.get_node_light(pos) < 10 and not ignore_light then + if minetest.get_node_light(pos) < 10 and not ignore_light and intervals_counter < 1.5 then return false end - local plant_info = plant_lists[identifier] + if intervals_counter >= 1.5 then + if average_light_level < 0.1 then + return false + end + if average_light_level < 10 then + intervals_counter = intervals_counter * average_light_level / 10 + end + end + local step = nil for i, name in ipairs(plant_info.names) do @@ -51,6 +122,7 @@ function mcl_farming:grow_plant(identifier, pos, node, stages, ignore_light) if not stages then stages = 1 end + stages = stages + math.ceil(intervals_counter) local new_node = {name = plant_info.names[step+stages]} if new_node.name == nil then new_node.name = plant_info.full_grown @@ -86,6 +158,7 @@ function mcl_farming:place_seed(itemstack, placer, pointed_thing, plantname) if string.find(farmland.name, "mcl_farming:soil") and string.find(place_s.name, "air") then minetest.sound_play(minetest.registered_nodes[plantname].sounds.place, {pos = pos}, true) minetest.add_node(pos, {name=plantname, param2 = minetest.registered_nodes[plantname].place_param2}) + local intervals_counter = get_intervals_counter(pos, 1, 1) else return end @@ -379,3 +452,18 @@ function mcl_farming:stem_color(startcolor, endcolor, step, step_count) local colorstring = string.format("#%02X%02X%02X", color.r, color.g, color.b) return colorstring end + +minetest.register_lbm({ + label = "Add growth for unloaded farming plants", + name = "mcl_farming:growth", + nodenames = {"group:plant"}, + run_at_every_load = true, + action = function(pos, node) + local identifier = plant_nodename_to_id_list[node.name] + if not identifier then + return + end + local low_speed = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name ~= "mcl_farming:soil_wet" + mcl_farming:grow_plant(identifier, pos, node, false, false, low_speed) + end, +}) From 28f19fdbb481cd76c1e5f63e84a23339057b193f Mon Sep 17 00:00:00 2001 From: kay27 Date: Tue, 8 Sep 2020 07:21:29 +0400 Subject: [PATCH 131/152] Fix potion names, https://git.minetest.land/Wuzzy/MineClone2/issues/829 --- mods/ITEMS/mcl_fishing/init.lua | 2 +- mods/ITEMS/mcl_potions/init.lua | 2 +- mods/PLAYER/wieldview/transform.lua | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 514cd6cf4..1cab8b3ac 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -69,7 +69,7 @@ local fish = function(itemstack, player) { itemstring = "mcl_mobitems:rotten_flesh", weight = 10 }, { itemstring = "mcl_core:stick", weight = 5 }, { itemstring = "mcl_mobitems:string", weight = 5 }, - { itemstring = "mcl_potions:potion_water", weight = 10 }, + { itemstring = "mcl_potions:water", weight = 10 }, { itemstring = "mcl_mobitems:bone", weight = 10 }, { itemstring = "mcl_dye:black", weight = 1, amount_min = 10, amount_max = 10 }, { itemstring = "mcl_mobitems:string", weight = 10 }, -- TODO: Tripwire Hook diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 1083b0c33..4b96a80dc 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -182,7 +182,7 @@ local fill_cauldron = function(cauldron, water_type) end end --- Itemstring of potions is “mcl_potions:potion_” +-- Itemstring of potions is “mcl_potions:” minetest.register_craftitem("mcl_potions:water", { description = S("Water Bottle"), diff --git a/mods/PLAYER/wieldview/transform.lua b/mods/PLAYER/wieldview/transform.lua index c1715b2c4..0b0145c7f 100644 --- a/mods/PLAYER/wieldview/transform.lua +++ b/mods/PLAYER/wieldview/transform.lua @@ -28,10 +28,10 @@ wieldview.transform = { ["mcl_buckets:bucket_lava"]="R270", ["mcl_mobitems:milk_bucket"]="R270", ["mcl_potions:glass_bottle"]="R270", - ["mcl_potions:potion_water"]="R270", - ["mcl_potions:potion_awkward"]="R270", - ["mcl_potions:potion_thick"]="R270", - ["mcl_potions:potion_mundane"]="R270", + ["mcl_potions:water"]="R270", + ["mcl_potions:awkward"]="R270", + ["mcl_potions:thick"]="R270", + ["mcl_potions:mundane"]="R270", ["screwdriver:screwdriver"]="R270", ["screwdriver:screwdriver1"]="R270", From a2281f384b4899c1d642275dd9d59a53b024cd5f Mon Sep 17 00:00:00 2001 From: kay27 Date: Tue, 8 Sep 2020 15:06:52 +0400 Subject: [PATCH 132/152] Add blast resistance for stairs and slabs --- mods/ITEMS/mcl_stairs/api.lua | 19 ++++-- mods/ITEMS/mcl_stairs/register.lua | 101 +++++++++++++++++++---------- mods/ITEMS/mclx_stairs/init.lua | 54 +++++++++++---- 3 files changed, 122 insertions(+), 52 deletions(-) diff --git a/mods/ITEMS/mcl_stairs/api.lua b/mods/ITEMS/mcl_stairs/api.lua index 1c81167f6..aecf10836 100644 --- a/mods/ITEMS/mcl_stairs/api.lua +++ b/mods/ITEMS/mcl_stairs/api.lua @@ -70,7 +70,7 @@ end -- Register stairs. -- Node will be called mcl_stairs:stair_ -function mcl_stairs.register_stair(subname, recipeitem, groups, images, description, sounds, hardness, corner_stair_texture_override) +function mcl_stairs.register_stair(subname, recipeitem, groups, images, description, sounds, blast_resistance, hardness, corner_stair_texture_override) groups.stair = 1 groups.building_block = 1 @@ -87,6 +87,9 @@ function mcl_stairs.register_stair(subname, recipeitem, groups, images, descript if not hardness then hardness = minetest.registered_items[recipeitem]._mcl_hardness end + if not blast_resistance then + blast_resistance = minetest.registered_items[recipeitem]._mcl_blast_resistance + end end minetest.register_node(":mcl_stairs:stair_" .. subname, { @@ -146,6 +149,7 @@ function mcl_stairs.register_stair(subname, recipeitem, groups, images, descript return true end end, + _mcl_blast_resistance = blast_resistance, _mcl_hardness = hardness, }) @@ -182,7 +186,7 @@ local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4} -- double_description: NEW argument, not supported in Minetest Game -- double_description: Description of double slab -function mcl_stairs.register_slab(subname, recipeitem, groups, images, description, sounds, hardness, double_description) +function mcl_stairs.register_slab(subname, recipeitem, groups, images, description, sounds, blast_resistance, hardness, double_description) local lower_slab = "mcl_stairs:slab_"..subname local upper_slab = lower_slab.."_top" local double_slab = lower_slab.."_double" @@ -200,6 +204,9 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti if not hardness then hardness = minetest.registered_items[recipeitem]._mcl_hardness end + if not blast_resistance then + blast_resistance = minetest.registered_items[recipeitem]._mcl_blast_resistance + end end -- Automatically generate double slab description @@ -347,10 +354,10 @@ end -- Nodes will be called mcl_stairs:{stair,slab}_ function mcl_stairs.register_stair_and_slab(subname, recipeitem, - groups, images, desc_stair, desc_slab, sounds, hardness, + groups, images, desc_stair, desc_slab, sounds, blast_resistance, hardness, double_description, corner_stair_texture_override) - mcl_stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds, hardness, corner_stair_texture_override) - mcl_stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds, hardness, double_description) + mcl_stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds, blast_resistance, hardness, corner_stair_texture_override) + mcl_stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds, blast_resistance, hardness, double_description) end -- Very simple registration function @@ -365,6 +372,6 @@ function mcl_stairs.register_stair_and_slab_simple(subname, sourcenode, desc_sta groups[allowed_groups[a]] = def.groups[allowed_groups[a]] end end - mcl_stairs.register_stair_and_slab(subname, sourcenode, groups, def.tiles, desc_stair, desc_slab, def.sounds, def._mcl_hardness, desc_double_slab, corner_stair_texture_override) + mcl_stairs.register_stair_and_slab(subname, sourcenode, groups, def.tiles, desc_stair, desc_slab, def.sounds, def._mcl_blast_resistance, def._mcl_hardness, desc_double_slab, corner_stair_texture_override) end diff --git a/mods/ITEMS/mcl_stairs/register.lua b/mods/ITEMS/mcl_stairs/register.lua index e545836e0..565f5409b 100644 --- a/mods/ITEMS/mcl_stairs/register.lua +++ b/mods/ITEMS/mcl_stairs/register.lua @@ -20,15 +20,13 @@ for w=1, #woods do {handy=1,axey=1, flammable=3,wood_stairs=1, material_wood=1, fire_encouragement=5, fire_flammability=20}, {wood[2]}, wood[3], - mcl_sounds.node_sound_wood_defaults(), - 2, + mcl_sounds.node_sound_wood_defaults(), 3, 2, "woodlike") mcl_stairs.register_slab(wood[1], "mcl_core:"..wood[1], {handy=1,axey=1, flammable=3,wood_slab=1, material_wood=1, fire_encouragement=5, fire_flammability=20}, {wood[2]}, wood[4], - mcl_sounds.node_sound_wood_defaults(), - 2, + mcl_sounds.node_sound_wood_defaults(), 3, 2, wood[5]) end @@ -38,7 +36,8 @@ mcl_stairs.register_slab("stone", "mcl_core:stone_smooth", {pickaxey=1, material_stone=1}, {"mcl_stairs_stone_slab_top.png", "mcl_stairs_stone_slab_top.png", "mcl_stairs_stone_slab_side.png"}, S("Polished Stone Slab"), - mcl_sounds.node_sound_stone_defaults(), 2, S("Double Polished Stone Slab")) + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Polished Stone Slab")) mcl_stairs.register_stair_and_slab_simple("andesite", "mcl_core:andesite", S("Andesite Stairs"), S("Andesite Slab"), S("Double Andesite Slab")) mcl_stairs.register_stair_and_slab_simple("granite", "mcl_core:granite", S("Granite Stairs"), S("Granite Slab"), S("Double Granite Slab")) @@ -54,24 +53,28 @@ mcl_stairs.register_stair("sandstone", "group:normal_sandstone", {pickaxey=1, material_stone=1}, {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, S("Sandstone Stairs"), - mcl_sounds.node_sound_stone_defaults(), 0.8, nil, "mcl_core:sandstone") + mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, + nil, "mcl_core:sandstone") --fixme: extra parameter from previous release mcl_stairs.register_slab("sandstone", "group:normal_sandstone", {pickaxey=1, material_stone=1}, {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"}, S("Sandstone Slab"), - mcl_sounds.node_sound_stone_defaults(), 2, S("Double Sandstone Slab"), "mcl_core:sandstone") + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Sandstone Slab"), "mcl_core:sandstone") --fixme: extra parameter from previous release mcl_stairs.register_stair_and_slab_simple("sandstonesmooth2", "mcl_core:sandstonesmooth2", S("Smooth Sandstone Stairs"), S("Smooth Sandstone Slab"), S("Double Smooth Sandstone Slab")) mcl_stairs.register_stair("redsandstone", "group:red_sandstone", {pickaxey=1, material_stone=1}, {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, S("Red Sandstone Stairs"), - mcl_sounds.node_sound_stone_defaults(), 0.8, nil, "mcl_core:redsandstone") + mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, + nil, "mcl_core:redsandstone") --fixme: extra parameter from previous release mcl_stairs.register_slab("redsandstone", "group:red_sandstone", {pickaxey=1, material_stone=1}, {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"}, S("Red Sandstone Slab"), - mcl_sounds.node_sound_stone_defaults(), 2, S("Double Red Sandstone Slab"), "mcl_core:redsandstone") + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Red Sandstone Slab"), "mcl_core:redsandstone") --fixme: extra parameter from previous release mcl_stairs.register_stair_and_slab_simple("redsandstonesmooth2", "mcl_core:redsandstonesmooth2", S("Smooth Red Sandstone Stairs"), S("Smooth Red Sandstone Slab"), S("Double Smooth Red Sandstone Slab")) -- Intentionally not group:stonebrick because of mclx_stairs @@ -79,23 +82,27 @@ mcl_stairs.register_stair("stonebrick", "mcl_core:stonebrick", {pickaxey=1, material_stone=1}, {"default_stone_brick.png"}, S("Stone Bricks Stairs"), - mcl_sounds.node_sound_stone_defaults(), 1.5, nil, "mcl_core:stonebrick") + mcl_sounds.node_sound_stone_defaults(), 6, 1.5, + nil, "mcl_core:stonebrick") --fixme: extra parameter from previous release mcl_stairs.register_slab("stonebrick", "mcl_core:stonebrick", {pickaxey=1, material_stone=1}, {"default_stone_brick.png"}, S("Stone Bricks Slab"), - mcl_sounds.node_sound_stone_defaults(), 2, S("Double Stone Bricks Slab"), "mcl_core:stonebrick") + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Stone Bricks Slab"), "mcl_core:stonebrick") --fixme: extra parameter from previous release mcl_stairs.register_stair("quartzblock", "group:quartz_block", {pickaxey=1, material_stone=1}, {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, S("Quartz Stairs"), - mcl_sounds.node_sound_stone_defaults(), 0.8, nil, "mcl_nether:quartz_block") + mcl_sounds.node_sound_stone_defaults(), 0.8, 0.8, + nil, "mcl_nether:quartz_block") --fixme: extra parameter from previous release mcl_stairs.register_slab("quartzblock", "group:quartz_block", {pickaxey=1, material_stone=1}, {"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"}, S("Quartz Slab"), - mcl_sounds.node_sound_stone_defaults(), 2, S("Double Quartz Slab"), "mcl_nether:quartz_block") + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Quartz Slab"), "mcl_nether:quartz_block") --fixme: extra parameter from previous release mcl_stairs.register_stair_and_slab_simple("quartz_smooth", "mcl_nether:quartz_smooth", S("Smooth Quartz Stairs"), S("Smooth Quartz Slab"), S("Double Smooth Quartz Slab")) @@ -104,17 +111,15 @@ mcl_stairs.register_stair_and_slab("nether_brick", "mcl_nether:nether_brick", {"mcl_nether_nether_brick.png"}, S("Nether Brick Stairs"), S("Nether Brick Slab"), - mcl_sounds.node_sound_stone_defaults(), - 2, - S("Double Nether Brick Slab")) + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Nether Brick Slab"), nil) mcl_stairs.register_stair_and_slab("red_nether_brick", "mcl_nether:red_nether_brick", {pickaxey=1, material_stone=1}, {"mcl_nether_red_nether_brick.png"}, S("Red Nether Brick Stairs"), S("Red Nether Brick Slab"), - mcl_sounds.node_sound_stone_defaults(), - 2, - S("Double Red Nether Brick Slab")) + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Red Nether Brick Slab"), nil) mcl_stairs.register_stair_and_slab_simple("end_bricks", "mcl_end:end_bricks", S("End Stone Brick Stairs"), S("End Stone Brick Slab"), S("Double End Stone Brick Slab")) @@ -122,14 +127,13 @@ mcl_stairs.register_stair("purpur_block", "group:purpur_block", {pickaxey=1, material_stone=1}, {"mcl_end_purpur_block.png"}, S("Purpur Stairs"), - mcl_sounds.node_sound_stone_defaults(), - 1.5) + mcl_sounds.node_sound_stone_defaults(), 6, 1.5, + nil) mcl_stairs.register_slab("purpur_block", "group:purpur_block", {pickaxey=1, material_stone=1}, {"mcl_end_purpur_block.png"}, S("Purpur Slab"), - mcl_sounds.node_sound_stone_defaults(), - 2, + mcl_sounds.node_sound_stone_defaults(), 6, 2, S("Double Purpur Slab")) mcl_stairs.register_stair_and_slab_simple("prismarine", "mcl_ocean:prismarine", S("Prismarine Stairs"), S("Prismarine Slab"), S("Double Prismarine Slab")) @@ -137,27 +141,56 @@ mcl_stairs.register_stair_and_slab_simple("prismarine", "mcl_ocean:prismarine", mcl_stairs.register_stair_and_slab_simple("prismarine_brick", "mcl_ocean:prismarine_brick", S("Prismarine Brick Stairs"), S("Prismarine Brick Slab"), S("Double Prismarine Brick Slab")) mcl_stairs.register_stair_and_slab_simple("prismarine_dark", "mcl_ocean:prismarine_dark", S("Dark Prismarine Stairs"), S("Dark Prismarine Slab"), S("Double Dark Prismarine Slab")) -mcl_stairs.register_slab("andesite_smooth", "mcl_core:andesite_smooth", {pickaxey=1}, {"mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, S("Polished Andesite Slab"), nil, nil, S("Double Polished Andesite Slab")) -mcl_stairs.register_stair("andesite_smooth", "mcl_core:andesite_smooth", {pickaxey=1}, {"mcl_stairs_andesite_smooth_slab.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, S("Polished Andesite Stairs"), nil, nil, "woodlike") +mcl_stairs.register_slab("andesite_smooth", "mcl_core:andesite_smooth", + {pickaxey=1}, + {"mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, + S("Polished Andesite Slab"), + nil, 6, nil, + S("Double Polished Andesite Slab")) +mcl_stairs.register_stair("andesite_smooth", "mcl_core:andesite_smooth", + {pickaxey=1}, + {"mcl_stairs_andesite_smooth_slab.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, + S("Polished Andesite Stairs"), + nil, 6, nil, + "woodlike") -mcl_stairs.register_slab("granite_smooth", "mcl_core:granite_smooth", {pickaxey=1}, {"mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, S("Polished Granite Slab"), nil, nil, S("Double Polished Granite Slab")) -mcl_stairs.register_stair("granite_smooth", "mcl_core:granite_smooth", {pickaxey=1}, {"mcl_stairs_granite_smooth_slab.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, S("Polished Granite Stairs"), nil, nil, "woodlike") +mcl_stairs.register_slab("granite_smooth", "mcl_core:granite_smooth", + {pickaxey=1}, + {"mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, + S("Polished Granite Slab"), + nil, 6, nil, + S("Double Polished Granite Slab")) +mcl_stairs.register_stair("granite_smooth", "mcl_core:granite_smooth", + {pickaxey=1}, + {"mcl_stairs_granite_smooth_slab.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, + S("Polished Granite Stairs"), + nil, 6, nil, + "woodlike") -mcl_stairs.register_slab("diorite_smooth", "mcl_core:diorite_smooth", {pickaxey=1}, {"mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, S("Polished Diorite Slab"), nil, nil, S("Double Polished Diorite Slab")) -mcl_stairs.register_stair("diorite_smooth", "mcl_core:diorite_smooth", {pickaxey=1}, {"mcl_stairs_diorite_smooth_slab.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, S("Polished Diorite Stairs"), nil, nil, "woodlike") +mcl_stairs.register_slab("diorite_smooth", "mcl_core:diorite_smooth", + {pickaxey=1}, + {"mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, + S("Polished Diorite Slab"), + nil, 6, nil, + S("Double Polished Diorite Slab")) +mcl_stairs.register_stair("diorite_smooth", "mcl_core:diorite_smooth", + {pickaxey=1}, + {"mcl_stairs_diorite_smooth_slab.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, + S("Polished Diorite Stairs"), + nil, 6, nil, + "woodlike") mcl_stairs.register_stair("stonebrickmossy", "mcl_core:stonebrickmossy", {pickaxey=1}, {"mcl_core_stonebrick_mossy.png"}, S("Mossy Stone Brick Stairs"), - mcl_sounds.node_sound_stone_defaults(), 1.5, nil, "mcl_core:stonebrickmossy") + mcl_sounds.node_sound_stone_defaults(), 6, 1.5, + nil) mcl_stairs.register_slab("stonebrickmossy", "mcl_core:stonebrickmossy", {pickaxey=1}, {"mcl_core_stonebrick_mossy.png"}, S("Mossy Stone Brick Slab"), - mcl_sounds.node_sound_stone_defaults(), 2, S("Double Mossy Stone Brick Slab"), "mcl_core:stonebrickmossy") - - - + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Mossy Stone Brick Slab"), "mcl_core:stonebrickmossy") --fixme: extra parameter from previous release diff --git a/mods/ITEMS/mclx_stairs/init.lua b/mods/ITEMS/mclx_stairs/init.lua index 450436da6..26ab5c4b5 100644 --- a/mods/ITEMS/mclx_stairs/init.lua +++ b/mods/ITEMS/mclx_stairs/init.lua @@ -22,38 +22,68 @@ for b=1, #barks do {handy=1,axey=1, flammable=3, bark_stairs=1, material_wood=1, fire_encouragement=5, fire_flammability=5}, {minetest.registered_nodes[id].tiles[3]}, bark[2], - mcl_sounds.node_sound_wood_defaults(), - 2, + mcl_sounds.node_sound_wood_defaults(), 3, 2, "woodlike") mcl_stairs.register_slab(sub, id, {handy=1,axey=1, flammable=3, bark_slab=1, material_wood=1, fire_encouragement=5, fire_flammability=5}, {minetest.registered_nodes[id].tiles[3]}, bark[3], - mcl_sounds.node_sound_wood_defaults(), - 2, + mcl_sounds.node_sound_wood_defaults(), 3, 2, bark[4]) end -mcl_stairs.register_slab("lapisblock", "mcl_core:lapisblock", {pickaxey=3}, {"mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_stairs_lapis_block_slab.png"}, S("Lapis Lazuli Slab"), nil, nil, S("Double Lapis Lazuli Slab")) -mcl_stairs.register_stair("lapisblock", "mcl_core:lapisblock", {pickaxey=3}, {"mcl_stairs_lapis_block_slab.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_stairs_lapis_block_slab.png"}, S("Lapis Lazuli Stairs"), nil, nil, "woodlike") +mcl_stairs.register_slab("lapisblock", "mcl_core:lapisblock", + {pickaxey=3}, + {"mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_stairs_lapis_block_slab.png"}, + S("Lapis Lazuli Slab"), + nil, nil, nil, + S("Double Lapis Lazuli Slab")) +mcl_stairs.register_stair("lapisblock", "mcl_core:lapisblock", + {pickaxey=3}, + {"mcl_stairs_lapis_block_slab.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_stairs_lapis_block_slab.png"}, + S("Lapis Lazuli Stairs"), + nil, 6, nil, + "woodlike") -mcl_stairs.register_slab("goldblock", "mcl_core:goldblock", {pickaxey=4}, {"default_gold_block.png", "default_gold_block.png", "mcl_stairs_gold_block_slab.png"}, S("Slab of Gold"), nil, nil, S("Double Slab of Gold")) -mcl_stairs.register_stair("goldblock", "mcl_core:goldblock", {pickaxey=4}, {"mcl_stairs_gold_block_slab.png", "default_gold_block.png", "default_gold_block.png", "default_gold_block.png", "default_gold_block.png", "mcl_stairs_gold_block_slab.png"}, S("Stairs of Gold"), nil, nil, "woodlike") +mcl_stairs.register_slab("goldblock", "mcl_core:goldblock", + {pickaxey=4}, + {"default_gold_block.png", "default_gold_block.png", "mcl_stairs_gold_block_slab.png"}, + S("Slab of Gold"), + nil, nil, nil, + S("Double Slab of Gold")) +mcl_stairs.register_stair("goldblock", "mcl_core:goldblock", + {pickaxey=4}, + {"mcl_stairs_gold_block_slab.png", "default_gold_block.png", "default_gold_block.png", "default_gold_block.png", "default_gold_block.png", "mcl_stairs_gold_block_slab.png"}, + S("Stairs of Gold"), + nil, 6, nil, + "woodlike") -mcl_stairs.register_slab("ironblock", "mcl_core:ironblock", {pickaxey=2}, {"default_steel_block.png", "default_steel_block.png", "mcl_stairs_iron_block_slab.png"}, S("Slab of Iron"), nil, nil, S("Double Slab of Iron")) -mcl_stairs.register_stair("ironblock", "mcl_core:ironblock", {pickaxey=2}, {"mcl_stairs_iron_block_slab.png", "default_steel_block.png", "default_steel_block.png", "default_steel_block.png", "default_steel_block.png", "mcl_stairs_iron_block_slab.png"}, S("Stairs of Iron"), nil, nil, "woodlike") +mcl_stairs.register_slab("ironblock", "mcl_core:ironblock", + {pickaxey=2}, + {"default_steel_block.png", "default_steel_block.png", "mcl_stairs_iron_block_slab.png"}, + S("Slab of Iron"), + nil, nil, nil, + S("Double Slab of Iron")) +mcl_stairs.register_stair("ironblock", "mcl_core:ironblock", + {pickaxey=2}, + {"mcl_stairs_iron_block_slab.png", "default_steel_block.png", "default_steel_block.png", "default_steel_block.png", "default_steel_block.png", "mcl_stairs_iron_block_slab.png"}, + S("Stairs of Iron"), + nil, 6, nil, + "woodlike") mcl_stairs.register_stair("stonebrickcracked", "mcl_core:stonebrickcracked", {pickaxey=1}, {"mcl_core_stonebrick_cracked.png"}, S("Cracked Stone Brick Stairs"), - mcl_sounds.node_sound_stone_defaults(), 1.5, nil, "mcl_core:stonebrickcracked") + mcl_sounds.node_sound_stone_defaults(), 6, 1.5, + "woodlike") mcl_stairs.register_slab("stonebrickcracked", "mcl_core:stonebrickcracked", {pickaxey=1}, {"mcl_core_stonebrick_cracked.png"}, S("Cracked Stone Brick Slab"), - mcl_sounds.node_sound_stone_defaults(), 2, S("Double Cracked Stone Brick Slab"), "mcl_core:stonebrickcracked") + mcl_sounds.node_sound_stone_defaults(), 6, 2, + S("Double Cracked Stone Brick Slab")) local block = {} block.dyes = { From 7bbb7438aefb30b12e4b998f6b40392e328f2f22 Mon Sep 17 00:00:00 2001 From: kay27 Date: Tue, 8 Sep 2020 18:15:57 +0400 Subject: [PATCH 133/152] Fix bed checks, see https://git.minetest.land/Wuzzy/MineClone2/issues/785 --- mods/ITEMS/mcl_beds/functions.lua | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index 389871497..1d7845bfc 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -68,9 +68,15 @@ local function lay_down(player, pos, bed_pos, state, skip) return false end + local yaw, param2, dir, bed_pos2, bed_center if bed_pos then + yaw, param2 = get_look_yaw(bed_pos) + dir = minetest.facedir_to_dir(param2) + bed_pos2 = {x = bed_pos.x - dir.x, y = bed_pos.y, z = bed_pos.z - dir.z} + bed_center = {x = bed_pos.x - dir.x/2, y = bed_pos.y + 0.1, z = bed_pos.z - dir.z/2} + -- No sleeping if too far away - if vector.distance(bed_pos, pos) > 2 then + if vector.distance(bed_pos, pos) > 2 and vector.distance(bed_pos2, pos) > 2 then minetest.chat_send_player(name, S("You can't sleep, the bed's too far away!")) return false end @@ -132,7 +138,7 @@ local function lay_down(player, pos, bed_pos, state, skip) -- physics, eye_offset, etc player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}) if player:get_look_vertical() > 0 then - player:set_look_vertical(0) + player:set_look_vertical(0) -- this doesn't work :( end mcl_player.player_attached[name] = false playerphysics.remove_physics_factor(player, "speed", "mcl_beds:sleeping") @@ -143,13 +149,12 @@ local function lay_down(player, pos, bed_pos, state, skip) -- lay down else - local yaw, param2 = get_look_yaw(bed_pos) - local dir = minetest.facedir_to_dir(param2) - local p = {x = bed_pos.x - dir.x/2, y = bed_pos.y, z = bed_pos.z - dir.z/2} - local n1 = minetest.get_node({x=bed_pos.x, y=bed_pos.y+1, z=bed_pos.z}) - local n2 = minetest.get_node({x=bed_pos.x, y=bed_pos.y+2, z=bed_pos.z}) + local n1 = minetest.get_node({x = bed_pos.x, y = bed_pos.y + 1, z = bed_pos.z}) + local n2 = minetest.get_node({x = bed_pos2.x, y = bed_pos2.y + 1, z = bed_pos2.z}) + local n3 = minetest.get_node({x = bed_pos.x, y = bed_pos.y + 2, z = bed_pos.z}) local def1 = minetest.registered_nodes[n1.name] local def2 = minetest.registered_nodes[n2.name] + local def3 = minetest.registered_nodes[n3.name] if def1.walkable or def2.walkable then minetest.chat_send_player(name, S("You can't sleep, the bed is obstructed!")) return false @@ -160,8 +165,13 @@ local function lay_down(player, pos, bed_pos, state, skip) local spawn_changed = false if minetest.get_modpath("mcl_spawn") then - local spos = table.copy(bed_pos) - spos.y = spos.y + 0.1 + local spos + if def3.walkable then -- no place for spawning in bed - use player's current pos (near the bed) + spos = table.copy(pos) + else + spos = table.copy(bed_pos) + spos.y = spos.y + 0.1 + end spawn_changed = mcl_spawn.set_spawn_pos(player, spos) -- save respawn position when entering bed end @@ -192,7 +202,7 @@ local function lay_down(player, pos, bed_pos, state, skip) player:get_meta():set_string("mcl_beds:sleeping", "true") playerphysics.add_physics_factor(player, "speed", "mcl_beds:sleeping", 0) playerphysics.add_physics_factor(player, "jump", "mcl_beds:sleeping", 0) - player:set_pos(p) + player:set_pos(bed_center) mcl_player.player_attached[name] = true hud_flags.wielditem = false mcl_player.player_set_animation(player, "lay" , 0) From daede2a183ed3f36699c11935d199389e87c80a2 Mon Sep 17 00:00:00 2001 From: kay27 Date: Wed, 9 Sep 2020 14:35:44 +0400 Subject: [PATCH 134/152] Improve around-the-bed-respawn place search algorithm: square spiral up to 7 x/z nodes, thanks anon5, https://git.minetest.land/Wuzzy/MineClone2/issues/785 --- mods/ITEMS/mcl_beds/functions.lua | 12 +----- mods/PLAYER/mcl_spawn/init.lua | 66 ++++++++++++++++++++----------- 2 files changed, 46 insertions(+), 32 deletions(-) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index 1d7845bfc..d7bf13bc8 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -151,10 +151,8 @@ local function lay_down(player, pos, bed_pos, state, skip) else local n1 = minetest.get_node({x = bed_pos.x, y = bed_pos.y + 1, z = bed_pos.z}) local n2 = minetest.get_node({x = bed_pos2.x, y = bed_pos2.y + 1, z = bed_pos2.z}) - local n3 = minetest.get_node({x = bed_pos.x, y = bed_pos.y + 2, z = bed_pos.z}) local def1 = minetest.registered_nodes[n1.name] local def2 = minetest.registered_nodes[n2.name] - local def3 = minetest.registered_nodes[n3.name] if def1.walkable or def2.walkable then minetest.chat_send_player(name, S("You can't sleep, the bed is obstructed!")) return false @@ -165,14 +163,8 @@ local function lay_down(player, pos, bed_pos, state, skip) local spawn_changed = false if minetest.get_modpath("mcl_spawn") then - local spos - if def3.walkable then -- no place for spawning in bed - use player's current pos (near the bed) - spos = table.copy(pos) - else - spos = table.copy(bed_pos) - spos.y = spos.y + 0.1 - end - spawn_changed = mcl_spawn.set_spawn_pos(player, spos) -- save respawn position when entering bed + -- save respawn position when entering bed + spawn_changed = mcl_spawn.set_spawn_pos(player, bed_pos, false) end -- Check day of time and weather diff --git a/mods/PLAYER/mcl_spawn/init.lua b/mods/PLAYER/mcl_spawn/init.lua index 66fe8cdd0..bf048e4b8 100644 --- a/mods/PLAYER/mcl_spawn/init.lua +++ b/mods/PLAYER/mcl_spawn/init.lua @@ -70,16 +70,17 @@ mcl_spawn.set_spawn_pos = function(player, pos, message) meta:set_string("mcl_beds:spawn", "") else local oldpos = minetest.string_to_pos(meta:get_string("mcl_beds:spawn")) + meta:set_string("mcl_beds:spawn", minetest.pos_to_string(pos)) if oldpos then -- We don't bother sending a message if the new spawn pos is basically the same - if vector.distance(pos, oldpos) > 0.1 then - spawn_changed = true - if message then - minetest.chat_send_player(player:get_player_name(), S("New respawn position set!")) - end - end + spawn_changed = vector.distance(pos, oldpos) > 0.1 + else + -- If it wasn't set and now it will be set, it means it is changed + spawn_changed = true + end + if spawn_changed and message then + minetest.chat_send_player(player:get_player_name(), S("New respawn position set!")) end - meta:set_string("mcl_beds:spawn", minetest.pos_to_string(pos)) end return spawn_changed end @@ -93,31 +94,52 @@ local function get_far_node(pos) return minetest.get_node(pos) end +local function good_for_respawn(pos) + local node0 = get_far_node({x = pos.x, y = pos.y - 1, z = pos.z}) + local node1 = get_far_node({x = pos.x, y = pos.y, z = pos.z}) + local node2 = get_far_node({x = pos.x, y = pos.y + 1, z = pos.z}) + local def0 = minetest.registered_nodes[node0.name] + local def1 = minetest.registered_nodes[node1.name] + local def2 = minetest.registered_nodes[node2.name] + return def0.walkable and (not def1.walkable) and (not def2.walkable) and + (def1.damage_per_second == nil or def2.damage_per_second <= 0) and + (def1.damage_per_second == nil or def2.damage_per_second <= 0) +end + -- Respawn player at specified respawn position minetest.register_on_respawnplayer(function(player) local pos, custom_spawn = mcl_spawn.get_spawn_pos(player) if pos and custom_spawn then -- Check if bed is still there - -- and the spawning position is free of solid or damaging blocks. local node_bed = get_far_node(pos) - local node_up1 = get_far_node({x=pos.x,y=pos.y+1,z=pos.z}) - local node_up2 = get_far_node({x=pos.x,y=pos.y+2,z=pos.z}) local bgroup = minetest.get_item_group(node_bed.name, "bed") - local def1 = minetest.registered_nodes[node_up1.name] - local def2 = minetest.registered_nodes[node_up2.name] - if (bgroup == 1 or bgroup == 2) and - (not def1.walkable) and (not def2.walkable) and - (def1.damage_per_second == nil or def2.damage_per_second <= 0) and - (def1.damage_per_second == nil or def2.damage_per_second <= 0) then - player:set_pos(pos) - return true - else - -- Forget spawn if bed was missing - if (bgroup ~= 1 and bgroup ~= 2) then - mcl_spawn.set_spawn_pos(player, nil) + if bgroup ~= 1 and bgroup ~= 2 then + -- Bed is destroyed: + if player ~= nil and player:is_player() then + player:get_meta():set_string("mcl_beds:spawn", "") end minetest.chat_send_player(player:get_player_name(), S("Your spawn bed was missing or blocked.")) + return false end + -- Find spawning position on/near the bed free of solid or damaging blocks iterating a square spiral 15x15: + local x, z, dx, dz = 0, 0, 0, -1 + for i = 1, 225 do + if x > -8 and x < 8 and z > -8 and z < 8 then + for _,y in ipairs({0, 1, -1, 2, -2, 3, -3, 4, -4}) do + local spawn_pos = {x = pos.x - z, y=pos.y + y, z = pos.z - x} + if good_for_respawn(spawn_pos) then + player:set_pos(spawn_pos) + return true + end + end + end + if x == z or (x < 0 and x == -z) or (x > 0 and x == 1 - z) then + dx, dz = -dz, dx + end + x, z = x + dx, z + dz + end + -- We here if we didn't find suitable place for respawn: + return false end end) From b47ff2b9becc36b916c3c5bc7b3754b1ac3da09b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 10 Sep 2020 15:34:53 +0200 Subject: [PATCH 135/152] Use pure-API version of tt mod --- mods/HELP/mcl_tt/init.lua | 105 +----------------- mods/HELP/mcl_tt/locale/mcl_tt.de.tr | 30 +++++ mods/HELP/mcl_tt/locale/mcl_tt.fr.tr | 30 +++++ mods/HELP/mcl_tt/locale/mcl_tt.ru.tr | 30 +++++ mods/HELP/mcl_tt/locale/template.txt | 30 +++++ .../snippets_base.lua} | 2 +- mods/HELP/mcl_tt/snippets_mcl.lua | 103 +++++++++++++++++ mods/HELP/tt/API.md | 2 - mods/HELP/tt/README.md | 8 +- mods/HELP/tt/init.lua | 7 +- mods/HELP/tt/locale/template.txt | 31 ------ mods/HELP/tt/locale/tt.de.tr | 31 ------ mods/HELP/tt/locale/tt.fr.tr | 31 ------ mods/HELP/tt/locale/tt.ru.tr | 31 ------ mods/HELP/tt/mod.conf | 2 +- .../tt/{snippets_core.lua => snippets.lua} | 2 +- 16 files changed, 231 insertions(+), 244 deletions(-) rename mods/HELP/{tt/snippets_builtin.lua => mcl_tt/snippets_base.lua} (99%) create mode 100644 mods/HELP/mcl_tt/snippets_mcl.lua delete mode 100644 mods/HELP/tt/locale/template.txt delete mode 100644 mods/HELP/tt/locale/tt.de.tr delete mode 100644 mods/HELP/tt/locale/tt.fr.tr delete mode 100644 mods/HELP/tt/locale/tt.ru.tr rename mods/HELP/tt/{snippets_core.lua => snippets.lua} (88%) diff --git a/mods/HELP/mcl_tt/init.lua b/mods/HELP/mcl_tt/init.lua index 569dbe686..9d0113040 100644 --- a/mods/HELP/mcl_tt/init.lua +++ b/mods/HELP/mcl_tt/init.lua @@ -1,103 +1,2 @@ -local S = minetest.get_translator("mcl_tt") - --- Armor -tt.register_snippet(function(itemstring) - local def = minetest.registered_items[itemstring] - local s = "" - local head = minetest.get_item_group(itemstring, "armor_head") - local torso = minetest.get_item_group(itemstring, "armor_torso") - local legs = minetest.get_item_group(itemstring, "armor_legs") - local feet = minetest.get_item_group(itemstring, "armor_feet") - if head > 0 then - s = s .. S("Head armor") - end - if torso > 0 then - s = s .. S("Torso armor") - end - if legs > 0 then - s = s .. S("Legs armor") - end - if feet > 0 then - s = s .. S("Feet armor") - end - if s == "" then - s = nil - end - return s -end) -tt.register_snippet(function(itemstring) - local def = minetest.registered_items[itemstring] - local s = "" - local use = minetest.get_item_group(itemstring, "mcl_armor_uses") - local pts = minetest.get_item_group(itemstring, "mcl_armor_points") - if pts > 0 then - s = s .. S("Armor points: @1", pts) - s = s .. "\n" - end - if use > 0 then - s = s .. S("Armor durability: @1", use) - end - if s == "" then - s = nil - end - return s -end) --- Horse armor -tt.register_snippet(function(itemstring) - local armor_g = minetest.get_item_group(itemstring, "horse_armor") - if armor_g and armor_g > 0 then - return S("Protection: @1%", 100 - armor_g) - end -end) - -tt.register_snippet(function(itemstring) - local def = minetest.registered_items[itemstring] - local s = "" - if def.groups.eatable and def.groups.eatable > 0 then - s = s .. S("Hunger points: +@1", def.groups.eatable) - end - if def._mcl_saturation and def._mcl_saturation > 0 then - if s ~= "" then - s = s .. "\n" - end - s = s .. S("Saturation points: +@1", string.format("%.1f", def._mcl_saturation)) - end - if s == "" then - s = nil - end - return s -end) - -tt.register_snippet(function(itemstring) - local def = minetest.registered_items[itemstring] - if minetest.get_item_group(itemstring, "crush_after_fall") == 1 then - return S("Deals damage when falling"), "#FFFF00" - end -end) - -tt.register_snippet(function(itemstring) - local def = minetest.registered_items[itemstring] - if def.groups.place_flowerlike == 1 then - return S("Grows on grass blocks or dirt") - elseif def.groups.place_flowerlike == 2 then - return S("Grows on grass blocks, podzol, dirt or coarse dirt") - end -end) - -tt.register_snippet(function(itemstring) - local def = minetest.registered_items[itemstring] - if def.groups.flammable then - return S("Flammable") - end -end) - -tt.register_snippet(function(itemstring) - if itemstring == "mcl_heads:zombie" then - return S("Zombie view range: -50%") - elseif itemstring == "mcl_heads:skeleton" then - return S("Skeleton view range: -50%") - elseif itemstring == "mcl_heads:creeper" then - return S("Creeper view range: -50%") - end -end) - +dofile(minetest.get_modpath("mcl_tt").."/snippets_base.lua") +dofile(minetest.get_modpath("mcl_tt").."/snippets_mcl.lua") diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.de.tr b/mods/HELP/mcl_tt/locale/mcl_tt.de.tr index f793e59a0..8f878afc7 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.de.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.de.tr @@ -15,3 +15,33 @@ Flammable=Entzündlich Zombie view range: -50%=Zombiesichtweite: -50% Skeleton view range: -50%=Skelettsichtweite: -50% Creeper view range: -50%=Creepersichtweite: -50% +Damage: @1=Schaden: @1 +Damage (@1): @2=Schaden (@1): @2 +Healing: @1=Heilung: @1 +Healing (@1): @2=Heilung (@1): @2 +Full punch interval: @1s=Zeit zum Ausholen: @1s +Contact damage: @1 per second=Kontaktschaden: @1 pro Sekunde +Contact healing: @1 per second=Kontaktheilung: @1 pro Sekunde +Drowning damage: @1=Ertrinkensschaden: @1 +Bouncy (@1%)=Sprunghaft (@1%) +Luminance: @1=Lichtstärke: @1 +Slippery=Rutschig +Climbable=Erkletterbar +Climbable (only downwards)=Erkletterbar (nur nach unten) +No jumping=Kein Springen +No swimming upwards=Kein nach oben schwimmen +No rising=Kein Aufsteigen +Fall damage: @1%=Fallschaden: @1% +Fall damage: +@1%=Fallschaden: +@1% +No fall damage=Kein Fallschaden +Mining speed: @1=Grabegeschwindigkeit: @1 +Very fast=Sehr schnell +Extremely fast=Extrem schnell +Fast=Schnell +Slow=Langsam +Very slow=Sehr langsam +Painfully slow=Furchtbar langsam +Mining durability: @1=Grabehaltbarkeit: @1 +Block breaking strength: @1=Blockbruchstärke: @1 +@1 uses=@1 Verwendungen +Unlimited uses=Unbegrenzte Verwendungen diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.fr.tr b/mods/HELP/mcl_tt/locale/mcl_tt.fr.tr index e3a9ec0b7..a66311448 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.fr.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.fr.tr @@ -15,3 +15,33 @@ Flammable=Inflammable Zombie view range: -50%=Distance de vue de Zombie: -50% Skeleton view range: -50%=Distance de vue de Squelette: -50% Creeper view range: -50%=Distance de vue de Creeper: -50% +Damage: @1=Dégâts: @1 +Damage (@1): @2=Dégâts (@1): @2 +Healing: @1=Guérison: @1 +Healing (@1): @2=Guérison (@1): @2 +Full punch interval: @1s=Intervalle de coup: @1s +Contact damage: @1 per second=Dégâts de contact: @1 par seconde +Contact healing: @1 per second=Guérison de contact: @1 par seconde +Drowning damage: @1=Dégâts de noyade: @1 +Bouncy (@1%)=Rebondissant (@1%) +Luminance: @1=Luminance: @1 +Slippery=Glissant +Climbable=Grimpable +Climbable (only downwards)=Grimpable (uniquement vers le bas) +No jumping=Ne pas sauter +No swimming upwards=Ne pas nager vers le haut +No rising=Pas de montée +Fall damage: @1%=Dégâts de chute: @1% +Fall damage: +@1%=Dégâts de chute: +@1% +No fall damage=Pas de dégâts de chute +Mining speed: @1=Vitesse de minage: @1 +Very fast=Très rapide +Extremely fast=Extremement rapide +Fast=Rapide +Slow=Lent +Very slow=Très lent +Painfully slow=Péniblement lent +Mining durability: @1=Durabilité de minage: @1 +Block breaking strength: @1=Résistance à la rupture: @1 +@1 uses=@1 utilisations +Unlimited uses=Utilisations illimitées diff --git a/mods/HELP/mcl_tt/locale/mcl_tt.ru.tr b/mods/HELP/mcl_tt/locale/mcl_tt.ru.tr index 657abc90e..349b6a5fb 100644 --- a/mods/HELP/mcl_tt/locale/mcl_tt.ru.tr +++ b/mods/HELP/mcl_tt/locale/mcl_tt.ru.tr @@ -15,3 +15,33 @@ Flammable=Легковоспламенимо Zombie view range: -50%=Дальность зрения зомби: -50% Skeleton view range: -50%=Дальность зрения скелета: -50% Creeper view range: -50%=Дальность зрения крипера: -50% +Damage: @1=Урон: @1 +Damage (@1): @2=Урон (@1): @2 +Healing: @1=Исцеление: @1 +Healing (@1): @2=Исцеление (@1): @2 +Full punch interval: @1s=Интервал полного удара: @1 с +Contact damage: @1 per second=Урон при контакте: @1 в секунду +Contact healing: @1 per second=Исцеление при контакте: @1 в секунду +Drowning damage: @1=Урон при падении: @1 +Bouncy (@1%)=Упругость (@1%) +Luminance: @1=Свечение: @1 +Slippery=Скользкость +Climbable=Можно карабкаться +Climbable (only downwards)=Можно спускаться +No jumping=Нельзя прыгать +No swimming upwards=Нельзя плыть вверх +No rising=Нельзя подниматься +Fall damage: @1%=Урон при падении: @1% +Fall damage: +@1%=Урон при падении: +@1% +No fall damage=Нет урона при падении +Mining speed: @1=Скорость добычи: @1 +Very fast=очень высокая +Extremely fast=ужасно высокая +Fast=высокая +Slow=низкая +Very slow=очень низкая +Painfully slow=мучительно низкая +Mining durability: @1=Долговечность добычи: @1 +Block breaking strength: @1=Сила разбиения блоков: @1 +@1 uses=@1 раз(а) +Unlimited uses=не ограничено diff --git a/mods/HELP/mcl_tt/locale/template.txt b/mods/HELP/mcl_tt/locale/template.txt index 357830bc0..1259216c7 100644 --- a/mods/HELP/mcl_tt/locale/template.txt +++ b/mods/HELP/mcl_tt/locale/template.txt @@ -15,3 +15,33 @@ Flammable= Zombie view range: -50%= Skeleton view range: -50%= Creeper view range: -50%= +Damage: @1= +Damage (@1): @2= +Healing: @1= +Healing (@1): @2= +Full punch interval: @1s= +Contact damage: @1 per second= +Contact healing: @1 per second= +Drowning damage: @1= +Bouncy (@1%)= +Luminance: @1= +Slippery= +Climbable= +Climbable (only downwards)= +No jumping= +No swimming upwards= +No rising= +Fall damage: @1%= +Fall damage: +@1%= +No fall damage= +Mining speed: @1= +Very fast= +Extremely fast= +Fast= +Slow= +Very slow= +Painfully slow= +Mining durability: @1= +Block breaking strength: @1= +@1 uses= +Unlimited uses= diff --git a/mods/HELP/tt/snippets_builtin.lua b/mods/HELP/mcl_tt/snippets_base.lua similarity index 99% rename from mods/HELP/tt/snippets_builtin.lua rename to mods/HELP/mcl_tt/snippets_base.lua index b61cc7ccc..376f00f2c 100644 --- a/mods/HELP/tt/snippets_builtin.lua +++ b/mods/HELP/mcl_tt/snippets_base.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("tt") +local S = minetest.get_translator("mcl_tt") local function get_min_digtime(caps) local mintime diff --git a/mods/HELP/mcl_tt/snippets_mcl.lua b/mods/HELP/mcl_tt/snippets_mcl.lua new file mode 100644 index 000000000..569dbe686 --- /dev/null +++ b/mods/HELP/mcl_tt/snippets_mcl.lua @@ -0,0 +1,103 @@ +local S = minetest.get_translator("mcl_tt") + +-- Armor +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + local s = "" + local head = minetest.get_item_group(itemstring, "armor_head") + local torso = minetest.get_item_group(itemstring, "armor_torso") + local legs = minetest.get_item_group(itemstring, "armor_legs") + local feet = minetest.get_item_group(itemstring, "armor_feet") + if head > 0 then + s = s .. S("Head armor") + end + if torso > 0 then + s = s .. S("Torso armor") + end + if legs > 0 then + s = s .. S("Legs armor") + end + if feet > 0 then + s = s .. S("Feet armor") + end + if s == "" then + s = nil + end + return s +end) +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + local s = "" + local use = minetest.get_item_group(itemstring, "mcl_armor_uses") + local pts = minetest.get_item_group(itemstring, "mcl_armor_points") + if pts > 0 then + s = s .. S("Armor points: @1", pts) + s = s .. "\n" + end + if use > 0 then + s = s .. S("Armor durability: @1", use) + end + if s == "" then + s = nil + end + return s +end) +-- Horse armor +tt.register_snippet(function(itemstring) + local armor_g = minetest.get_item_group(itemstring, "horse_armor") + if armor_g and armor_g > 0 then + return S("Protection: @1%", 100 - armor_g) + end +end) + +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + local s = "" + if def.groups.eatable and def.groups.eatable > 0 then + s = s .. S("Hunger points: +@1", def.groups.eatable) + end + if def._mcl_saturation and def._mcl_saturation > 0 then + if s ~= "" then + s = s .. "\n" + end + s = s .. S("Saturation points: +@1", string.format("%.1f", def._mcl_saturation)) + end + if s == "" then + s = nil + end + return s +end) + +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + if minetest.get_item_group(itemstring, "crush_after_fall") == 1 then + return S("Deals damage when falling"), "#FFFF00" + end +end) + +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + if def.groups.place_flowerlike == 1 then + return S("Grows on grass blocks or dirt") + elseif def.groups.place_flowerlike == 2 then + return S("Grows on grass blocks, podzol, dirt or coarse dirt") + end +end) + +tt.register_snippet(function(itemstring) + local def = minetest.registered_items[itemstring] + if def.groups.flammable then + return S("Flammable") + end +end) + +tt.register_snippet(function(itemstring) + if itemstring == "mcl_heads:zombie" then + return S("Zombie view range: -50%") + elseif itemstring == "mcl_heads:skeleton" then + return S("Skeleton view range: -50%") + elseif itemstring == "mcl_heads:creeper" then + return S("Creeper view range: -50%") + end +end) + diff --git a/mods/HELP/tt/API.md b/mods/HELP/tt/API.md index 0f24e472c..a510553ce 100644 --- a/mods/HELP/tt/API.md +++ b/mods/HELP/tt/API.md @@ -7,8 +7,6 @@ Add these to the item definition. * `_tt_ignore`: If `true`, the `description` of this item won't be altered at all * `_tt_help`: Custom help text -* `_tt_food`: If `true`, item is a food item that can be consumed by the player -* `_tt_food_hp`: Health increase (in HP) for player when consuming food item Once this mod had overwritten the `description` field of an item was overwritten, it will save the original (unaltered) `description` in the `_tt_original_description` field. diff --git a/mods/HELP/tt/README.md b/mods/HELP/tt/README.md index ca76902e4..f15599718 100644 --- a/mods/HELP/tt/README.md +++ b/mods/HELP/tt/README.md @@ -1,12 +1,8 @@ # Extended Tooltip (`tt`) This mod extends the tooltip of items to add more informative texts. -It displays the following useful information: -* Weapon damage and speed -* Tool properties -* Noteworthy block properties -* Food satiation -* Custom help text (added by mods) +The mod itself does nothing and is meant to be integrated into +games to use the API to define custom tooltips (see `API.md`). ## License MIT License. diff --git a/mods/HELP/tt/init.lua b/mods/HELP/tt/init.lua index 1e639baee..a79bf27b5 100644 --- a/mods/HELP/tt/init.lua +++ b/mods/HELP/tt/init.lua @@ -1,5 +1,3 @@ -local S = minetest.get_translator("tt") - tt = {} tt.COLOR_DEFAULT = "#d0ffd0" tt.COLOR_DANGER = "#ffff00" @@ -12,10 +10,7 @@ tt.register_snippet = function(func) table.insert(tt.registered_snippets, func) end --- Register core snippets - -dofile(minetest.get_modpath(minetest.get_current_modname()).."/snippets_core.lua") -dofile(minetest.get_modpath(minetest.get_current_modname()).."/snippets_builtin.lua") +dofile(minetest.get_modpath(minetest.get_current_modname()).."/snippets.lua") -- Apply item description updates diff --git a/mods/HELP/tt/locale/template.txt b/mods/HELP/tt/locale/template.txt deleted file mode 100644 index b5f11762f..000000000 --- a/mods/HELP/tt/locale/template.txt +++ /dev/null @@ -1,31 +0,0 @@ -# textdomain:tt -Damage: @1= -Damage (@1): @2= -Healing: @1= -Healing (@1): @2= -Full punch interval: @1s= -Contact damage: @1 per second= -Contact healing: @1 per second= -Drowning damage: @1= -Bouncy (@1%)= -Luminance: @1= -Slippery= -Climbable= -Climbable (only downwards)= -No jumping= -No swimming upwards= -No rising= -Fall damage: @1%= -Fall damage: +@1%= -No fall damage= -Mining speed: @1= -Very fast= -Extremely fast= -Fast= -Slow= -Very slow= -Painfully slow= -Mining durability: @1= -Block breaking strength: @1= -@1 uses= -Unlimited uses= diff --git a/mods/HELP/tt/locale/tt.de.tr b/mods/HELP/tt/locale/tt.de.tr deleted file mode 100644 index 508787de4..000000000 --- a/mods/HELP/tt/locale/tt.de.tr +++ /dev/null @@ -1,31 +0,0 @@ -# textdomain:tt -Damage: @1=Schaden: @1 -Damage (@1): @2=Schaden (@1): @2 -Healing: @1=Heilung: @1 -Healing (@1): @2=Heilung (@1): @2 -Full punch interval: @1s=Zeit zum Ausholen: @1s -Contact damage: @1 per second=Kontaktschaden: @1 pro Sekunde -Contact healing: @1 per second=Kontaktheilung: @1 pro Sekunde -Drowning damage: @1=Ertrinkensschaden: @1 -Bouncy (@1%)=Sprunghaft (@1%) -Luminance: @1=Lichtstärke: @1 -Slippery=Rutschig -Climbable=Erkletterbar -Climbable (only downwards)=Erkletterbar (nur nach unten) -No jumping=Kein Springen -No swimming upwards=Kein nach oben schwimmen -No rising=Kein Aufsteigen -Fall damage: @1%=Fallschaden: @1% -Fall damage: +@1%=Fallschaden: +@1% -No fall damage=Kein Fallschaden -Mining speed: @1=Grabegeschwindigkeit: @1 -Very fast=Sehr schnell -Extremely fast=Extrem schnell -Fast=Schnell -Slow=Langsam -Very slow=Sehr langsam -Painfully slow=Furchtbar langsam -Mining durability: @1=Grabehaltbarkeit: @1 -Block breaking strength: @1=Blockbruchstärke: @1 -@1 uses=@1 Verwendungen -Unlimited uses=Unbegrenzte Verwendungen diff --git a/mods/HELP/tt/locale/tt.fr.tr b/mods/HELP/tt/locale/tt.fr.tr deleted file mode 100644 index 70bc43ff4..000000000 --- a/mods/HELP/tt/locale/tt.fr.tr +++ /dev/null @@ -1,31 +0,0 @@ -# textdomain:tt -Damage: @1=Dégâts: @1 -Damage (@1): @2=Dégâts (@1): @2 -Healing: @1=Guérison: @1 -Healing (@1): @2=Guérison (@1): @2 -Full punch interval: @1s=Intervalle de coup: @1s -Contact damage: @1 per second=Dégâts de contact: @1 par seconde -Contact healing: @1 per second=Guérison de contact: @1 par seconde -Drowning damage: @1=Dégâts de noyade: @1 -Bouncy (@1%)=Rebondissant (@1%) -Luminance: @1=Luminance: @1 -Slippery=Glissant -Climbable=Grimpable -Climbable (only downwards)=Grimpable (uniquement vers le bas) -No jumping=Ne pas sauter -No swimming upwards=Ne pas nager vers le haut -No rising=Pas de montée -Fall damage: @1%=Dégâts de chute: @1% -Fall damage: +@1%=Dégâts de chute: +@1% -No fall damage=Pas de dégâts de chute -Mining speed: @1=Vitesse de minage: @1 -Very fast=Très rapide -Extremely fast=Extremement rapide -Fast=Rapide -Slow=Lent -Very slow=Très lent -Painfully slow=Péniblement lent -Mining durability: @1=Durabilité de minage: @1 -Block breaking strength: @1=Résistance à la rupture: @1 -@1 uses=@1 utilisations -Unlimited uses=Utilisations illimitées diff --git a/mods/HELP/tt/locale/tt.ru.tr b/mods/HELP/tt/locale/tt.ru.tr deleted file mode 100644 index 6994bee60..000000000 --- a/mods/HELP/tt/locale/tt.ru.tr +++ /dev/null @@ -1,31 +0,0 @@ -# textdomain:tt -Damage: @1=Урон: @1 -Damage (@1): @2=Урон (@1): @2 -Healing: @1=Исцеление: @1 -Healing (@1): @2=Исцеление (@1): @2 -Full punch interval: @1s=Интервал полного удара: @1 с -Contact damage: @1 per second=Урон при контакте: @1 в секунду -Contact healing: @1 per second=Исцеление при контакте: @1 в секунду -Drowning damage: @1=Урон при падении: @1 -Bouncy (@1%)=Упругость (@1%) -Luminance: @1=Свечение: @1 -Slippery=Скользкость -Climbable=Можно карабкаться -Climbable (only downwards)=Можно спускаться -No jumping=Нельзя прыгать -No swimming upwards=Нельзя плыть вверх -No rising=Нельзя подниматься -Fall damage: @1%=Урон при падении: @1% -Fall damage: +@1%=Урон при падении: +@1% -No fall damage=Нет урона при падении -Mining speed: @1=Скорость добычи: @1 -Very fast=очень высокая -Extremely fast=ужасно высокая -Fast=высокая -Slow=низкая -Very slow=очень низкая -Painfully slow=мучительно низкая -Mining durability: @1=Долговечность добычи: @1 -Block breaking strength: @1=Сила разбиения блоков: @1 -@1 uses=@1 раз(а) -Unlimited uses=не ограничено diff --git a/mods/HELP/tt/mod.conf b/mods/HELP/tt/mod.conf index aee1572f6..d5c8c2eb1 100644 --- a/mods/HELP/tt/mod.conf +++ b/mods/HELP/tt/mod.conf @@ -1,2 +1,2 @@ name = tt -description = Appends a helpful tooltip to the item description +description = Support for custom tooltip extensions for items diff --git a/mods/HELP/tt/snippets_core.lua b/mods/HELP/tt/snippets.lua similarity index 88% rename from mods/HELP/tt/snippets_core.lua rename to mods/HELP/tt/snippets.lua index cc67a10c9..694b22513 100644 --- a/mods/HELP/tt/snippets_core.lua +++ b/mods/HELP/tt/snippets.lua @@ -1,4 +1,4 @@ --- CORE SNIPPETS -- +-- CUSTOM SNIPPETS -- -- Custom text (_tt_help) tt.register_snippet(function(itemstring) From fa97aca76a43f0ef612c686e64bd436b72c38046 Mon Sep 17 00:00:00 2001 From: kay27 Date: Thu, 10 Sep 2020 21:25:02 +0400 Subject: [PATCH 136/152] Simplify respawn search algorithm, https://git.minetest.land/Wuzzy/MineClone2/issues/833 --- mods/PLAYER/mcl_spawn/init.lua | 47 ++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/mods/PLAYER/mcl_spawn/init.lua b/mods/PLAYER/mcl_spawn/init.lua index bf048e4b8..ae23e122f 100644 --- a/mods/PLAYER/mcl_spawn/init.lua +++ b/mods/PLAYER/mcl_spawn/init.lua @@ -3,6 +3,22 @@ mcl_spawn = {} local S = minetest.get_translator("mcl_spawn") local mg_name = minetest.get_mapgen_setting("mg_name") +local node_search_list = + { + --[[1]] {x = 0, y = 0, z = -1}, -- + --[[2]] {x = -1, y = 0, z = 0}, -- + --[[3]] {x = -1, y = 0, z = 1}, -- + --[[4]] {x = 0, y = 0, z = 2}, -- z^ 8 4 9 + --[[5]] {x = 1, y = 0, z = 1}, -- | 3 5 + --[[6]] {x = 1, y = 0, z = 0}, -- | 2 * 6 + --[[7]] {x = -1, y = 0, z = -1}, -- | 7 1 A + --[[8]] {x = -1, y = 0, z = 2}, -- +-----> + --[[9]] {x = 1, y = 0, z = 2}, -- x + --[[A]] {x = 1, y = 0, z = -1}, -- + --[[B]] {x = 0, y = 1, z = 0}, -- + --[[C]] {x = 0, y = 1, z = 1}, -- + } + local cached_world_spawn mcl_spawn.get_world_spawn_pos = function() @@ -121,23 +137,28 @@ minetest.register_on_respawnplayer(function(player) minetest.chat_send_player(player:get_player_name(), S("Your spawn bed was missing or blocked.")) return false end + -- Find spawning position on/near the bed free of solid or damaging blocks iterating a square spiral 15x15: - local x, z, dx, dz = 0, 0, 0, -1 - for i = 1, 225 do - if x > -8 and x < 8 and z > -8 and z < 8 then - for _,y in ipairs({0, 1, -1, 2, -2, 3, -3, 4, -4}) do - local spawn_pos = {x = pos.x - z, y=pos.y + y, z = pos.z - x} - if good_for_respawn(spawn_pos) then - player:set_pos(spawn_pos) - return true - end - end + + local dir = minetest.facedir_to_dir(minetest.get_node(pos).param2) + local offset + for _, o in ipairs(node_search_list) do + if dir.z == -1 then + offset = {x = o.x, y = o.y, z = o.z} + elseif dir.z == 1 then + offset = {x = -o.x, y = o.y, z = -o.z} + elseif dir.x == -1 then + offset = {x = o.z, y = o.y, z = -o.x} + else -- dir.x == 1 + offset = {x = -o.z, y = o.y, z = o.x} end - if x == z or (x < 0 and x == -z) or (x > 0 and x == 1 - z) then - dx, dz = -dz, dx + local spawn_pos = vector.add(pos, offset) + if good_for_respawn(spawn_pos) then + player:set_pos(spawn_pos) + return true end - x, z = x + dx, z + dz end + -- We here if we didn't find suitable place for respawn: return false end From 7678bf9b9f1b0f60da229755c73c16c5aa55ed9b Mon Sep 17 00:00:00 2001 From: kay27 Date: Sat, 19 Sep 2020 11:42:09 +0400 Subject: [PATCH 137/152] Fix item duplication by brewing stand, by disabling its falling and pushing/pulling, see https://git.minetest.land/Wuzzy/MineClone2/issues/831 --- mods/ITEMS/mcl_brewing/init.lua | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/mods/ITEMS/mcl_brewing/init.lua b/mods/ITEMS/mcl_brewing/init.lua index 178914921..b27c9cf37 100644 --- a/mods/ITEMS/mcl_brewing/init.lua +++ b/mods/ITEMS/mcl_brewing/init.lua @@ -376,7 +376,7 @@ minetest.register_node("mcl_brewing:stand_000", { _doc_items_longdesc = S("The stand allows you to brew potions!"), _doc_items_usagehelp = doc_string, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, brewitem=1 }, + groups = {pickaxey=1, brewitem=1 }, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -442,7 +442,7 @@ minetest.register_node("mcl_brewing:stand_100", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -514,7 +514,7 @@ minetest.register_node("mcl_brewing:stand_010", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -587,7 +587,7 @@ minetest.register_node("mcl_brewing:stand_001", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -656,7 +656,7 @@ minetest.register_node("mcl_brewing:stand_110", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -735,7 +735,7 @@ minetest.register_node("mcl_brewing:stand_101", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -810,7 +810,7 @@ minetest.register_node("mcl_brewing:stand_011", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -885,7 +885,7 @@ minetest.register_node("mcl_brewing:stand_111", { description = S("Brewing Stand"), _doc_items_create_entry = false, _tt_help = S("Brew Potions"), - groups = {pickaxey=1, falling_node=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, + groups = {pickaxey=1, not_in_creative_inventory = 1, not_in_craft_guide = 1}, tiles = tiles, drop = "mcl_brewing:stand", paramtype = "light", @@ -983,3 +983,9 @@ if minetest.get_modpath("doc") then doc.add_entry_alias("nodes", "mcl_brewing:stand_000", "nodes", "mcl_brewing:stand_110") doc.add_entry_alias("nodes", "mcl_brewing:stand_000", "nodes", "mcl_brewing:stand_111") end + +if minetest.get_modpath("mesecons_mvps") then + for _, s in ipairs({"000", "001", "010", "011", "100", "101", "110", "111"}) do + mesecon.register_mvps_stopper("mcl_brewing:stand_" .. s) + end +end From 15cb94b9b33d1713ee60b970c6e70a5ddda3fd2b Mon Sep 17 00:00:00 2001 From: kay27 Date: Sun, 20 Sep 2020 03:38:31 +0400 Subject: [PATCH 138/152] Close minor issues with fishing rod timing and permanent_flame alias, https://git.minetest.land/Wuzzy/MineClone2/issues/834 & https://git.minetest.land/Wuzzy/MineClone2/issues/836 --- mods/ITEMS/mcl_fire/init.lua | 2 +- mods/ITEMS/mcl_fishing/init.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index 7d27eff92..e6fcd4f21 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -493,7 +493,7 @@ minetest.register_lbm({ minetest.register_alias("mcl_fire:basic_flame", "mcl_fire:fire") minetest.register_alias("fire:basic_flame", "mcl_fire:fire") -minetest.register_alias("fire:permanent_flame", "mcl_fire:eternal_flame") +minetest.register_alias("fire:permanent_flame", "mcl_fire:eternal_fire") dofile(minetest.get_modpath(minetest.get_current_modname()).."/flint_and_steel.lua") dofile(minetest.get_modpath(minetest.get_current_modname()).."/fire_charge.lua") diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 1cab8b3ac..d019289d0 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -238,7 +238,7 @@ local bobber_on_step = function(self, dtime) end else if self._waittick == nil then -- wait for random number of ticks. - self._waittick = math.random(50,800) + self._waittick = math.random(50,333) else if self._tick ~= self._waittick then self._tick = self._tick + 1 From 8df2aebd319d53abcb80f5239700ab98363f4eeb Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 21 Sep 2020 11:30:29 +0400 Subject: [PATCH 139/152] Add moveresult variable passing to on_step() of mob entity, https://git.minetest.land/Wuzzy/MineClone2/issues/837 --- mods/ENVIRONMENT/mcl_void_damage/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_void_damage/init.lua b/mods/ENVIRONMENT/mcl_void_damage/init.lua index f48244147..bdd60508f 100644 --- a/mods/ENVIRONMENT/mcl_void_damage/init.lua +++ b/mods/ENVIRONMENT/mcl_void_damage/init.lua @@ -13,8 +13,8 @@ minetest.register_on_mods_loaded(function() if not on_step_old then on_step_old = function() end end - local on_step = function(self, dtime) - on_step_old(self, dtime) + local on_step = function(self, dtime, moveresult) + on_step_old(self, dtime, moveresult) local obj = self.object local pos = obj:get_pos() -- Old on_step function might have deleted object, From 446b0e66023b1ff238adb0210a69439f48eb4fb2 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 21 Sep 2020 22:21:46 +0400 Subject: [PATCH 140/152] Merge updated Nether portals, https://git.minetest.land/Wuzzy/MineClone2/issues/804 --- mods/ENTITIES/mcl_mobs/api.lua | 6 + mods/ENTITIES/mcl_mobs/mod.conf | 2 +- .../mcl_portals/locale/mcl_portals.de.tr | 1 + .../mcl_portals/locale/mcl_portals.es.tr | 1 + .../mcl_portals/locale/mcl_portals.fr.tr | 1 + .../mcl_portals/locale/mcl_portals.ru.tr | 1 + mods/ITEMS/mcl_portals/locale/template.txt | 1 + mods/ITEMS/mcl_portals/portal_nether.lua | 1076 +++++++++++------ .../textures/mcl_particles_nether_portal.png | Bin 0 -> 111 bytes .../mcl_particles_nether_portal_t.png | Bin 0 -> 109 bytes .../textures/mcl_portals_portal.png | Bin 1235 -> 1861 bytes ...te_texture__mcl_particles_nether_portal.py | 21 + ..._texture__mcl_particles_nether_portal_t.py | 21 + tools/create_texture__mcl_portals_portal.py | 58 + 14 files changed, 820 insertions(+), 369 deletions(-) create mode 100644 mods/ITEMS/mcl_portals/textures/mcl_particles_nether_portal.png create mode 100644 mods/ITEMS/mcl_portals/textures/mcl_particles_nether_portal_t.png create mode 100644 tools/create_texture__mcl_particles_nether_portal.py create mode 100644 tools/create_texture__mcl_particles_nether_portal_t.py create mode 100644 tools/create_texture__mcl_portals_portal.py diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 7dd4b7068..ab2480f9d 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -2588,6 +2588,12 @@ local falling = function(self, pos) return end + if mcl_portals ~= nil then + if mcl_portals.nether_portal_cooloff[self.object] then + return false -- mob has teleported through Nether portal - it's 99% not falling + end + end + -- floating in water (or falling) local v = self.object:get_velocity() diff --git a/mods/ENTITIES/mcl_mobs/mod.conf b/mods/ENTITIES/mcl_mobs/mod.conf index d1840c697..986fef084 100644 --- a/mods/ENTITIES/mcl_mobs/mod.conf +++ b/mods/ENTITIES/mcl_mobs/mod.conf @@ -1,3 +1,3 @@ name = mcl_mobs depends = mcl_particles -optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor +optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor, mcl_portals diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr index 593403297..957248830 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr @@ -17,3 +17,4 @@ Once placed, an eye of ender can not be taken back.=Sobald platziert, kann ein E Used to construct end portals=Benutzt zur Konstruktion von Endportalen Liquid container=Flüssigkeitsbehälter No effect=Keine Wirkung +Loading terrain...=Gelände laden... diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr index 9636f69c3..80266348b 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr @@ -14,3 +14,4 @@ Stand in the portal for a moment to activate the teleportation. Entering a Nethe Obsidian is also used as the frame of Nether portals.=La obsidiana también se usa como marco de portal del End. To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Para abrir un portal Nether, coloque un marco vertical de obsidiana con un ancho de 4 bloques y una altura de 5 bloques, dejando solo aire en el centro. Después de colocar este marco, enciende un fuego en el marco de obsidiana. Los portales de Nether solo funcionan en Overworld y Nether. Once placed, an eye of ender can not be taken back.=Una vez colocado, un ojo de ender no puede ser retirado. +Loading terrain...=Terreno de carga... diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr index 76a2a6f82..d1f39c86b 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr @@ -13,3 +13,4 @@ Obsidian is also used as the frame of Nether portals.=Obsidian is also used as t To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Pour ouvrir un portail du Nether, placez un cadre vertical d'obsidienne d'une largeur de 4 blocs et d'une hauteur de 5 blocs, ne laissant que de l'air au centre. Après avoir placé ce cadre, allumez un feu dans le cadre en obsidienne. Les portails du Nether ne fonctionnent que dans l'Overworld et le Nether. Once placed, an eye of ender can not be taken back.=Une fois placé, un œil d'ender ne peut pas être repris. Used to construct end portals=Utilisé pour construire des portails d'End +Loading terrain...=Chargement du terrain... diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr index f3f835c39..910b4867f 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr @@ -13,3 +13,4 @@ Obsidian is also used as the frame of Nether portals.=Обсидиан такж To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Чтобы открыть портал Ада, постройте рамку из обсидиана шириной 4 блока и высотой 5, оставляя в центре лишь воздух. После создания обсидиановой рамки зажгите в ней огонь. Адские порталы работают только в Верхнем мире и в Аду. Once placed, an eye of ender can not be taken back.=Однажды размещённое, око Предела нельзя взять обратно. Used to construct end portals=Используется для создания порталов Предела +Loading terrain...=Местность подгружается... diff --git a/mods/ITEMS/mcl_portals/locale/template.txt b/mods/ITEMS/mcl_portals/locale/template.txt index d7c5a30f9..42c390237 100644 --- a/mods/ITEMS/mcl_portals/locale/template.txt +++ b/mods/ITEMS/mcl_portals/locale/template.txt @@ -13,3 +13,4 @@ Obsidian is also used as the frame of Nether portals.= To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.= Once placed, an eye of ender can not be taken back.= Used to construct end portals= +Loading terrain...= diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index f58058e6c..08cb654b8 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -2,80 +2,98 @@ local S = minetest.get_translator("mcl_portals") -- Parameters -local TCAVE = 0.6 -local nobj_cave = nil - -- Portal frame sizes local FRAME_SIZE_X_MIN = 4 local FRAME_SIZE_Y_MIN = 5 -local FRAME_SIZE_X_MAX = 4 -- TODO: 23 -local FRAME_SIZE_Y_MAX = 5 -- TODO: 23 +local FRAME_SIZE_X_MAX = 23 +local FRAME_SIZE_Y_MAX = 23 -local TELEPORT_DELAY = 3 -- seconds before teleporting in Nether portal -local TELEPORT_COOLOFF = 4 -- after object was teleported, for this many seconds it won't teleported again +local PORTAL_NODES_MIN = 5 +local PORTAL_NODES_MAX = (FRAME_SIZE_X_MAX - 2) * (FRAME_SIZE_Y_MAX - 2) -local mg_name = minetest.get_mapgen_setting("mg_name") -local superflat = mg_name == "flat" and minetest.get_mapgen_setting("mcl_superflat_classic") == "true" +local TELEPORT_COOLOFF = 3 -- after player was teleported, for this many seconds they won't teleported again +local MOB_TELEPORT_COOLOFF = 14 -- after mob was teleported, for this many seconds they won't teleported again +local TOUCH_CHATTER_TIME = 1 -- prevent multiple teleportation attempts caused by multiple portal touches, for this number of seconds +local TOUCH_CHATTER_TIME_US = TOUCH_CHATTER_TIME * 1000000 +local TELEPORT_DELAY = 3 -- seconds before teleporting in Nether portal (4 minus ABM interval time) +local DESTINATION_EXPIRES = 60 * 1000000 -- cached destination expires after this number of microseconds have passed without using the same origin portal --- 3D noise -local np_cave = { - offset = 0, - scale = 1, - spread = {x = 384, y = 128, z = 384}, - seed = 59033, - octaves = 5, - persist = 0.7 -} +local PORTAL_SEARCH_HALF_CHUNK = 40 -- greater values may slow down the teleportation +local PORTAL_SEARCH_ALTITUDE = 128 -- Table of objects (including players) which recently teleported by a -- Nether portal. Those objects have a brief cooloff period before they -- can teleport again. This prevents annoying back-and-forth teleportation. -local portal_cooloff = {} +mcl_portals.nether_portal_cooloff = {} +local touch_chatter_prevention = {} + +local overworld_ymin = math.max(mcl_vars.mg_overworld_min, -31) +local overworld_ymax = math.min(mcl_vars.mg_overworld_max_official, 63) +local nether_ymin = mcl_vars.mg_bedrock_nether_bottom_min +local nether_ymax = mcl_vars.mg_bedrock_nether_top_max +local overworld_dy = overworld_ymax - overworld_ymin + 1 +local nether_dy = nether_ymax - nether_ymin + 1 + +local node_particles_allowed = minetest.settings:get("mcl_node_particles") or "none" +local node_particles_levels = { + high = 3, + medium = 2, + low = 1, + none = 0, +} +local node_particles_allowed_level = node_particles_levels[node_particles_allowed] + + +-- Functions + +-- https://git.minetest.land/Wuzzy/MineClone2/issues/795#issuecomment-11058 +-- A bit simplified Nether fast travel ping-pong formula and function by ryvnf: +local function nether_to_overworld(x) + return 30912 - math.abs(((x * 8 + 30912) % 123648) - 61824) +end -- Destroy portal if pos (portal frame or portal node) got destroyed -local destroy_portal = function(pos) - -- Deactivate Nether portal +local function destroy_nether_portal(pos) local meta = minetest.get_meta(pos) - local p1 = minetest.string_to_pos(meta:get_string("portal_frame1")) - local p2 = minetest.string_to_pos(meta:get_string("portal_frame2")) - if not p1 or not p2 then + local node = minetest.get_node(pos) + local nn, orientation = node.name, node.param2 + local obsidian = nn == "mcl_core:obsidian" + + local has_meta = minetest.string_to_pos(meta:get_string("portal_frame1")) + if has_meta then + meta:set_string("portal_frame1", "") + meta:set_string("portal_frame2", "") + meta:set_string("portal_target", "") + meta:set_string("portal_time", "") + end + local check_remove = function(pos, orientation) + local node = minetest.get_node(pos) + if node and (node.name == "mcl_portals:portal" and (orientation == nil or (node.param2 == orientation))) then + minetest.log("action", "[mcl_portal] Destroying Nether portal at " .. minetest.pos_to_string(pos)) + return minetest.remove_node(pos) + end + end + if obsidian then -- check each of 6 sides of it and destroy every portal: + check_remove({x = pos.x - 1, y = pos.y, z = pos.z}, 0) + check_remove({x = pos.x + 1, y = pos.y, z = pos.z}, 0) + check_remove({x = pos.x, y = pos.y, z = pos.z - 1}, 1) + check_remove({x = pos.x, y = pos.y, z = pos.z + 1}, 1) + check_remove({x = pos.x, y = pos.y - 1, z = pos.z}) + check_remove({x = pos.x, y = pos.y + 1, z = pos.z}) return end - - local counter = 1 - - local mp1 - for x = p1.x, p2.x do - for y = p1.y, p2.y do - for z = p1.z, p2.z do - local p = vector.new(x, y, z) - local m = minetest.get_meta(p) - if counter == 2 then - --[[ Only proceed if the second node still has metadata. - (first node is a corner and not needed for the portal) - If it doesn't have metadata, another node propably triggred the delection - routine earlier, so we bail out earlier to avoid an infinite cascade - of on_destroy events. ]] - mp1 = minetest.string_to_pos(m:get_string("portal_frame1")) - if not mp1 then - return - end - end - local nn = minetest.get_node(p).name - if nn == "mcl_core:obsidian" or nn == "mcl_portals:portal" then - -- Remove portal nodes, but not myself - if nn == "mcl_portals:portal" and not vector.equals(p, pos) then - minetest.remove_node(p) - end - -- Clear metadata of portal nodes and the frame - m:set_string("portal_frame1", "") - m:set_string("portal_frame2", "") - m:set_string("portal_target", "") - end - counter = counter + 1 - end + if not has_meta then -- no meta means repeated call: function calls on every node destruction + return end + if orientation == 0 then + check_remove({x = pos.x - 1, y = pos.y, z = pos.z}, 0) + check_remove({x = pos.x + 1, y = pos.y, z = pos.z}, 0) + else + check_remove({x = pos.x, y = pos.y, z = pos.z - 1}, 1) + check_remove({x = pos.x, y = pos.y, z = pos.z + 1}, 1) end + check_remove({x = pos.x, y = pos.y - 1, z = pos.z}) + check_remove({x = pos.x, y = pos.y + 1, z = pos.z}) end minetest.register_node("mcl_portals:portal", { @@ -128,358 +146,676 @@ minetest.register_node("mcl_portals:portal", { }, }, groups = {portal=1, not_in_creative_inventory = 1}, - on_destruct = destroy_portal, + on_destruct = destroy_nether_portal, _mcl_hardness = -1, _mcl_blast_resistance = 0, }) --- Functions ---Build arrival portal -local function build_portal(pos, target) - local p = {x = pos.x - 1, y = pos.y - 1, z = pos.z} - local p1 = {x = pos.x - 1, y = pos.y - 1, z = pos.z} - local p2 = {x = p1.x + 3, y = p1.y + 4, z = p1.z} - - for i = 1, FRAME_SIZE_Y_MIN - 1 do - minetest.set_node(p, {name = "mcl_core:obsidian"}) - p.y = p.y + 1 +local function find_target_y(x, y, z, y_min, y_max) + local y_org = y + local node = minetest.get_node_or_nil({x = x, y = y, z = z}) + if node == nil then + return y end - for i = 1, FRAME_SIZE_X_MIN - 1 do - minetest.set_node(p, {name = "mcl_core:obsidian"}) - p.x = p.x + 1 - end - for i = 1, FRAME_SIZE_Y_MIN - 1 do - minetest.set_node(p, {name = "mcl_core:obsidian"}) - p.y = p.y - 1 - end - for i = 1, FRAME_SIZE_X_MIN - 1 do - minetest.set_node(p, {name = "mcl_core:obsidian"}) - p.x = p.x - 1 - end - - for x = p1.x, p2.x do - for y = p1.y, p2.y do - p = {x = x, y = y, z = p1.z} - if not ((x == p1.x or x == p2.x) and (y == p1.y or y == p2.y)) then - if not (x == p1.x or x == p2.x or y == p1.y or y == p2.y) then - minetest.set_node(p, {name = "mcl_portals:portal", param2 = 0}) - end - local meta = minetest.get_meta(p) - meta:set_string("portal_frame1", minetest.pos_to_string(p1)) - meta:set_string("portal_frame2", minetest.pos_to_string(p2)) - meta:set_string("portal_target", minetest.pos_to_string(target)) + while node.name ~= "air" and y < y_max do + y = y + 1 + node = minetest.get_node_or_nil({x = x, y = y, z = z}) + if node == nil then + break end + end + if node then + if node.name ~= "air" then + y = y_org + end + end + while node == nil and y > y_min do + y = y - 1 + node = minetest.get_node_or_nil({x = x, y = y, z = z}) + end + if y == y_max and node ~= nil then -- try reverse direction who knows what they built there... + while node.name ~= "air" and y > y_min do + y = y - 1 + node = minetest.get_node_or_nil({x = x, y = y, z = z}) + if node == nil then + break + end + end + end + if node == nil then + return y_org + end + while node.name == "air" and y > y_min do + y = y - 1 + node = minetest.get_node_or_nil({x = x, y = y, z = z}) + while node == nil and y > y_min do + y = y - 1 + node = minetest.get_node_or_nil({x = x, y = y, z = z}) + end + if node == nil then + return y_org + end + end + if y == y_min then + return y_org + end + return y +end - if y ~= p1.y then - for z = -2, 2 do - if z ~= 0 then - p.z = p.z + z - if minetest.registered_nodes[ - minetest.get_node(p).name].is_ground_content then - minetest.remove_node(p) - end - p.z = p.z - z +local function find_nether_target_y(x, y, z) + local target_y = find_target_y(x, y, z, nether_ymin + 4, nether_ymax - 25) + 1 + minetest.log("verbose", "[mcl_portal] Found Nether target altitude: " .. tostring(target_y) .. " for pos. " .. minetest.pos_to_string({x = x, y = y, z = z})) + return target_y +end + +local function find_overworld_target_y(x, y, z) + local target_y = find_target_y(x, y, z, overworld_ymin + 4, overworld_ymax - 25) + 1 + local node = minetest.get_node({x = x, y = target_y - 1, z = z}) + if not node then + return target_y + end + nn = node.name + if nn ~= "air" and minetest.get_item_group(nn, "water") == 0 then + target_y = target_y + 1 + end + minetest.log("verbose", "[mcl_portal] Found Overworld target altitude: " .. tostring(target_y) .. " for pos. " .. minetest.pos_to_string({x = x, y = y, z = z})) + return target_y +end + + +local function update_target(pos, target, time_str) + local stack = {{x = pos.x, y = pos.y, z = pos.z}} + while #stack > 0 do + local i = #stack + local meta = minetest.get_meta(stack[i]) + if meta:get_string("portal_time") == time_str then + stack[i] = nil -- Already updated, skip it + else + local node = minetest.get_node(stack[i]) + local portal = node.name == "mcl_portals:portal" + if not portal then + stack[i] = nil + else + local x, y, z = stack[i].x, stack[i].y, stack[i].z + meta:set_string("portal_time", time_str) + meta:set_string("portal_target", target) + stack[i].y = y - 1 + stack[i + 1] = {x = x, y = y + 1, z = z} + if node.param2 == 0 then + stack[i + 2] = {x = x - 1, y = y, z = z} + stack[i + 3] = {x = x + 1, y = y, z = z} + else + stack[i + 2] = {x = x, y = y, z = z - 1} + stack[i + 3] = {x = x, y = y, z = z + 1} end end end end - end - minetest.log("action", "[mcl_portal] Destination Nether portal generated at "..minetest.pos_to_string(p2).."!") end -local function find_nether_target_y(target_x, target_z) - if mg_name == "flat" then - return mcl_vars.mg_flat_nether_floor + 1 - end - local start_y = math.random(mcl_vars.mg_lava_nether_max + 1, mcl_vars.mg_bedrock_nether_top_min - 5) -- Search start - if not nobj_cave then - nobj_cave = minetest.get_perlin(np_cave) - end - local air = 4 +local function ecb_setup_target_portal(blockpos, action, calls_remaining, param) + -- param.: srcx, srcy, srcz, dstx, dsty, dstz, srcdim, ax1, ay1, az1, ax2, ay2, az2 - for y = start_y, math.max(mcl_vars.mg_lava_nether_max + 1), -1 do - local nval_cave = nobj_cave:get_3d({x = target_x, y = y, z = target_z}) + local portal_search = function(target, p1, p2) + local portal_nodes = minetest.find_nodes_in_area(p1, p2, "mcl_portals:portal") + local portal_pos = false + if portal_nodes and #portal_nodes > 0 then + -- Found some portal(s), use nearest: + portal_pos = {x = portal_nodes[1].x, y = portal_nodes[1].y, z = portal_nodes[1].z} + local nearest_distance = vector.distance(target, portal_pos) + for n = 2, #portal_nodes do + local distance = vector.distance(target, portal_nodes[n]) + if distance < nearest_distance then + portal_pos = {x = portal_nodes[n].x, y = portal_nodes[n].y, z = portal_nodes[n].z} + nearest_distance = distance + end + end + end -- here we have the best portal_pos + return portal_pos + end - if nval_cave > TCAVE then -- Cavern - air = air + 1 - else -- Not cavern, check if 4 nodes of space above - if air >= 4 then - return y + 2 - else -- Not enough space, reset air to zero - air = 0 + if calls_remaining <= 0 then + minetest.log("action", "[mcl_portal] Area for destination Nether portal emerged!") + local src_pos = {x = param.srcx, y = param.srcy, z = param.srcz} + local dst_pos = {x = param.dstx, y = param.dsty, z = param.dstz} + local meta = minetest.get_meta(src_pos) + local portal_pos = portal_search(dst_pos, {x = param.ax1, y = param.ay1, z = param.az1}, {x = param.ax2, y = param.ay2, z = param.az2}) + + if portal_pos == false then + minetest.log("verbose", "[mcl_portal] No portal in area " .. minetest.pos_to_string({x = param.ax1, y = param.ay1, z = param.az1}) .. "-" .. minetest.pos_to_string({x = param.ax2, y = param.ay2, z = param.az2})) + -- Need to build arrival portal: + local org_dst_y = dst_pos.y + if param.srcdim == "overworld" then + dst_pos.y = find_nether_target_y(dst_pos.x, dst_pos.y, dst_pos.z) + else + dst_pos.y = find_overworld_target_y(dst_pos.x, dst_pos.y, dst_pos.z) + end + if math.abs(org_dst_y - dst_pos.y) >= PORTAL_SEARCH_ALTITUDE / 2 then + portal_pos = portal_search(dst_pos, + {x = dst_pos.x - PORTAL_SEARCH_HALF_CHUNK, y = math.floor(dst_pos.y - PORTAL_SEARCH_ALTITUDE / 2), z = dst_pos.z - PORTAL_SEARCH_HALF_CHUNK}, + {x = dst_pos.x + PORTAL_SEARCH_HALF_CHUNK, y = math.ceil(dst_pos.y + PORTAL_SEARCH_ALTITUDE / 2), z = dst_pos.z + PORTAL_SEARCH_HALF_CHUNK} + ) + end + if portal_pos == false then + minetest.log("verbose", "[mcl_portal] 2nd attempt: No portal in area " .. minetest.pos_to_string({x = dst_pos.x - PORTAL_SEARCH_HALF_CHUNK, y = math.floor(dst_pos.y - PORTAL_SEARCH_ALTITUDE / 2), z = dst_pos.z - PORTAL_SEARCH_HALF_CHUNK}) .. "-" .. minetest.pos_to_string({x = dst_pos.x + PORTAL_SEARCH_HALF_CHUNK, y = math.ceil(dst_pos.y + PORTAL_SEARCH_ALTITUDE / 2), z = dst_pos.z + PORTAL_SEARCH_HALF_CHUNK})) + local width, height = 2, 3 + portal_pos = mcl_portals.build_nether_portal(dst_pos, width, height) end end - end - return start_y -- Fallback -end - -local function move_check(p1, max, dir) - local p = {x = p1.x, y = p1.y, z = p1.z} - local d = math.sign(max - p1[dir]) - local min = p[dir] - - for k = min, max, d do - p[dir] = k - local node = minetest.get_node(p) - -- Check for obsidian (except at corners) - if k ~= min and k ~= max and node.name ~= "mcl_core:obsidian" then - return false - end - -- Abort if any of the portal frame blocks already has metadata. - -- This mod does not yet portals which neighbor each other directly. - -- TODO: Reorganize the way how portal frame coordinates are stored. - if node.name == "mcl_core:obsidian" then - local meta = minetest.get_meta(p) - local pframe1 = meta:get_string("portal_frame1") - if minetest.string_to_pos(pframe1) ~= nil then - return false + local target_meta = minetest.get_meta(portal_pos) + local p3 = minetest.string_to_pos(target_meta:get_string("portal_frame1")) + local p4 = minetest.string_to_pos(target_meta:get_string("portal_frame2")) + if p3 and p4 then + portal_pos = vector.divide(vector.add(p3, p4), 2.0) + portal_pos.y = math.min(p3.y, p4.y) + portal_pos = vector.round(portal_pos) + local node = minetest.get_node(portal_pos) + if node and node.name ~= "mcl_portals:portal" then + portal_pos = {x = p3.x, y = p3.y, z = p3.z} + if minetest.get_node(portal_pos).name == "mcl_core:obsidian" then + -- Old-version portal: + if p4.z == p3.z then + portal_pos = {x = p3.x + 1, y = p3.y + 1, z = p3.z} + else + portal_pos = {x = p3.x, y = p3.y + 1, z = p3.z + 1} + end + end end end - end + local time_str = tostring(minetest.get_us_time()) + local target = minetest.pos_to_string(portal_pos) - return true + update_target(src_pos, target, time_str) + end end -local function check_portal(p1, p2) - if p1.x ~= p2.x then - if not move_check(p1, p2.x, "x") then - return false - end - if not move_check(p2, p1.x, "x") then - return false - end - elseif p1.z ~= p2.z then - if not move_check(p1, p2.z, "z") then - return false - end - if not move_check(p2, p1.z, "z") then - return false - end +local function nether_portal_get_target_position(src_pos) + local _, current_dimension = mcl_worlds.y_to_layer(src_pos.y) + local x, y, z, y_min, y_max = 0, 0, 0, 0, 0 + if current_dimension == "nether" then + x = math.floor(nether_to_overworld(src_pos.x) + 0.5) + z = math.floor(nether_to_overworld(src_pos.z) + 0.5) + y = math.floor((math.min(math.max(src_pos.y, nether_ymin), nether_ymax) - nether_ymin) / nether_dy * overworld_dy + overworld_ymin + 0.5) + y_min = overworld_ymin + y_max = overworld_ymax + else -- overworld: + x = math.floor(src_pos.x / 8 + 0.5) + z = math.floor(src_pos.z / 8 + 0.5) + y = math.floor((math.min(math.max(src_pos.y, overworld_ymin), overworld_ymax) - overworld_ymin) / overworld_dy * nether_dy + nether_ymin + 0.5) + y_min = nether_ymin + y_max = nether_ymax + end + return x, y, z, current_dimension, y_min, y_max +end + +local function find_or_create_portal(src_pos) + local x, y, z, cdim, y_min, y_max = nether_portal_get_target_position(src_pos) + local pos1 = {x = x - PORTAL_SEARCH_HALF_CHUNK, y = math.max(y_min, math.floor(y - PORTAL_SEARCH_ALTITUDE / 2)), z = z - PORTAL_SEARCH_HALF_CHUNK} + local pos2 = {x = x + PORTAL_SEARCH_HALF_CHUNK, y = math.min(y_max, math.ceil(y + PORTAL_SEARCH_ALTITUDE / 2)), z = z + PORTAL_SEARCH_HALF_CHUNK} + if pos1.y == y_min then + pos2.y = math.min(y_max, pos1.y + PORTAL_SEARCH_ALTITUDE) else - return false + if pos2.y == y_max then + pos1.y = math.max(y_min, pos2.y - PORTAL_SEARCH_ALTITUDE) + end end - - if not move_check(p1, p2.y, "y") then - return false - end - if not move_check(p2, p1.y, "y") then - return false - end - - return true + minetest.emerge_area(pos1, pos2, ecb_setup_target_portal, {srcx=src_pos.x, srcy=src_pos.y, srcz=src_pos.z, dstx=x, dsty=y, dstz=z, srcdim=cdim, ax1=pos1.x, ay1=pos1.y, az1=pos1.z, ax2=pos2.x, ay2=pos2.y, az2=pos2.z}) end -local function is_portal(pos) - local xsize, ysize = FRAME_SIZE_X_MIN-1, FRAME_SIZE_Y_MIN-1 - for sx = FRAME_SIZE_X_MIN, FRAME_SIZE_X_MAX do - local xsize = sx - 1 - for sy = FRAME_SIZE_Y_MIN, FRAME_SIZE_Y_MAX do - local ysize = sy - 1 - for d = -xsize, xsize do - for y = -ysize, ysize do - local px = {x = pos.x + d, y = pos.y + y, z = pos.z} - local pz = {x = pos.x, y = pos.y + y, z = pos.z + d} - if check_portal(px, {x = px.x + xsize, y = px.y + ysize, z = px.z}) then - return px, {x = px.x + xsize, y = px.y + ysize, z = px.z} +local function emerge_target_area(src_pos) + local x, y, z, cdim, y_min, y_max = nether_portal_get_target_position(src_pos) + local pos1 = {x = x - PORTAL_SEARCH_HALF_CHUNK, y = math.max(y_min + 2, math.floor(y - PORTAL_SEARCH_ALTITUDE / 2)), z = z - PORTAL_SEARCH_HALF_CHUNK} + local pos2 = {x = x + PORTAL_SEARCH_HALF_CHUNK, y = math.min(y_max - 2, math.ceil(y + PORTAL_SEARCH_ALTITUDE / 2)), z = z + PORTAL_SEARCH_HALF_CHUNK} + minetest.emerge_area(pos1, pos2) + pos1 = {x = x - 1, y = y_min, z = z - 1} + pos2 = {x = x + 1, y = y_max, z = z + 1} + minetest.emerge_area(pos1, pos2) +end + +local function available_for_nether_portal(p) + local nn = minetest.get_node(p).name + local obsidian = nn == "mcl_core:obsidian" + if nn ~= "air" and minetest.get_item_group(nn, "fire") ~= 1 then + return false, obsidian + end + return true, obsidian +end + +local function light_frame(x1, y1, z1, x2, y2, z2, build_frame) + local build_frame = build_frame or false + local orientation = 0 + if x1 == x2 then + orientation = 1 + end + local disperse = 50 + local pass = 1 + while true do + local protection = false + + for x = x1 - 1 + orientation, x2 + 1 - orientation do + for z = z1 - orientation, z2 + orientation do + for y = y1 - 1, y2 + 1 do + local frame = (x < x1) or (x > x2) or (y < y1) or (y > y2) or (z < z1) or (z > z2) + if frame then + if build_frame then + if pass == 1 then + if minetest.is_protected({x = x, y = y, z = z}, "") then + protection = true + local offset_x = math.random(-disperse, disperse) + local offset_z = math.random(-disperse, disperse) + disperse = disperse + math.random(25, 177) + if disperse > 5000 then + return nil + end + x1, z1 = x1 + offset_x, z1 + offset_z + x2, z2 = x2 + offset_x, z2 + offset_z + local _, dimension = mcl_worlds.y_to_layer(y1) + local height = math.abs(y2 - y1) + y1 = (y1 + y2) / 2 + if dimension == "nether" then + y1 = find_nether_target_y(math.min(x1, x2), y1, math.min(z1, z2)) + else + y1 = find_overworld_target_y(math.min(x1, x2), y1, math.min(z1, z2)) + end + y2 = y1 + height + break + end + else + minetest.set_node({x = x, y = y, z = z}, {name = "mcl_core:obsidian"}) + end + end + else + if not build_frame or pass == 2 then + local node = minetest.get_node({x = x, y = y, z = z}) + minetest.set_node({x = x, y = y, z = z}, {name = "mcl_portals:portal", param2 = orientation}) + end end - if check_portal(pz, {x = pz.x, y = pz.y + ysize, z = pz.z + xsize}) then - return pz, {x = pz.x, y = pz.y + ysize, z = pz.z + xsize} + if not frame and pass == 2 then + local meta = minetest.get_meta({x = x, y = y, z = z}) + -- Portal frame corners + meta:set_string("portal_frame1", minetest.pos_to_string({x = x1, y = y1, z = z1})) + meta:set_string("portal_frame2", minetest.pos_to_string({x = x2, y = y2, z = z2})) + -- Portal target coordinates + meta:set_string("portal_target", "") + -- Portal last teleportation time + meta:set_string("portal_time", tostring(0)) end end + if protection then + break + end + end + if protection then + break + end + end + if build_frame == false or pass == 2 then + break + end + if build_frame and not protection and pass == 1 then + pass = 2 + end + end + emerge_target_area({x = x1, y = y1, z = z1}) + return {x = x1, y = y1, z = z1} +end + +--Build arrival portal +function mcl_portals.build_nether_portal(pos, width, height, orientation) + local height = height or FRAME_SIZE_Y_MIN - 2 + local width = width or FRAME_SIZE_X_MIN - 2 + local orientation = orientation or math.random(0, 1) + + if orientation == 0 then + minetest.load_area({x = pos.x - 3, y = pos.y - 1, z = pos.z - width * 2}, {x = pos.x + width + 2, y = pos.y + height + 2, z = pos.z + width * 2}) + else + minetest.load_area({x = pos.x - width * 2, y = pos.y - 1, z = pos.z - 3}, {x = pos.x + width * 2, y = pos.y + height + 2, z = pos.z + width + 2}) + end + + pos = light_frame(pos.x, pos.y, pos.z, pos.x + (1 - orientation) * (width - 1), pos.y + height - 1, pos.z + orientation * (width - 1), true) + + -- Clear some space around: + for x = pos.x - math.random(2 + (width-2)*( orientation), 5 + (2*width-5)*( orientation)), pos.x + width*(1-orientation) + math.random(2+(width-2)*( orientation), 4 + (2*width-4)*( orientation)) do + for z = pos.z - math.random(2 + (width-2)*(1-orientation), 5 + (2*width-5)*(1-orientation)), pos.z + width*( orientation) + math.random(2+(width-2)*(1-orientation), 4 + (2*width-4)*(1-orientation)) do + for y = pos.y - 1, pos.y + height + math.random(1,6) do + local nn = minetest.get_node({x = x, y = y, z = z}).name + if nn ~= "mcl_core:obsidian" and nn ~= "mcl_portals:portal" and minetest.registered_nodes[nn].is_ground_content and not minetest.is_protected({x = x, y = y, z = z}, "") then + minetest.remove_node({x = x, y = y, z = z}) + end + end + end + end + + -- Build obsidian platform: + for x = pos.x - orientation, pos.x + orientation + (width - 1) * (1 - orientation), 1 + orientation do + for z = pos.z - 1 + orientation, pos.z + 1 - orientation + (width - 1) * orientation, 2 - orientation do + local pp = {x = x, y = pos.y - 1, z = z} + local nn = minetest.get_node(pp).name + if not minetest.registered_nodes[nn].is_ground_content and not minetest.is_protected(pp, "") then + minetest.set_node(pp, {name = "mcl_core:obsidian"}) + end + end + end + + minetest.log("action", "[mcl_portal] Destination Nether portal generated at "..minetest.pos_to_string(pos).."!") + + return pos +end + +local function check_and_light_shape(pos, orientation) + local stack = {{x = pos.x, y = pos.y, z = pos.z}} + local node_list = {} + local node_counter = 0 + -- Search most low node from the left (pos1) and most right node from the top (pos2) + local pos1 = {x = pos.x, y = pos.y, z = pos.z} + local pos2 = {x = pos.x, y = pos.y, z = pos.z} + + local wrong_portal_nodes_clean_up = function(node_list) + for i = 1, #node_list do + local meta = minetest.get_meta(node_list[i]) + meta:set_string("portal_time", "") + end + return false + end + + while #stack > 0 do + local i = #stack + local meta = minetest.get_meta(stack[i]) + local target = meta:get_string("portal_time") + if target and target == "-2" then + stack[i] = nil -- Already checked, skip it + else + local good, obsidian = available_for_nether_portal(stack[i]) + if obsidian then + stack[i] = nil + else + if (not good) or (node_counter >= PORTAL_NODES_MAX) then + return wrong_portal_nodes_clean_up(node_list) + end + local x, y, z = stack[i].x, stack[i].y, stack[i].z + meta:set_string("portal_time", "-2") + node_counter = node_counter + 1 + node_list[node_counter] = {x = x, y = y, z = z} + stack[i].y = y - 1 + stack[i + 1] = {x = x, y = y + 1, z = z} + if orientation == 0 then + stack[i + 2] = {x = x - 1, y = y, z = z} + stack[i + 3] = {x = x + 1, y = y, z = z} + else + stack[i + 2] = {x = x, y = y, z = z - 1} + stack[i + 3] = {x = x, y = y, z = z + 1} + end + if (y < pos1.y) or (y == pos1.y and (x < pos1.x or z < pos1.z)) then + pos1 = {x = x, y = y, z = z} + end + if (x > pos2.x or z > pos2.z) or (x == pos2.x and z == pos2.z and y > pos2.y) then + pos2 = {x = x, y = y, z = z} + end end end end + + if node_counter < PORTAL_NODES_MIN then + return wrong_portal_nodes_clean_up(node_list) + end + + -- Limit rectangles width and height + if math.abs(pos2.x - pos1.x + pos2.z - pos1.z) + 3 > FRAME_SIZE_X_MAX or math.abs(pos2.y - pos1.y) + 3 > FRAME_SIZE_Y_MAX then + return wrong_portal_nodes_clean_up(node_list) + end + + for i = 1, node_counter do + local node_pos = node_list[i] + local node = minetest.get_node(node_pos) + minetest.set_node(node_pos, {name = "mcl_portals:portal", param2 = orientation}) + local meta = minetest.get_meta(node_pos) + meta:set_string("portal_frame1", minetest.pos_to_string(pos1)) + meta:set_string("portal_frame2", minetest.pos_to_string(pos2)) + meta:set_string("portal_time", tostring(0)) + meta:set_string("portal_target", "") + end + return true end --- Attempts to light a Nether portal at pos and --- select target position. --- Pos can be any of the obsidian frame blocks or the inner part. +-- Attempts to light a Nether portal at pos +-- Pos can be any of the inner part. -- The frame MUST be filled only with air or any fire, which will be replaced with Nether portal blocks. -- If no Nether portal can be lit, nothing happens. --- Returns true on success and false on failure. +-- Returns number of portals created (0, 1 or 2) function mcl_portals.light_nether_portal(pos) -- Only allow to make portals in Overworld and Nether local dim = mcl_worlds.pos_to_dimension(pos) if dim ~= "overworld" and dim ~= "nether" then - return false + return 0 end - -- Create Nether portal nodes - local p1, p2 = is_portal(pos) - if not p1 or not p2 then - return false - end - - for d = 1, 2 do - for y = p1.y + 1, p2.y - 1 do - local p - if p1.z == p2.z then - p = {x = p1.x + d, y = y, z = p1.z} - else - p = {x = p1.x, y = y, z = p1.z + d} - end - local nn = minetest.get_node(p).name - if nn ~= "air" and minetest.get_item_group(nn, "fire") ~= 1 then - return false + local orientation = math.random(0, 1) + for orientation_iteration = 1, 2 do + if check_and_light_shape(pos, orientation) then + return true end + orientation = 1 - orientation end - end - - local param2 - if p1.z == p2.z then - param2 = 0 - else - param2 = 1 - end - - -- Find target - - local target = {x = p1.x, y = p1.y, z = p1.z} - target.x = target.x + 1 - if target.y < mcl_vars.mg_nether_max and target.y > mcl_vars.mg_nether_min then - if superflat then - target.y = mcl_vars.mg_bedrock_overworld_max + 5 - elseif mg_name == "flat" then - local ground = minetest.get_mapgen_setting("mgflat_ground_level") - ground = tonumber(ground) - if not ground then - ground = 8 - end - target.y = ground + 2 - else - target.y = math.random(mcl_vars.mg_overworld_min + 40, mcl_vars.mg_overworld_min + 96) - end - else - target.y = find_nether_target_y(target.x, target.z) - end - - local dmin, ymin, ymax = 0, p1.y, p2.y - local dmax = math.max(math.abs(p1.x - p2.x), math.abs(p1.z - p2.z)) - for d = dmin, dmax do - for y = ymin, ymax do - if not ((d == dmin or d == dmax) and (y == ymin or y == ymax)) then - local p - if param2 == 0 then - p = {x = p1.x + d, y = y, z = p1.z} - else - p = {x = p1.x, y = y, z = p1.z + d} - end - if d ~= dmin and d ~= dmax and y ~= ymin and y ~= ymax then - minetest.set_node(p, {name = "mcl_portals:portal", param2 = param2}) - end - local meta = minetest.get_meta(p) - - -- Portal frame corners - meta:set_string("portal_frame1", minetest.pos_to_string(p1)) - meta:set_string("portal_frame2", minetest.pos_to_string(p2)) - - -- Portal target coordinates - meta:set_string("portal_target", minetest.pos_to_string(target)) - end - end - end - - return true + return false end +local function update_portal_time(pos, time_str) + local stack = {{x = pos.x, y = pos.y, z = pos.z}} + while #stack > 0 do + local i = #stack + local meta = minetest.get_meta(stack[i]) + if meta:get_string("portal_time") == time_str then + stack[i] = nil -- Already updated, skip it + else + local node = minetest.get_node(stack[i]) + local portal = node.name == "mcl_portals:portal" + if not portal then + stack[i] = nil + else + local x, y, z = stack[i].x, stack[i].y, stack[i].z + meta:set_string("portal_time", time_str) + stack[i].y = y - 1 + stack[i + 1] = {x = x, y = y + 1, z = z} + if node.param2 == 0 then + stack[i + 2] = {x = x - 1, y = y, z = z} + stack[i + 3] = {x = x + 1, y = y, z = z} + else + stack[i + 2] = {x = x, y = y, z = z - 1} + stack[i + 3] = {x = x, y = y, z = z + 1} + end + end + end + end +end + +local function prepare_target(pos) + local meta, us_time = minetest.get_meta(pos), minetest.get_us_time() + local portal_time = tonumber(meta:get_string("portal_time")) or 0 + local delta_time_us = us_time - portal_time + local pos1, pos2 = minetest.string_to_pos(meta:get_string("portal_frame1")), minetest.string_to_pos(meta:get_string("portal_frame2")) + if delta_time_us <= DESTINATION_EXPIRES then + -- Destination point must be still cached according to https://minecraft.gamepedia.com/Nether_portal + return update_portal_time(pos, tostring(us_time)) + end + -- No cached destination point + find_or_create_portal(pos) +end + +-- Teleportation cooloff for some seconds, to prevent back-and-forth teleportation +local function stop_teleport_cooloff(o) + mcl_portals.nether_portal_cooloff[o] = false + touch_chatter_prevention[o] = nil +end + +local function teleport_cooloff(obj) + if obj:is_player() then + minetest.after(TELEPORT_COOLOFF, stop_teleport_cooloff, obj) + else + minetest.after(MOB_TELEPORT_COOLOFF, stop_teleport_cooloff, obj) + end +end + +-- Teleport function +local function teleport_no_delay(obj, pos) + local is_player = obj:is_player() + if (not obj:get_luaentity()) and (not is_player) then + return + end + + local objpos = obj:get_pos() + if objpos == nil then + return + end + + if mcl_portals.nether_portal_cooloff[obj] then + return + end + -- If player stands, player is at ca. something+0.5 + -- which might cause precision problems, so we used ceil. + objpos.y = math.ceil(objpos.y) + + if minetest.get_node(objpos).name ~= "mcl_portals:portal" then + return + end + + local meta = minetest.get_meta(pos) + local delta_time = minetest.get_us_time() - (tonumber(meta:get_string("portal_time")) or 0) + local target = minetest.string_to_pos(meta:get_string("portal_target")) + if delta_time > DESTINATION_EXPIRES or target == nil then + -- Area not ready yet - retry after a second + if obj:is_player() then + minetest.chat_send_player(obj:get_player_name(), S("Loading terrain...")) + end + return minetest.after(1, teleport_no_delay, obj, pos) + end + + -- Enable teleportation cooloff for some seconds, to prevent back-and-forth teleportation + teleport_cooloff(obj) + mcl_portals.nether_portal_cooloff[obj] = true + + -- Teleport + obj:set_pos(target) + + if is_player then + mcl_worlds.dimension_change(obj, mcl_worlds.pos_to_dimension(target)) + minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}, true) + local name = obj:get_player_name() + minetest.log("action", "[mcl_portal] "..name.." teleported to Nether portal at "..minetest.pos_to_string(target)..".") + end +end + +local function prevent_portal_chatter(obj) + local time_us = minetest.get_us_time() + local chatter = touch_chatter_prevention[obj] or 0 + touch_chatter_prevention[obj] = time_us + minetest.after(TOUCH_CHATTER_TIME, function(o) + if not o or not touch_chatter_prevention[o] then + return + end + if minetest.get_us_time() - touch_chatter_prevention[o] >= TOUCH_CHATTER_TIME_US then + touch_chatter_prevention[o] = nil + end + end, obj) + return time_us - chatter > TOUCH_CHATTER_TIME_US +end + +local function animation(player, playername) + local chatter = touch_chatter_prevention[player] or 0 + if mcl_portals.nether_portal_cooloff[player] or minetest.get_us_time() - chatter < TOUCH_CHATTER_TIME_US then + local pos = player:get_pos() + minetest.add_particlespawner({ + amount = 1, + minpos = {x = pos.x - 0.1, y = pos.y + 1.4, z = pos.z - 0.1}, + maxpos = {x = pos.x + 0.1, y = pos.y + 1.6, z = pos.z + 0.1}, + minvel = 0, + maxvel = 0, + minacc = 0, + maxacc = 0, + minexptime = 0.1, + maxexptime = 0.2, + minsize = 5, + maxsize = 15, + collisiondetection = false, + texture = "mcl_particles_nether_portal_t.png", + playername = playername, + }) + minetest.after(0.3, animation, player, playername) + end +end + +local function teleport(obj, portal_pos) + local name = "" + if obj:is_player() then + name = obj:get_player_name() + animation(obj, name) + end + -- Call prepare_target() first because it might take a long + prepare_target(portal_pos) + -- Prevent quick back-and-forth teleportation + if not mcl_portals.nether_portal_cooloff[obj] then + local creative_enabled = minetest.is_creative_enabled(name) + if creative_enabled then + return teleport_no_delay(obj, portal_pos) + end + minetest.after(TELEPORT_DELAY, teleport_no_delay, obj, portal_pos) + end +end minetest.register_abm({ label = "Nether portal teleportation and particles", nodenames = {"mcl_portals:portal"}, interval = 1, - chance = 2, + chance = 1, action = function(pos, node) - minetest.add_particlespawner({ - amount = 32, - time = 4, - minpos = {x = pos.x - 0.25, y = pos.y - 0.25, z = pos.z - 0.25}, - maxpos = {x = pos.x + 0.25, y = pos.y + 0.25, z = pos.z + 0.25}, - minvel = {x = -0.8, y = -0.8, z = -0.8}, - maxvel = {x = 0.8, y = 0.8, z = 0.8}, - minacc = {x = 0, y = 0, z = 0}, - maxacc = {x = 0, y = 0, z = 0}, - minexptime = 0.5, - maxexptime = 1, - minsize = 1, - maxsize = 2, - collisiondetection = false, - texture = "mcl_particles_teleport.png", - }) - for _,obj in ipairs(minetest.get_objects_inside_radius(pos,1)) do --maikerumine added for objects to travel - local lua_entity = obj:get_luaentity() --maikerumine added for objects to travel - if obj:is_player() or lua_entity then - -- Prevent quick back-and-forth teleportation - if portal_cooloff[obj] then - return - end - local meta = minetest.get_meta(pos) - local target = minetest.string_to_pos(meta:get_string("portal_target")) - if target then - -- force emerge of target area - minetest.get_voxel_manip():read_from_map(target, target) - if not minetest.get_node_or_nil(target) then - minetest.emerge_area(vector.subtract(target, 4), vector.add(target, 4)) - end - - -- teleport function - local teleport = function(obj, pos, target) - if (not obj:get_luaentity()) and (not obj:is_player()) then - return - end - -- Prevent quick back-and-forth teleportation - if portal_cooloff[obj] then - return - end - local objpos = obj:get_pos() - if objpos == nil then - return - end - -- If player stands, player is at ca. something+0.5 - -- which might cause precision problems, so we used ceil. - objpos.y = math.ceil(objpos.y) - - if minetest.get_node(objpos).name ~= "mcl_portals:portal" then - return - end - - -- Teleport - obj:set_pos(target) - if obj:is_player() then - mcl_worlds.dimension_change(obj, mcl_worlds.pos_to_dimension(target)) - minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}, true) - end - - -- Enable teleportation cooloff for some seconds, to prevent back-and-forth teleportation - portal_cooloff[obj] = true - minetest.after(TELEPORT_COOLOFF, function(o) - portal_cooloff[o] = false - end, obj) - if obj:is_player() then - local name = obj:get_player_name() - minetest.log("action", "[mcl_portal] "..name.." teleported to Nether portal at "..minetest.pos_to_string(target)..".") - end - end - - local n = minetest.get_node_or_nil(target) - if n and n.name ~= "mcl_portals:portal" then - -- Emerge target area, wait for emerging to be finished, build destination portal - -- (if there isn't already one, teleport object after a short delay. - local emerge_callback = function(blockpos, action, calls_remaining, param) - minetest.log("verbose", "[mcl_portal] emerge_callack called! action="..action) - if calls_remaining <= 0 and action ~= minetest.EMERGE_CANCELLED and action ~= minetest.EMERGE_ERRORED then - minetest.log("verbose", "[mcl_portal] Area for destination Nether portal emerged!") - build_portal(param.target, param.pos, false) - minetest.after(TELEPORT_DELAY, teleport, obj, pos, target) - end - end - minetest.log("verbose", "[mcl_portal] Emerging area for destination Nether portal ...") - minetest.emerge_area(vector.subtract(target, 7), vector.add(target, 7), emerge_callback, { pos = pos, target = target }) - else - minetest.after(TELEPORT_DELAY, teleport, obj, pos, target) - end - - end + local o = node.param2 -- orientation + local d = math.random(0, 1) -- direction + local time = math.random() * 1.9 + 0.5 + local velocity, acceleration + if o == 1 then + velocity = {x = math.random() * 0.7 + 0.3, y = math.random() - 0.5, z = math.random() - 0.5} + acceleration = {x = math.random() * 1.1 + 0.3, y = math.random() - 0.5, z = math.random() - 0.5} + else + velocity = {x = math.random() - 0.5, y = math.random() - 0.5, z = math.random() * 0.7 + 0.3} + acceleration = {x = math.random() - 0.5, y = math.random() - 0.5, z = math.random() * 1.1 + 0.3} + end + local distance = vector.add(vector.multiply(velocity, time), vector.multiply(acceleration, time * time / 2)) + if d == 1 then + if o == 1 then + distance.x = -distance.x + velocity.x = -velocity.x + acceleration.x = -acceleration.x + else + distance.z = -distance.z + velocity.z = -velocity.z + acceleration.z = -acceleration.z + end + end + distance = vector.subtract(pos, distance) + for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 15)) do + if obj:is_player() then + minetest.add_particlespawner({ + amount = node_particles_allowed_level + 1, + minpos = distance, + maxpos = distance, + minvel = velocity, + maxvel = velocity, + minacc = acceleration, + maxacc = acceleration, + minexptime = time, + maxexptime = time, + minsize = 0.3, + maxsize = 1.8, + collisiondetection = false, + texture = "mcl_particles_nether_portal.png", + playername = obj:get_player_name(), + }) + end + end + for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do --maikerumine added for objects to travel + local lua_entity = obj:get_luaentity() --maikerumine added for objects to travel + if (obj:is_player() or lua_entity) and prevent_portal_chatter(obj) then + teleport(obj, pos) end end end, @@ -495,20 +831,24 @@ local usagehelp = S("To open a Nether portal, place an upright frame of obsidian minetest.override_item("mcl_core:obsidian", { _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, - on_destruct = destroy_portal, + on_destruct = destroy_nether_portal, _on_ignite = function(user, pointed_thing) - local pos = pointed_thing.under - local portal_placed = mcl_portals.light_nether_portal(pos) - if portal_placed then - minetest.log("action", "[mcl_portal] Nether portal activated at "..minetest.pos_to_string(pos)..".") - end - if portal_placed and minetest.get_modpath("doc") then - doc.mark_entry_as_revealed(user:get_player_name(), "nodes", "mcl_portals:portal") + local x, y, z = pointed_thing.under.x, pointed_thing.under.y, pointed_thing.under.z + -- Check empty spaces around obsidian and light all frames found: + local portals_placed = + mcl_portals.light_nether_portal({x = x - 1, y = y, z = z}) or mcl_portals.light_nether_portal({x = x + 1, y = y, z = z}) or + mcl_portals.light_nether_portal({x = x, y = y - 1, z = z}) or mcl_portals.light_nether_portal({x = x, y = y + 1, z = z}) or + mcl_portals.light_nether_portal({x = x, y = y, z = z - 1}) or mcl_portals.light_nether_portal({x = x, y = y, z = z + 1}) + if portals_placed then + minetest.log("action", "[mcl_portal] Nether portal activated at "..minetest.pos_to_string({x=x,y=y,z=z})..".") + if minetest.get_modpath("doc") then + doc.mark_entry_as_revealed(user:get_player_name(), "nodes", "mcl_portals:portal") - -- Achievement for finishing a Nether portal TO the Nether - local dim = mcl_worlds.pos_to_dimension(pos) - if minetest.get_modpath("awards") and dim ~= "nether" and user:is_player() then - awards.unlock(user:get_player_name(), "mcl:buildNetherPortal") + -- Achievement for finishing a Nether portal TO the Nether + local dim = mcl_worlds.pos_to_dimension({x=x, y=y, z=z}) + if minetest.get_modpath("awards") and dim ~= "nether" and user:is_player() then + awards.unlock(user:get_player_name(), "mcl:buildNetherPortal") + end end return true else diff --git a/mods/ITEMS/mcl_portals/textures/mcl_particles_nether_portal.png b/mods/ITEMS/mcl_portals/textures/mcl_particles_nether_portal.png new file mode 100644 index 0000000000000000000000000000000000000000..2837756f6ddf84acd9f4f58a3bf12b92008f77d9 GIT binary patch literal 111 zcmeAS@N?(olHy`uVBq!ia0vp^>>$j@3?%=}IXVGIu?6^qxB}_(4ChV!w@(JLm`Z~D zf*BrMo2l;r>$j@3?%=}IXVGIu?6^qxB}_<4EJ4KI^BURrjj7P zV1`KFS$pMKS2^W$%5+m4`Y-QlnVbXUMzHb7QXYh3Ob6Mw<&;$V3 C#TnNC literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_portals/textures/mcl_portals_portal.png b/mods/ITEMS/mcl_portals/textures/mcl_portals_portal.png index 4be1e41f1a4ed6c73df529735a8497fab4f5a468..8554e4a8d5cc1f72ce3d5105459af2ae799746d0 100644 GIT binary patch literal 1861 zcmV-L2fFx)P)*J>;oOKS7|xovuKbdQqD-Q(x`dA^^cp*u&4RIPHB zNaj&0Bq%MbLqlm=A0U^{?2v@-Q{&y08tS zm8!Ffux)3E22Cg9WO6}zE^20+oY_esH|n@XW{?6#E|#^P3DXh9ih16v4^hWU-kV-t zJ5Ax1_-pz2i2zk?Sx$_NJ>N+EsjUkW3nSCiyQgq+YG0?H0-?uO3Z>yN`G()U_~8eQ zMM`!)Q7T_JLv*lyab<07dky)0+m;rWrf(A6T)vi{Y#>V3e7?W`e?_7`T3y?E@qsc? zY138Tl@bv>aQi}N9p@zZmclqwU%B|rnsOP}G+!zDiu{}DZ%w+Frg4q$A8!r(sX0k> zX#e%!tS0-&-~aORwWWi2`lg-_f3SEgNy#6(<-V2nUh*C7T05}(>lzA#PZhrZX(v%{ z=hJ(i+&5CB{^7BStqW?Hsy6Rlc&z)6ehNQ7p13}*O;blI;VtA}ZKNYxJa5i=DnNnn zS>{~ywbK-|bFqKr%!jB`F`QW^7p6hOc4kdyhN_)R=B#dfiJBr2aaK`+w8PXzPS`^< zoUuj5)>|p0+8V}hkc>bx_#xF6T1HC?N+I`A6(mR?VN|Fo5+Gt!7Ai3#qp~bhI&|kC z_3lCVGY%~UYy_Vr(nGSU4&jC(C8;Vu0@w&VCJk)TLbG)l57h;D*-5fq862m&h{)&+ z(%=QhF&LyBQPVL^fYelL#7y_mMyj68nXz2#J9JdBOw0J~AazKdXIZ<#6h7;D@qDJ8 zKJ&<2A~EsI01ec2?e2PZG(hb$6Z73CclJ{KSKIdQ|M(4L9QgB%sq3wNO1|B5_*7wJ zJN173#Zq~tW14EJde%$1Un1|zFTcKA>TRH8{egGh`Dma>hkfTR_rG@tu-trdZS{TR zPc>&|e4jLwflc$(2g{6BdHru+WPZrEt~FG!S+6O6?v*lM^U=y?W{n!Y@K*n=PjE@` z{cB&o;h&~M{^o_Qe;1o6xqbH3?bUib;`Fxi;ic0_+7u|1e!kXtkb0XQz0vcNzhlmS zeRr}j^>C8>b&oI3UmR(tuw3XGAKOz;?dP`U$Kq*xcj@}Lm*3e=fgf6y=lvl_!54Ct zYw5$(QERwvG=nuv#ImuhiB)y7is|Hr7@LS`##$L0-O!`R0?g=&f^>wf-_1*;bg7b{ zNNbf$Wi738T}TLBbFm0Vam2+KO)Nt{Y zJ8DhO@URHM7nmO`3l=J2Sy-q6X*nL}rE5R;jrra4SWGPML{~SK*I)O<-o3owh@fzQ zBS0v(5C0dTAf|F3$AsYezRkfQ%E^y8N`!mxo+YBu*E|nQ$fc=*~20Quo-jxH4I^dsL zX85rkx)%3gJG9S?kInN28K_H)&vj$VU=vwmacrXSS@6T#3L7owx!7n&l~^ukV(V4U zW~13CHe*w5#K>f^J$FP6!*RIzFW9DSV++@zbSie>ys+huBSFnhGf2o(;#`q(N=8w@ zGLR0U*D53or6o~e11gd#wA``Pz1rC*BCRr#Wd3(Pt9-){Dkz0V;7;fpYQgRC5hy*8 zmKdZET1V1RgD6J*vs{e8hUdt;0HkNKL8^9@h!R1a4jOJmF=8{QTr(Gmp>l(^myNn8 zVbrn}^-#-4w#-?NaZ#hX=f2j3>PDH5$0tzcRh!$o+qmBQhksXi_9O})3Yh9)1waa` zKVvCC6XibE1jKQvhs6PvEN)|!KrVAZmJ4)q`55a40-8C`0)mo$U&~6mFR6Rl+7Q`> z+913CTw&Qkf46?c`hyUE@e~UYid>y!MM9dNuCg?t(NdW;3bEd}#A1bNe>%mgg?!)J z&+_fvv-qR#ap)L=ezR>i1YNb|gQw%H>~M?KX0gPf^}J<4>qnGW-eA!O4EMWH7wQkW zkzElJF9Xj-j9n2OuLpyseL_(pSouumgkX@Gbm0mH39lK7V32@}g8CWZa!~N2vSk#B zLDJH43vy4hiCRE{#%^i>6N0g6VM^%UYtR1y7>!Ed)ND^(00000NkvXXu0mjfyw8qe literal 1235 zcmeAS@N?(olHy`uVBq!ia0vp^0zmA*!3-o-7PBv5U|P9987d=~+Jc#YCbxt!wS+J>0&R(4Y!7E>3ugj~GzTzMg))Im z2xO@BW2^{gYz=2>4PdMaVQv7rB!sCkn6W;HsTL?3#@rmlSQo+E2C|p20q8J)hAN;) z5MwQn5zN>CWP~%fgfq7JGgboK8Ohk;#|Ux&&{N^etw0-r_69T8`7>2UGIanQ8OhuZ zbge&A1&GVg916AzXb#ZVVa!btOzlADS$$9i1y)Q+kYDhA7}yJBfG{cmia-UCC=hcm z2=0Xl0!bhX%z+3)WcGSqxcr5Ifmz7Y#WAFUQ8e&*(rq(=e;N)J{8ufT%0=E>%1SWW z#I?S|?}kQ(chswU)%*Szm;BlH+brNr&)jHt3#&2<%cF;OmY+K}uhILxR|wMvv9Fg{ z%ioEK8-Lbo%GTSvYpUVur`1!d`zlPMXPDi3*UGZ}h}3oM!n)7<)_e2&7BASB8LGV` zTCuvE?daP5?JtgHYNy-OCuAtSuQ@qSFD|J%IN@Ctx5&zG-~DQnCM-WRZTp#iPbYo_ zp}Tv7^m2~ho_C!^^rPWEw~RTwN8dKMZU4pCb7FS!`X~dRl(O$`<;_PV??shxeEhX@ z(fOEp$Jsm@+rsR8gfutq_m0^9bMY;koK^j;88fuq;#PiG@_mti_uO@j5A@#j{&1H& z`JJ1;ar4g0S@ZdSAM$CrE--nKm~`JV?e%^O%Ko@W&O0A}Nv(v>T3lG)>05wV?dpuR z>iUl|avid^&+t2U+2!XI-PGJA3K5s=l5ZxQm_KVB+n?Fqz4QP6pLbF%MB}yP_E#Ne zzOAws>A7<^{b$TG$$$vqRnASTV?ap$R4b#+$|1$JGi@vwu=90T*f8JHg-Qm|; zpO-i-=ELT_Q{Hv<-`U%~wP@FpzjrLm7VGN9b@shc{@Q1M|3m^~<`pf^?01@L+vE#B zRn-XZV}7%ECx4i9#s7$w8K#=c1GV~pxzu~P-i%D%@pxg2+U4qBAEj1`^TppeBpKc! z605h?{{!2$Q>^Sy?IsLe5?~LJ{(>m z8SwRQ-S^ys_j`CJJ(VjLzkhiPU)-OYLAzKVbS~-q#65S`gN^x(xj$FWocm}0j{Q;! z89tw93a$8WUp$4W-8EN2OIKfy)g!~V+V=0Uo7e8iUXo;C&d?cs&wtaHuLXYb4}-xvN+yr6xm!BQK?^=Ee6c03h-@o#Evpp|ZSG~@0M-+8{J r1ihaa#-)-hA1r%sT6t)V+spVxx6{R~5BBf?b0LGLtDnm{r-UW|&e}0! diff --git a/tools/create_texture__mcl_particles_nether_portal.py b/tools/create_texture__mcl_particles_nether_portal.py new file mode 100644 index 000000000..162186eb2 --- /dev/null +++ b/tools/create_texture__mcl_particles_nether_portal.py @@ -0,0 +1,21 @@ +import png + +s = [ + '0000010', + '0101100', + '0010111', + '0101010', + '1010111', + '0001100', + '0010100', +] + +s = [[int(c) for c in row] for row in s] + +# R, G, B, Alpha (0xFF = opaque): +palette=[(0x00,0x00,0x00,0x00), (0xcf,0x00,0xcf,0xe0)] + +w = png.Writer(len(s[0]), len(s), palette=palette, bitdepth=1) +f = open('mcl_particles_nether_portal.png', 'wb') +w.write(f, s) + diff --git a/tools/create_texture__mcl_particles_nether_portal_t.py b/tools/create_texture__mcl_particles_nether_portal_t.py new file mode 100644 index 000000000..f06198c82 --- /dev/null +++ b/tools/create_texture__mcl_particles_nether_portal_t.py @@ -0,0 +1,21 @@ +import png + +s = [ + '0010010', + '0101100', + '0010111', + '0101010', + '1010111', + '0101100', + '0010101', +] + +s = [[int(c) for c in row] for row in s] + +# R, G, B, Alpha (0xFF = opaque): +palette=[(0x00,0x00,0x00,0x00), (0x9f,0x00,0xdf,0x92)] + +w = png.Writer(len(s[0]), len(s), palette=palette, bitdepth=1) +f = open('mcl_particles_nether_portal_t.png', 'wb') +w.write(f, s) + diff --git a/tools/create_texture__mcl_portals_portal.py b/tools/create_texture__mcl_portals_portal.py new file mode 100644 index 000000000..f2b1e1524 --- /dev/null +++ b/tools/create_texture__mcl_portals_portal.py @@ -0,0 +1,58 @@ +import png +w, h = 64, 256; +s = [[int(0) for c in range(w)] for c in range(h)] + +def line(y1, x1, y2, x2, v): + signx = 1 + signy = 1 + dx = x2 - x1 + dy = y2 - y1 + if dx < 0: + dx = - dx + signx = -1 + if dy < 0: + dy = - dy + signy = -1 + offsx = dx/2 + offsy = dy/2 + dir1 = 0 + if dx >= dy: + dir1 = 1 + for i in range(max(dx, dy)+1): + if v==2: + s[x1][y1]=1-s[x1][y1] + else: + s[x1][y1] = v + if dir1 == 1: + x1 += signx + offsy += dy + if offsy >= dx: + y1 += signy + offsy -= dx + else: + y1 += signy + offsx += dx + if offsx >= dy: + x1 += signx + offsx -= dy + +# R, G, B, Alpha (0xFF = opaque): +palette=[(0x00,0x00,0xaf,0xa0), (0x7f,0x0f,0xaf,0xb8)] + +for j in range(16): + i = j * 4 + line(i, 0, 63-i, 63, 2) + line(63, i, 0, 63-i, 2) + i+=1 + line(i, 64, 63-i, 127, 2) + line(63, 64+i, 0, 127-i, 2) + i+=1 + line(i, 128, 63-i, 191, 2) + line(63, 128+i, 0, 191-i, 2) + i+=1 + line(i, 192, 63-i, 255, 2) + line(63, 192+i, 0, 255-i, 2) + +w = png.Writer(len(s[0]), len(s), palette=palette, bitdepth=1) +f = open('mcl_portals_portal.png', 'wb') +w.write(f, s) From 4eb42c3a9a6861cd9adbcfe601ef7020ec042c33 Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 25 Sep 2020 00:39:51 +0400 Subject: [PATCH 141/152] Merge bzoss_player feature branch --- mods/PLAYER/mcl_playerplus/init.lua | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index d084ee2e5..74d87c6c9 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -6,6 +6,13 @@ local mcl_playerplus_internal = {} local def = {} local time = 0 +-- converts yaw to degrees +local function degrees(rad) + return rad * 180.0 / math.pi +end + +local pitch, name, node_stand, node_stand_below, node_head, node_feet, pos + minetest.register_globalstep(function(dtime) time = time + dtime @@ -13,18 +20,23 @@ minetest.register_globalstep(function(dtime) -- Update jump status immediately since we need this info in real time. -- WARNING: This section is HACKY as hell since it is all just based on heuristics. for _,player in pairs(minetest.get_connected_players()) do - local name = player:get_player_name() + name = player:get_player_name() + + -- controls head bone + pitch = degrees(player:get_look_vertical()) * -1 + player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch,0,0)) + if mcl_playerplus_internal[name].jump_cooldown > 0 then mcl_playerplus_internal[name].jump_cooldown = mcl_playerplus_internal[name].jump_cooldown - dtime end if player:get_player_control().jump and mcl_playerplus_internal[name].jump_cooldown <= 0 then - local pos = player:get_pos() + pos = player:get_pos() - local node_stand = mcl_playerinfo[name].node_stand - local node_stand_below = mcl_playerinfo[name].node_stand_below - local node_head = mcl_playerinfo[name].node_head - local node_feet = mcl_playerinfo[name].node_feet + node_stand = mcl_playerinfo[name].node_stand + node_stand_below = mcl_playerinfo[name].node_stand_below + node_head = mcl_playerinfo[name].node_head + node_feet = mcl_playerinfo[name].node_feet if not node_stand or not node_stand_below or not node_head or not node_feet then return end From 339f7c6359e3b16519e6893018cc07e054cd0601 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sat, 26 Sep 2020 02:17:49 +0400 Subject: [PATCH 142/152] Add calculation of mcl_vars.mapgen_edge_min/max in mcl_init and use them for Nether portal fast travelling --- mods/CORE/mcl_init/init.lua | 19 +++++++++++++++++++ mods/ITEMS/mcl_portals/portal_nether.lua | 18 ++++++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/mods/CORE/mcl_init/init.lua b/mods/CORE/mcl_init/init.lua index c785f290d..613226144 100644 --- a/mods/CORE/mcl_init/init.lua +++ b/mods/CORE/mcl_init/init.lua @@ -24,6 +24,25 @@ local mg_name = minetest.get_mapgen_setting("mg_name") local minecraft_height_limit = 256 local superflat = mg_name == "flat" and minetest.get_mapgen_setting("mcl_superflat_classic") == "true" +-- Calculate mapgen_edge_min/mapgen_edge_max +mcl_vars.chunksize = math.max(1, tonumber(minetest.get_mapgen_setting("chunksize")) or 5) +mcl_vars.MAP_BLOCKSIZE = math.max(1, core.MAP_BLOCKSIZE or 16) +mcl_vars.mapgen_limit = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen_limit")) or 31000) +mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, core.MAX_MAP_GENERATION_LIMIT or 31000) +local central_chunk_offset = -math.floor(mcl_vars.chunksize / 2) +local chunk_size_in_nodes = mcl_vars.chunksize * mcl_vars.MAP_BLOCKSIZE +local central_chunk_min_pos = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE +local central_chunk_max_pos = central_chunk_min_pos + chunk_size_in_nodes - 1 +local ccfmin = central_chunk_min_pos - mcl_vars.MAP_BLOCKSIZE -- Fullminp/fullmaxp of central chunk, in nodes +local ccfmax = central_chunk_max_pos + mcl_vars.MAP_BLOCKSIZE +local mapgen_limit_b = math.floor(math.min(mcl_vars.mapgen_limit, mcl_vars.MAX_MAP_GENERATION_LIMIT) / mcl_vars.MAP_BLOCKSIZE) +local mapgen_limit_min = -mapgen_limit_b * mcl_vars.MAP_BLOCKSIZE +local mapgen_limit_max = (mapgen_limit_b + 1) * mcl_vars.MAP_BLOCKSIZE - 1 +local numcmin = math.max(math.floor((ccfmin - mapgen_limit_min) / chunk_size_in_nodes), 0) -- Number of complete chunks from central chunk +local numcmax = math.max(math.floor((mapgen_limit_max - ccfmax) / chunk_size_in_nodes), 0) -- fullminp/fullmaxp to effective mapgen limits. +mcl_vars.mapgen_edge_min = central_chunk_min_pos - numcmin * chunk_size_in_nodes +mcl_vars.mapgen_edge_max = central_chunk_max_pos + numcmax * chunk_size_in_nodes + if not superflat then -- Normal mode --[[ Realm stacking (h is for height) diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 08cb654b8..55a925bc7 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -2,6 +2,9 @@ local S = minetest.get_translator("mcl_portals") -- Parameters +local OVERWORLD_TO_NETHER_SCALE = 8 +local LIMIT = math.min(math.abs(mcl_vars.mapgen_edge_min), math.abs(mcl_vars.mapgen_edge_max)) + -- Portal frame sizes local FRAME_SIZE_X_MIN = 4 local FRAME_SIZE_Y_MIN = 5 @@ -46,10 +49,9 @@ local node_particles_allowed_level = node_particles_levels[node_particles_allowe -- Functions --- https://git.minetest.land/Wuzzy/MineClone2/issues/795#issuecomment-11058 --- A bit simplified Nether fast travel ping-pong formula and function by ryvnf: +-- Ping-Pong fast travel, https://git.minetest.land/Wuzzy/MineClone2/issues/795#issuecomment-11058 local function nether_to_overworld(x) - return 30912 - math.abs(((x * 8 + 30912) % 123648) - 61824) + return LIMIT - math.abs(((x * OVERWORLD_TO_NETHER_SCALE + LIMIT) % (LIMIT*4)) - (LIMIT*2)) end -- Destroy portal if pos (portal frame or portal node) got destroyed @@ -153,10 +155,10 @@ minetest.register_node("mcl_portals:portal", { }) local function find_target_y(x, y, z, y_min, y_max) - local y_org = y + local y_org = math.max(math.min(y, y_max), y_min) local node = minetest.get_node_or_nil({x = x, y = y, z = z}) if node == nil then - return y + return y_org end while node.name ~= "air" and y < y_max do y = y + 1 @@ -200,7 +202,7 @@ local function find_target_y(x, y, z, y_min, y_max) if y == y_min then return y_org end - return y + return math.max(math.min(y, y_max), y_min) end local function find_nether_target_y(x, y, z) @@ -341,8 +343,8 @@ local function nether_portal_get_target_position(src_pos) y_min = overworld_ymin y_max = overworld_ymax else -- overworld: - x = math.floor(src_pos.x / 8 + 0.5) - z = math.floor(src_pos.z / 8 + 0.5) + x = math.floor(src_pos.x / OVERWORLD_TO_NETHER_SCALE + 0.5) + z = math.floor(src_pos.z / OVERWORLD_TO_NETHER_SCALE + 0.5) y = math.floor((math.min(math.max(src_pos.y, overworld_ymin), overworld_ymax) - overworld_ymin) / overworld_dy * nether_dy + nether_ymin + 0.5) y_min = nether_ymin y_max = nether_ymax From a511152cdf43bdc82f93481209f14025bed9f688 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sun, 27 Sep 2020 22:56:39 +0400 Subject: [PATCH 143/152] Fix glass bottles remained empty on take water from cauldrons, https://github.com/kay27/MineClone2/issues/1 --- mods/ITEMS/mcl_potions/init.lua | 49 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 4b96a80dc..b7f814c24 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -105,34 +105,31 @@ minetest.register_craftitem("mcl_potions:glass_bottle", { end end if get_water then - local creative = minetest.is_creative_enabled(placer:get_player_name()) - if from_liquid_source or creative then - -- Replace with water bottle, if possible, otherwise - -- place the water potion at a place where's space - local water_bottle - if river_water then - water_bottle = ItemStack("mcl_potions:river_water") - else - water_bottle = ItemStack("mcl_potions:water") - end - local inv = placer:get_inventory() - if creative then - -- Don't replace empty bottle in creative for convenience reasons - if not inv:contains_item("main", water_bottle) then - inv:add_item("main", water_bottle) - end - elseif itemstack:get_count() == 1 then - return water_bottle - else - if inv:room_for_item("main", water_bottle) then - inv:add_item("main", water_bottle) - else - minetest.add_item(placer:get_pos(), water_bottle) - end - itemstack:take_item() - end + local water_bottle + if river_water then + water_bottle = ItemStack("mcl_potions:river_water") + else + water_bottle = ItemStack("mcl_potions:water") end + -- Replace with water bottle, if possible, otherwise + -- place the water potion at a place where's space + local inv = placer:get_inventory() minetest.sound_play("mcl_potions_bottle_fill", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) + if minetest.is_creative_enabled(placer:get_player_name()) then + -- Don't replace empty bottle in creative for convenience reasons + if not inv:contains_item("main", water_bottle) then + inv:add_item("main", water_bottle) + end + elseif itemstack:get_count() == 1 then + return water_bottle + else + if inv:room_for_item("main", water_bottle) then + inv:add_item("main", water_bottle) + else + minetest.add_item(placer:get_pos(), water_bottle) + end + itemstack:take_item() + end end end return itemstack From 3cd30a559efa4551671e7e09a232e765a934642a Mon Sep 17 00:00:00 2001 From: kay27 Date: Wed, 30 Sep 2020 00:32:28 +0400 Subject: [PATCH 144/152] sl4v & Nicu: Don't open chests if there is a full block above them, for 1-node normal & trapped chests --- mods/ITEMS/mcl_chests/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 0b096e2cd..61b7a4df2 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -227,6 +227,10 @@ minetest.register_node("mcl_chests:"..basename, { _mcl_hardness = 2.5, on_rightclick = function(pos, node, clicker) + if minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name].groups.opaque == 1 then + -- won't open if there is no space from the top + return false + end local name = minetest.get_meta(pos):get_string("name") if name == "" then name = S("Chest") From c01c53af491f3e1937c1217477f5b26bcf2b7ae3 Mon Sep 17 00:00:00 2001 From: kay27 Date: Wed, 30 Sep 2020 16:42:52 +0400 Subject: [PATCH 145/152] Prevent opening double chests with solid block(s) on the top --- mods/ITEMS/mcl_chests/init.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 61b7a4df2..d1966e190 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -360,6 +360,12 @@ minetest.register_node("mcl_chests:"..basename.."_left", { on_rightclick = function(pos, node, clicker) local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "left") + if minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name].groups.opaque == 1 + or minetest.registered_nodes[minetest.get_node({x = pos_other.x, y = pos_other.y + 1, z = pos_other.z}).name].groups.opaque == 1 then + -- won't open if there is no space from the top + return false + end + local name = minetest.get_meta(pos):get_string("name") if name == "" then name = minetest.get_meta(pos_other):get_string("name") @@ -494,6 +500,12 @@ minetest.register_node("mcl_chests:"..basename.."_right", { on_rightclick = function(pos, node, clicker) local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "right") + if minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name].groups.opaque == 1 + or minetest.registered_nodes[minetest.get_node({x = pos_other.x, y = pos_other.y + 1, z = pos_other.z}).name].groups.opaque == 1 then + -- won't open if there is no space from the top + return false + end + local name = minetest.get_meta(pos_other):get_string("name") if name == "" then name = minetest.get_meta(pos):get_string("name") From 3bed1c5bf89b34ed7f03a1f43d5a794a4237fa60 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 30 Sep 2020 17:10:06 +0200 Subject: [PATCH 146/152] Fix accidental global in mcl_portals --- mods/ITEMS/mcl_portals/portal_nether.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 55a925bc7..a9ec2af20 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -217,7 +217,7 @@ local function find_overworld_target_y(x, y, z) if not node then return target_y end - nn = node.name + local nn = node.name if nn ~= "air" and minetest.get_item_group(nn, "water") == 0 then target_y = target_y + 1 end From 81b33d7df316decc5468aee097f3d0ef864bb2ef Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 30 Sep 2020 17:25:12 +0200 Subject: [PATCH 147/152] Shrink Nether portal texture to 16px --- .../textures/mcl_portals_portal.png | Bin 1861 -> 1086 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/mods/ITEMS/mcl_portals/textures/mcl_portals_portal.png b/mods/ITEMS/mcl_portals/textures/mcl_portals_portal.png index 8554e4a8d5cc1f72ce3d5105459af2ae799746d0..a24082b7cde5164098a7bc4973d38ad72a7ae788 100644 GIT binary patch literal 1086 zcmV-E1i|}>P)dq>rlzK*rl+WLl@r>Uu_sHvu_tE#K3uCK4Gt*)xAv$L_Wv#6@9u&l7KrKqW< zt+KSRud}PFtg5cAw6U_UB%G(p0008vNklWmnBcwo$BE(PG8AX0(r5+8&N2!wL1qaXqiO~z3yC`@T! zOk!rSwW-y_0p@F)<@3jO$6BBXtO{3 ziTqb`%MP1=r{*aZ*buHEsm_<{ZMncj2?I`pvO0H%>|AGd;$s8XWp&E- zSyg3e3@&iuJ)3f4_DNZqNH8E05AFxrK%l)?;)qsKU#^|wnsOpN3X+FYHl0q}kaJGB z0*Rl5@KMN#!(9Zz1V}0sArj&ED#V6atRt=32`>K95^#NOUf=Avw8q+4a;(;~*?YeI zDDwPOQ-Z|2O>zEgzAoMSTO_f82QR1kd$+q@a;p^whkCE`?xz)pW;<471WK1_(HuD2 zeSMTIHiX1WPT$?_m&ZhMEI)WVHC@+yf9EEm1Oef;#c5ugPK61;0WOY-*}S}_$(u#$ zxQmLl=LKGg@8eOq;7H*k3aSaG0@f}Ni~-_sRL{e4I1tz6&cK5p8eC(o0H`EHA(pmZ z1C9t{(kg@!zxZyytue-yWBc}M`)&J!6?yTo&EIp22OEz5z4&S_-Ej1wxaIC}y$r<- z<=>dNmwyLzIa?0|HDcfyvN_WbF&VK_UarL**b8#ux=jQ4_}ce(wXi%)X9RAdI#d--(=W}+b>p?>1N2WqoP?*g8YD$CWvP|}7gVF6p z4rS!&0E`ZN9gGF-eIbbA=&YqrrAGjZ>3Ot0j%mo@KV}qH1ZnJC2LJ#707*qoM6N<$ Eg6SymS^xk5 literal 1861 zcmV-L2fFx)P)*J>;oOKS7|xovuKbdQqD-Q(x`dA^^cp*u&4RIPHB zNaj&0Bq%MbLqlm=A0U^{?2v@-Q{&y08tS zm8!Ffux)3E22Cg9WO6}zE^20+oY_esH|n@XW{?6#E|#^P3DXh9ih16v4^hWU-kV-t zJ5Ax1_-pz2i2zk?Sx$_NJ>N+EsjUkW3nSCiyQgq+YG0?H0-?uO3Z>yN`G()U_~8eQ zMM`!)Q7T_JLv*lyab<07dky)0+m;rWrf(A6T)vi{Y#>V3e7?W`e?_7`T3y?E@qsc? zY138Tl@bv>aQi}N9p@zZmclqwU%B|rnsOP}G+!zDiu{}DZ%w+Frg4q$A8!r(sX0k> zX#e%!tS0-&-~aORwWWi2`lg-_f3SEgNy#6(<-V2nUh*C7T05}(>lzA#PZhrZX(v%{ z=hJ(i+&5CB{^7BStqW?Hsy6Rlc&z)6ehNQ7p13}*O;blI;VtA}ZKNYxJa5i=DnNnn zS>{~ywbK-|bFqKr%!jB`F`QW^7p6hOc4kdyhN_)R=B#dfiJBr2aaK`+w8PXzPS`^< zoUuj5)>|p0+8V}hkc>bx_#xF6T1HC?N+I`A6(mR?VN|Fo5+Gt!7Ai3#qp~bhI&|kC z_3lCVGY%~UYy_Vr(nGSU4&jC(C8;Vu0@w&VCJk)TLbG)l57h;D*-5fq862m&h{)&+ z(%=QhF&LyBQPVL^fYelL#7y_mMyj68nXz2#J9JdBOw0J~AazKdXIZ<#6h7;D@qDJ8 zKJ&<2A~EsI01ec2?e2PZG(hb$6Z73CclJ{KSKIdQ|M(4L9QgB%sq3wNO1|B5_*7wJ zJN173#Zq~tW14EJde%$1Un1|zFTcKA>TRH8{egGh`Dma>hkfTR_rG@tu-trdZS{TR zPc>&|e4jLwflc$(2g{6BdHru+WPZrEt~FG!S+6O6?v*lM^U=y?W{n!Y@K*n=PjE@` z{cB&o;h&~M{^o_Qe;1o6xqbH3?bUib;`Fxi;ic0_+7u|1e!kXtkb0XQz0vcNzhlmS zeRr}j^>C8>b&oI3UmR(tuw3XGAKOz;?dP`U$Kq*xcj@}Lm*3e=fgf6y=lvl_!54Ct zYw5$(QERwvG=nuv#ImuhiB)y7is|Hr7@LS`##$L0-O!`R0?g=&f^>wf-_1*;bg7b{ zNNbf$Wi738T}TLBbFm0Vam2+KO)Nt{Y zJ8DhO@URHM7nmO`3l=J2Sy-q6X*nL}rE5R;jrra4SWGPML{~SK*I)O<-o3owh@fzQ zBS0v(5C0dTAf|F3$AsYezRkfQ%E^y8N`!mxo+YBu*E|nQ$fc=*~20Quo-jxH4I^dsL zX85rkx)%3gJG9S?kInN28K_H)&vj$VU=vwmacrXSS@6T#3L7owx!7n&l~^ukV(V4U zW~13CHe*w5#K>f^J$FP6!*RIzFW9DSV++@zbSie>ys+huBSFnhGf2o(;#`q(N=8w@ zGLR0U*D53or6o~e11gd#wA``Pz1rC*BCRr#Wd3(Pt9-){Dkz0V;7;fpYQgRC5hy*8 zmKdZET1V1RgD6J*vs{e8hUdt;0HkNKL8^9@h!R1a4jOJmF=8{QTr(Gmp>l(^myNn8 zVbrn}^-#-4w#-?NaZ#hX=f2j3>PDH5$0tzcRh!$o+qmBQhksXi_9O})3Yh9)1waa` zKVvCC6XibE1jKQvhs6PvEN)|!KrVAZmJ4)q`55a40-8C`0)mo$U&~6mFR6Rl+7Q`> z+913CTw&Qkf46?c`hyUE@e~UYid>y!MM9dNuCg?t(NdW;3bEd}#A1bNe>%mgg?!)J z&+_fvv-qR#ap)L=ezR>i1YNb|gQw%H>~M?KX0gPf^}J<4>qnGW-eA!O4EMWH7wQkW zkzElJF9Xj-j9n2OuLpyseL_(pSouumgkX@Gbm0mH39lK7V32@}g8CWZa!~N2vSk#B zLDJH43vy4hiCRE{#%^i>6N0g6VM^%UYtR1y7>!Ed)ND^(00000NkvXXu0mjfyw8qe From b0ee0a475bde8d0a6c2f9e59bb829318119866fb Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 30 Sep 2020 17:27:34 +0200 Subject: [PATCH 148/152] Remove "Loading terrain" msg (too spammy) --- mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr | 1 - mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr | 1 - mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr | 1 - mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr | 1 - mods/ITEMS/mcl_portals/locale/template.txt | 1 - mods/ITEMS/mcl_portals/portal_nether.lua | 3 --- 6 files changed, 8 deletions(-) diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr index 957248830..593403297 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr @@ -17,4 +17,3 @@ Once placed, an eye of ender can not be taken back.=Sobald platziert, kann ein E Used to construct end portals=Benutzt zur Konstruktion von Endportalen Liquid container=Flüssigkeitsbehälter No effect=Keine Wirkung -Loading terrain...=Gelände laden... diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr index 80266348b..9636f69c3 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr @@ -14,4 +14,3 @@ Stand in the portal for a moment to activate the teleportation. Entering a Nethe Obsidian is also used as the frame of Nether portals.=La obsidiana también se usa como marco de portal del End. To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Para abrir un portal Nether, coloque un marco vertical de obsidiana con un ancho de 4 bloques y una altura de 5 bloques, dejando solo aire en el centro. Después de colocar este marco, enciende un fuego en el marco de obsidiana. Los portales de Nether solo funcionan en Overworld y Nether. Once placed, an eye of ender can not be taken back.=Una vez colocado, un ojo de ender no puede ser retirado. -Loading terrain...=Terreno de carga... diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr index d1f39c86b..76a2a6f82 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr @@ -13,4 +13,3 @@ Obsidian is also used as the frame of Nether portals.=Obsidian is also used as t To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Pour ouvrir un portail du Nether, placez un cadre vertical d'obsidienne d'une largeur de 4 blocs et d'une hauteur de 5 blocs, ne laissant que de l'air au centre. Après avoir placé ce cadre, allumez un feu dans le cadre en obsidienne. Les portails du Nether ne fonctionnent que dans l'Overworld et le Nether. Once placed, an eye of ender can not be taken back.=Une fois placé, un œil d'ender ne peut pas être repris. Used to construct end portals=Utilisé pour construire des portails d'End -Loading terrain...=Chargement du terrain... diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr index 910b4867f..f3f835c39 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr @@ -13,4 +13,3 @@ Obsidian is also used as the frame of Nether portals.=Обсидиан такж To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Чтобы открыть портал Ада, постройте рамку из обсидиана шириной 4 блока и высотой 5, оставляя в центре лишь воздух. После создания обсидиановой рамки зажгите в ней огонь. Адские порталы работают только в Верхнем мире и в Аду. Once placed, an eye of ender can not be taken back.=Однажды размещённое, око Предела нельзя взять обратно. Used to construct end portals=Используется для создания порталов Предела -Loading terrain...=Местность подгружается... diff --git a/mods/ITEMS/mcl_portals/locale/template.txt b/mods/ITEMS/mcl_portals/locale/template.txt index 42c390237..d7c5a30f9 100644 --- a/mods/ITEMS/mcl_portals/locale/template.txt +++ b/mods/ITEMS/mcl_portals/locale/template.txt @@ -13,4 +13,3 @@ Obsidian is also used as the frame of Nether portals.= To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.= Once placed, an eye of ender can not be taken back.= Used to construct end portals= -Loading terrain...= diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index a9ec2af20..fa63e3a22 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -686,9 +686,6 @@ local function teleport_no_delay(obj, pos) local target = minetest.string_to_pos(meta:get_string("portal_target")) if delta_time > DESTINATION_EXPIRES or target == nil then -- Area not ready yet - retry after a second - if obj:is_player() then - minetest.chat_send_player(obj:get_player_name(), S("Loading terrain...")) - end return minetest.after(1, teleport_no_delay, obj, pos) end From 5f820c6bf9ce43d5c095ae447bc601d09f7e473a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 30 Sep 2020 17:31:19 +0200 Subject: [PATCH 149/152] Update helptext of obsidian --- mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr | 2 +- mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr | 5 ++++- mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr | 5 ++++- mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr | 5 ++++- mods/ITEMS/mcl_portals/locale/template.txt | 2 +- mods/ITEMS/mcl_portals/portal_nether.lua | 2 +- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr index 593403297..58478faa4 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.de.tr @@ -12,7 +12,7 @@ Nether Portal=Netherportal A Nether portal teleports creatures and objects to the hot and dangerous Nether dimension (and back!). Enter at your own risk!=Ein Netherportal teleportiert Kreaturen und Objekte zur heißen und gefährlichen Nether-Dimension (und zurück!). Betreten auf eigene Gefahr! Stand in the portal for a moment to activate the teleportation. Entering a Nether portal for the first time will also create a new portal in the other dimension. If a Nether portal has been built in the Nether, it will lead to the Overworld. A Nether portal is destroyed if the any of the obsidian which surrounds it is destroyed, or if it was caught in an explosion.=Stellen Sie sich ins Portal für einen Moment, um sich zu teleportieren. Beim ersten Mal wird auch ein Portal in der anderen Dimension erschaffen. Wenn ein Netherportal im Nether gebaut wird, wird es zurück zur Oberwelt führen. Ein Netherportal wird zerstört, wenn das Obsidian, das ihn umgibt, zerstört wird, oder, wenn es einer Explosion ausgesetzt war. Obsidian is also used as the frame of Nether portals.=Obsidian wird auch als Rahmen von Netherportalen benutzt. -To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Um ein Netherportal zu öffnen, platzieren Sie einen aufrechten Rahmen aus Obsidian mit einer Breite von 4 Blöcken und einer Höhe von 5 Blöcken, nur mit Luft in der Mitte. Nachdem Sie den Rahmen gebaut haben, entfachen Sie ein Feuer im Obsidianrahmen. Netherportale funktionieren nur in der Oberwelt und im Nether. +To open a Nether portal, place an upright frame of obsidian with a width of at least 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Um ein Netherportal zu öffnen, platzieren Sie einen aufrechten Rahmen aus Obsidian mit einer Breite von mindestens 4 Blöcken und einer Höhe von mindestens 5 Blöcken, nur mit Luft in der Mitte. Nachdem Sie den Rahmen gebaut haben, entfachen Sie ein Feuer im Obsidianrahmen. Netherportale funktionieren nur in der Oberwelt und im Nether. Once placed, an eye of ender can not be taken back.=Sobald platziert, kann ein Enderauge nicht mehr zurück genommen werden. Used to construct end portals=Benutzt zur Konstruktion von Endportalen Liquid container=Flüssigkeitsbehälter diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr index 9636f69c3..5f8509026 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.es.tr @@ -12,5 +12,8 @@ Nether Portal=Portal del Nether A Nether portal teleports creatures and objects to the hot and dangerous Nether dimension (and back!). Enter at your own risk!=Un portal Nether teletransporta criaturas y objetos a la dimensión Nether ardiente y peligrosa (¡y viceversa!). ¡Entra bajo tu propio riesgo! Stand in the portal for a moment to activate the teleportation. Entering a Nether portal for the first time will also create a new portal in the other dimension. If a Nether portal has been built in the Nether, it will lead to the Overworld. A Nether portal is destroyed if the any of the obsidian which surrounds it is destroyed, or if it was caught in an explosion.=SPárate en el portal por un momento para activar la teletransportación. Entrar en un portal Nether por primera vez también creará un nuevo portal en la otra dimensión. Si se ha construido un portal Nether en Nether, conducirá al Overworld. Un portal abisal se destruye si se destruye cualquiera de las obsidianas que lo rodean, o si quedó atrapado en una explosión. Obsidian is also used as the frame of Nether portals.=La obsidiana también se usa como marco de portal del End. -To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Para abrir un portal Nether, coloque un marco vertical de obsidiana con un ancho de 4 bloques y una altura de 5 bloques, dejando solo aire en el centro. Después de colocar este marco, enciende un fuego en el marco de obsidiana. Los portales de Nether solo funcionan en Overworld y Nether. +To open a Nether portal, place an upright frame of obsidian with a width of at least 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.= Once placed, an eye of ender can not be taken back.=Una vez colocado, un ojo de ender no puede ser retirado. + +#OUTDATED: +#To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Para abrir un portal Nether, coloque un marco vertical de obsidiana con un ancho de 4 bloques y una altura de 5 bloques, dejando solo aire en el centro. Después de colocar este marco, enciende un fuego en el marco de obsidiana. Los portales de Nether solo funcionan en Overworld y Nether. diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr index 76a2a6f82..b01b55353 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.fr.tr @@ -10,6 +10,9 @@ Nether Portal=Portail du Nether A Nether portal teleports creatures and objects to the hot and dangerous Nether dimension (and back!). Enter at your own risk!=A Nether portal teleports creatures and objects to the hot and dangerous Nether dimension (and back!). Enter at your own risk! Stand in the portal for a moment to activate the teleportation. Entering a Nether portal for the first time will also create a new portal in the other dimension. If a Nether portal has been built in the Nether, it will lead to the Overworld. A Nether portal is destroyed if the any of the obsidian which surrounds it is destroyed, or if it was caught in an explosion.=Tenez-vous un instant dans le portail pour activer la téléportation. Entrer pour la première fois sur un portail Nether créera également un nouveau portail dans l'autre dimension. Si un portail du Nether a été construit dans le Nether, il mènera à l'Overworld. Un portail du Nether est détruit si l'une des obsidiennes qui l'entourent est détruit, ou s'il a été pris dans une explosion. Obsidian is also used as the frame of Nether portals.=Obsidian is also used as the frame of Nether portals. -To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Pour ouvrir un portail du Nether, placez un cadre vertical d'obsidienne d'une largeur de 4 blocs et d'une hauteur de 5 blocs, ne laissant que de l'air au centre. Après avoir placé ce cadre, allumez un feu dans le cadre en obsidienne. Les portails du Nether ne fonctionnent que dans l'Overworld et le Nether. +To open a Nether portal, place an upright frame of obsidian with a width of at least 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.= Once placed, an eye of ender can not be taken back.=Une fois placé, un œil d'ender ne peut pas être repris. Used to construct end portals=Utilisé pour construire des portails d'End + +# OUTDATED: +#To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Pour ouvrir un portail du Nether, placez un cadre vertical d'obsidienne d'une largeur de 4 blocs et d'une hauteur de 5 blocs, ne laissant que de l'air au centre. Après avoir placé ce cadre, allumez un feu dans le cadre en obsidienne. Les portails du Nether ne fonctionnent que dans l'Overworld et le Nether. diff --git a/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr b/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr index f3f835c39..ddf3c24f9 100644 --- a/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr +++ b/mods/ITEMS/mcl_portals/locale/mcl_portals.ru.tr @@ -10,6 +10,9 @@ Nether Portal=Адский портал A Nether portal teleports creatures and objects to the hot and dangerous Nether dimension (and back!). Enter at your own risk!=Адский портал переносит создания и объекты в горячее и опасное измерение Ад (и обратно!). Используйте на свой страх и риск! Stand in the portal for a moment to activate the teleportation. Entering a Nether portal for the first time will also create a new portal in the other dimension. If a Nether portal has been built in the Nether, it will lead to the Overworld. A Nether portal is destroyed if the any of the obsidian which surrounds it is destroyed, or if it was caught in an explosion.=Стойте в портале несколько секунд для запуска телепортации. Вход в портал Ада в первый раз приведёт к созданию аналогичного портала в другом измерении. Если Адский портал создан в Аду, он ведёт в Верхний мир. Портал Ада уничтожается, если уничтожается любой блок обсидиана из окружающих его, либо при задевании взрывом. Obsidian is also used as the frame of Nether portals.=Обсидиан также используется в качестве рамки портала Ада -To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Чтобы открыть портал Ада, постройте рамку из обсидиана шириной 4 блока и высотой 5, оставляя в центре лишь воздух. После создания обсидиановой рамки зажгите в ней огонь. Адские порталы работают только в Верхнем мире и в Аду. +To open a Nether portal, place an upright frame of obsidian with a width of at least 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.= Once placed, an eye of ender can not be taken back.=Однажды размещённое, око Предела нельзя взять обратно. Used to construct end portals=Используется для создания порталов Предела + +# OUTDATED: +#To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.=Чтобы открыть портал Ада, постройте рамку из обсидиана шириной 4 блока и высотой 5, оставляя в центре лишь воздух. После создания обсидиановой рамки зажгите в ней огонь. Адские порталы работают только в Верхнем мире и в Аду. diff --git a/mods/ITEMS/mcl_portals/locale/template.txt b/mods/ITEMS/mcl_portals/locale/template.txt index d7c5a30f9..21f5e21f8 100644 --- a/mods/ITEMS/mcl_portals/locale/template.txt +++ b/mods/ITEMS/mcl_portals/locale/template.txt @@ -10,6 +10,6 @@ Nether Portal= A Nether portal teleports creatures and objects to the hot and dangerous Nether dimension (and back!). Enter at your own risk!= Stand in the portal for a moment to activate the teleportation. Entering a Nether portal for the first time will also create a new portal in the other dimension. If a Nether portal has been built in the Nether, it will lead to the Overworld. A Nether portal is destroyed if the any of the obsidian which surrounds it is destroyed, or if it was caught in an explosion.= Obsidian is also used as the frame of Nether portals.= -To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.= +To open a Nether portal, place an upright frame of obsidian with a width of at least 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.= Once placed, an eye of ender can not be taken back.= Used to construct end portals= diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index fa63e3a22..e7f696440 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -825,7 +825,7 @@ minetest.register_abm({ local longdesc = minetest.registered_nodes["mcl_core:obsidian"]._doc_items_longdesc longdesc = longdesc .. "\n" .. S("Obsidian is also used as the frame of Nether portals.") -local usagehelp = S("To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.") +local usagehelp = S("To open a Nether portal, place an upright frame of obsidian with a width of at least 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether.") minetest.override_item("mcl_core:obsidian", { _doc_items_longdesc = longdesc, From a78c61332203daee3870aa73c0f05c480b646e66 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 5 Oct 2020 00:27:08 +0400 Subject: [PATCH 150/152] Fix slimeblock/piston behavior, https://github.com/kay27/MineClone2/issues/4 --- mods/ITEMS/REDSTONE/mesecons_mvps/init.lua | 8 +++++--- mods/ITEMS/mcl_core/nodes_misc.lua | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua index 9eaceb88d..20f280a4b 100644 --- a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua @@ -120,11 +120,13 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky) while #frontiers > 0 do local np = frontiers[1] local nn = minetest.get_node(np) - + if nn.name == "ignore" then + minetest.get_voxel_manip():read_from_map(np, np) + nn = minetest.get_node(np) + end if not node_replaceable(nn.name) then - + if #nodes >= maximum then return nil end table.insert(nodes, {node = nn, pos = np}) - if #nodes > maximum then return nil end -- add connected nodes to frontiers, connected is a vector list -- the vectors must be absolute positions diff --git a/mods/ITEMS/mcl_core/nodes_misc.lua b/mods/ITEMS/mcl_core/nodes_misc.lua index ca97c2aa6..f9ede7718 100644 --- a/mods/ITEMS/mcl_core/nodes_misc.lua +++ b/mods/ITEMS/mcl_core/nodes_misc.lua @@ -52,6 +52,16 @@ minetest.register_node("mcl_core:slimeblock", { }, _mcl_blast_resistance = 0, _mcl_hardness = 0, + mvps_sticky = function (pos, node) + local connected = {} + if mesecon.rules.alldirs then + for _, r in ipairs(mesecon.rules.alldirs) do + table.insert(connected, vector.add(pos, r)) + end + end + return connected + end, + }) minetest.register_node("mcl_core:cobweb", { From d1807b584442bbd65f71ffe239f61ddc62aef032 Mon Sep 17 00:00:00 2001 From: kay27 Date: Thu, 8 Oct 2020 21:51:07 +0400 Subject: [PATCH 151/152] Remove double on_placenode() for push/pull, see https://git.minetest.land/Wuzzy/MineClone2/src/branch/master/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua#L371 --- mods/ITEMS/REDSTONE/mesecons_mvps/init.lua | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua index 20f280a4b..afdc744a8 100644 --- a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua @@ -274,12 +274,6 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti return true, nodes, oldstack end -mesecon.register_on_mvps_move(function(moved_nodes) - for _, n in ipairs(moved_nodes) do - mesecon.on_placenode(n.pos, n.node) - end -end) - function mesecon.mvps_move_objects(pos, dir, nodestack) local objects_to_move = {} From f0afebea387d6972d0f3820ea44913b6fbbe4f7c Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 9 Oct 2020 02:09:00 +0400 Subject: [PATCH 152/152] Remove double vector addition for piston pull/push - fix on_placenode() coordinates --- mods/ITEMS/REDSTONE/mesecons_mvps/init.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua index afdc744a8..8319ce210 100644 --- a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua @@ -248,13 +248,6 @@ function mesecon.mvps_push_or_pull(pos, stackdir, movedir, maximum, all_pull_sti minetest.get_meta(np):from_table(n.meta) end - for i in ipairs(nodes) do - if first_dropper and i >= first_dropper then - break - end - nodes[i].pos = vector.add(nodes[i].pos, movedir) - end - local moved_nodes = {} local oldstack = mesecon.tablecopy(nodes) for i in ipairs(nodes) do