From a41e0628e5e1330af475f51ba09700cc7491fc0c Mon Sep 17 00:00:00 2001 From: kay27 Date: Thu, 21 Jan 2021 12:36:33 +0400 Subject: [PATCH 1/5] Fix https://git.minetest.land/Wuzzy/MineClone2/issues/994 Crash 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 7fee798bc..61976d760 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -393,7 +393,7 @@ local is_node_dangerous = function(self, nodename) return true end end - if minetest.registered_nodes[nn].damage_per_second > 0 then + if minetest.registered_nodes[nn].damage_per_second and minetest.registered_nodes[nn].damage_per_second > 0 then return true end return false From c4dce1df25dcb7b232884af084409401352f24bb Mon Sep 17 00:00:00 2001 From: kay27 Date: Thu, 21 Jan 2021 18:35:04 +0400 Subject: [PATCH 2/5] Fix already created End portals --- mods/ITEMS/mcl_portals/portal_end.lua | 56 +++++++++++++++++---------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index ce8aa774c..5919ef213 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -22,18 +22,18 @@ local destroy_portal = function(pos) end local ep_scheme = { - { o={x=0, y=0, z=1}, p=3 }, - { o={x=0, y=0, z=2}, p=3 }, - { o={x=0, y=0, z=3}, p=3 }, - { o={x=1, y=0, z=4}, p=0 }, - { o={x=2, y=0, z=4}, p=0 }, - { o={x=3, y=0, z=4}, p=0 }, - { o={x=4, y=0, z=3}, p=1 }, - { o={x=4, y=0, z=2}, p=1 }, - { o={x=4, y=0, z=1}, p=1 }, - { o={x=3, y=0, z=0}, p=2 }, - { o={x=2, y=0, z=0}, p=2 }, - { o={x=1, y=0, z=0}, p=2 }, + { o={x=0, y=0, z=1}, p=1 }, + { o={x=0, y=0, z=2}, p=1 }, + { o={x=0, y=0, z=3}, p=1 }, + { o={x=1, y=0, z=4}, p=2 }, + { o={x=2, y=0, z=4}, p=2 }, + { o={x=3, y=0, z=4}, p=2 }, + { o={x=4, y=0, z=3}, p=3 }, + { o={x=4, y=0, z=2}, p=3 }, + { o={x=4, y=0, z=1}, p=3 }, + { o={x=3, y=0, z=0}, p=0 }, + { o={x=2, y=0, z=0}, p=0 }, + { o={x=1, y=0, z=0}, p=0 }, } -- End portal @@ -255,6 +255,21 @@ if minetest.get_modpath("screwdriver") then rotate_frame_eye = false end +local function after_place_node(pos, placer, itemstack, pointed_thing) + local node = minetest.get_node(pos) + if node then + node.param2 = (node.param2+2) % 4 + minetest.swap_node(pos, node) + + local ok, ppos = check_end_portal_frame(pos) + if ok then + -- Epic 'portal open' sound effect that can be heard everywhere + minetest.sound_play("mcl_portals_open_end_portal", {gain=0.8}, true) + end_portal_area(ppos) + end + end +end + minetest.register_node("mcl_portals:end_portal_frame", { description = S("End Portal Frame"), _tt_help = S("Used to construct end portals"), @@ -276,6 +291,8 @@ minetest.register_node("mcl_portals:end_portal_frame", { on_rotate = rotate_frame, + after_place_node = after_place_node, + _mcl_blast_resistance = 36000000, _mcl_hardness = -1, }) @@ -306,17 +323,11 @@ minetest.register_node("mcl_portals:end_portal_frame_eye", { end_portal_area(ppos, true) end end, - on_construct = function(pos) - local ok, ppos = check_end_portal_frame(pos) - if ok then - -- Epic 'portal open' sound effect that can be heard everywhere - minetest.sound_play("mcl_portals_open_end_portal", {gain=0.8}, true) - end_portal_area(ppos) - end - end, on_rotate = rotate_frame_eye, + after_place_node = after_place_node, + _mcl_blast_resistance = 36000000, _mcl_hardness = -1, }) @@ -358,8 +369,11 @@ minetest.override_item("mcl_end:ender_eye", { itemstack:take_item() -- 1 use end - local ok = check_end_portal_frame(pointed_thing.under) + local ok, ppos = check_end_portal_frame(pointed_thing.under) if ok then + -- Epic 'portal open' sound effect that can be heard everywhere + minetest.sound_play("mcl_portals_open_end_portal", {gain=0.8}, true) + end_portal_area(ppos) if minetest.get_modpath("doc") then doc.mark_entry_as_revealed(user:get_player_name(), "nodes", "mcl_portals:portal_end") end From 689e6edac29f1c200aabf5a2ec9df37e3cc8f4e1 Mon Sep 17 00:00:00 2001 From: MysticTempest Date: Fri, 22 Jan 2021 03:07:21 -0600 Subject: [PATCH 3/5] Make 'mcl_burning' support other texture packs. --- mods/ENTITIES/mcl_burning/engine.lua | 5 +++-- .../mcl_burning_entity_flame_animated.png | Bin 0 -> 762 bytes .../textures/mcl_burning_hud_flame_animated.png | Bin 0 -> 762 bytes tools/Conversion_Table.csv | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 mods/ITEMS/mcl_fire/textures/mcl_burning_entity_flame_animated.png create mode 100644 mods/ITEMS/mcl_fire/textures/mcl_burning_hud_flame_animated.png diff --git a/mods/ENTITIES/mcl_burning/engine.lua b/mods/ENTITIES/mcl_burning/engine.lua index 1c9f4f565..d8ec8b841 100644 --- a/mods/ENTITIES/mcl_burning/engine.lua +++ b/mods/ENTITIES/mcl_burning/engine.lua @@ -240,11 +240,12 @@ function mcl_burning.tick(obj, dtime) end function mcl_burning.update_animation_frame(obj, fire_entity, animation_frame) - local fire_texture = "fire_basic_flame_animated.png^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. animation_frame + local fire_texture = "mcl_burning_entity_flame_animated.png^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. animation_frame + local fire_HUD_texture = "mcl_burning_hud_flame_animated.png^[opacity:180^[verticalframe:" .. mcl_burning.animation_frames .. ":" .. animation_frame fire_entity:set_properties({textures = {"blank.png", "blank.png", fire_texture, fire_texture, fire_texture, fire_texture}}) if obj:is_player() then local hud_id = mcl_burning.get(obj, "int", "hud_id") - 1 - obj:hud_change(hud_id, "text", fire_texture) + obj:hud_change(hud_id, "text", fire_HUD_texture) end end diff --git a/mods/ITEMS/mcl_fire/textures/mcl_burning_entity_flame_animated.png b/mods/ITEMS/mcl_fire/textures/mcl_burning_entity_flame_animated.png new file mode 100644 index 0000000000000000000000000000000000000000..434bdffddb392c8f3a47674a1fc73d6fe6a3a82c GIT binary patch literal 762 zcmVvdp1vf+Kb81m*hIUv4tzmkxd!_mpi zljNMpOcjU^%S#fT+9%P;F;j%#U#e&8V??8cRszxc%%~o*;A~s92puzBv4&hT5!SJf z;38aiG;+hH6CD7*af!xR$Qk167vjSN1_eI7DwhBI;2|XaPX*FusI(4Bo1wX;IfDAW zp&aoIduWJAv4?6&u9XP&*yCf5h?~E9CNyL~7W^`JM zd&EP`>ZvE)R%1`qnvL5}YwmdSPsRjz_tt*qFW7VH_5(ixz!6KxeAfdkC>_F}d_)8# ztAOJ>o1CeHA#|M9RAUdLz8QP?f|*T>J+a{C4)N!i!sdHeeRmi#X|bO}wv-kGps*Q{ zhY>G0l)!2?^#F57a^s*f1!ws3y=I&I5z#ZILz94T>t<8 literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_fire/textures/mcl_burning_hud_flame_animated.png b/mods/ITEMS/mcl_fire/textures/mcl_burning_hud_flame_animated.png new file mode 100644 index 0000000000000000000000000000000000000000..434bdffddb392c8f3a47674a1fc73d6fe6a3a82c GIT binary patch literal 762 zcmVvdp1vf+Kb81m*hIUv4tzmkxd!_mpi zljNMpOcjU^%S#fT+9%P;F;j%#U#e&8V??8cRszxc%%~o*;A~s92puzBv4&hT5!SJf z;38aiG;+hH6CD7*af!xR$Qk167vjSN1_eI7DwhBI;2|XaPX*FusI(4Bo1wX;IfDAW zp&aoIduWJAv4?6&u9XP&*yCf5h?~E9CNyL~7W^`JM zd&EP`>ZvE)R%1`qnvL5}YwmdSPsRjz_tt*qFW7VH_5(ixz!6KxeAfdkC>_F}d_)8# ztAOJ>o1CeHA#|M9RAUdLz8QP?f|*T>J+a{C4)N!i!sdHeeRmi#X|bO}wv-kGps*Q{ zhY>G0l)!2?^#F57a^s*f1!ws3y=I&I5z#ZILz94T>t<8 literal 0 HcmV?d00001 diff --git a/tools/Conversion_Table.csv b/tools/Conversion_Table.csv index 0a931f04b..9f5a247ef 100644 --- a/tools/Conversion_Table.csv +++ b/tools/Conversion_Table.csv @@ -388,6 +388,8 @@ Source path,Source file,Target path,Target file,xs,ys,xl,yl,xt,yt,Blacklisted? /assets/minecraft/textures/blocks,wheat_stage_6.png,/mods/ITEMS/mcl_farming/textures,mcl_farming_wheat_stage_6.png,,,,,,, /assets/minecraft/textures/blocks,wheat_stage_7.png,/mods/ITEMS/mcl_farming/textures,mcl_farming_wheat_stage_7.png,,,,,,, /assets/minecraft/textures/blocks,fire_layer_0.png,/mods/ITEMS/mcl_fire/textures,fire_basic_flame_animated.png,,,,,,, +/assets/minecraft/textures/blocks,fire_layer_0.png,/mods/ITEMS/mcl_fire/textures,mcl_burning_entity_flame_animated.png,,,,,,, +/assets/minecraft/textures/blocks,fire_layer_0.png,/mods/ITEMS/mcl_fire/textures,mcl_burning_hud_flame_animated.png,,,,,,, /assets/minecraft/textures/blocks,fire_layer_0.png,/mods/ITEMS/mcl_fire/textures,fire_basic_flame.png,0,0,16,16,0,0,y /assets/minecraft/textures/items,fireball.png,/mods/ITEMS/mcl_fire/textures,mcl_fire_fire_charge.png,,,,,,, /assets/minecraft/textures/items,flint_and_steel.png,/mods/ITEMS/mcl_fire/textures,mcl_fire_flint_and_steel.png,,,,,,, From 2e898b31130b2f91b64cb37265316333dd5a88fc Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 22 Jan 2021 20:01:55 +0400 Subject: [PATCH 4/5] Decrease player burn time in Creative mode --- mods/ENTITIES/mcl_burning/engine.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ENTITIES/mcl_burning/engine.lua b/mods/ENTITIES/mcl_burning/engine.lua index d8ec8b841..9e1491571 100644 --- a/mods/ENTITIES/mcl_burning/engine.lua +++ b/mods/ENTITIES/mcl_burning/engine.lua @@ -124,6 +124,10 @@ function mcl_burning.set_on_fire(obj, burn_time, damage, reason) local max_fire_prot_lvl = 0 if obj:is_player() then + if minetest.is_creative_enabled(obj:get_player_name()) then + burn_time = burn_time / 100 + end + local inv = obj:get_inventory() for i = 2, 5 do From c9294a4d8a32c430adc0a87d8707fdfc9f6ad8c2 Mon Sep 17 00:00:00 2001 From: kay27 Date: Fri, 22 Jan 2021 21:42:37 +0400 Subject: [PATCH 5/5] Fix https://git.minetest.land/Wuzzy/MineClone2/issues/996 Coordinate exploit in signs and chests, sent by @cora --- mods/ITEMS/mcl_chests/init.lua | 34 ++++++++++++++++------------------ mods/ITEMS/mcl_signs/init.lua | 4 +++- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 492abf787..c3b3df780 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -360,6 +360,15 @@ minetest.register_node("mcl_chests:"..basename, { end, }) +local function close_forms(canonical_basename, pos) + local players = minetest.get_connected_players() + for p=1, #players do + if vector.distance(players[p]:get_pos(), pos) <= 30 then + minetest.close_formspec(players[p]:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z) + end + end +end + minetest.register_node(small_name, { description = desc, _tt_help = tt_help, @@ -483,10 +492,7 @@ minetest.register_node(small_name, { end, on_destruct = function(pos) - local players = minetest.get_connected_players() - for p=1, #players do - minetest.close_formspec(players[p]:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z) - end + close_forms(canonical_basename, pos) end, mesecons = mesecons, on_rotate = simple_rotate, @@ -527,19 +533,15 @@ minetest.register_node(left_name, { return end - local players = minetest.get_connected_players() - for p=1, #players do - minetest.close_formspec(players[p]:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z) - end + close_forms(canonical_basename, pos) local param2 = n.param2 local p = mcl_util.get_double_container_neighbor_pos(pos, param2, "left") if not p or minetest.get_node(p).name ~= "mcl_chests:"..basename.."_right" then return end - for pl=1, #players do - minetest.close_formspec(players[pl]:get_player_name(), "mcl_chests:"..canonical_basename.."_"..p.x.."_"..p.y.."_"..p.z) - end + close_forms(canonical_basename, p) + minetest.swap_node(p, { name = small_name, param2 = param2 }) create_entity(p, small_name, small_textures, param2, false, "default_chest", "mcl_chests_chest") end, @@ -678,19 +680,15 @@ minetest.register_node("mcl_chests:"..basename.."_right", { return end - local players = minetest.get_connected_players() - for p=1, #players do - minetest.close_formspec(players[p]:get_player_name(), "mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z) - end + close_forms(canonical_basename, pos) local param2 = n.param2 local p = mcl_util.get_double_container_neighbor_pos(pos, param2, "right") if not p or minetest.get_node(p).name ~= "mcl_chests:"..basename.."_left" then return end - for pl=1, #players do - minetest.close_formspec(players[pl]:get_player_name(), "mcl_chests:"..canonical_basename.."_"..p.x.."_"..p.y.."_"..p.z) - end + close_forms(canonical_basename, p) + minetest.swap_node(p, { name = small_name, param2 = param2 }) create_entity(p, small_name, small_textures, param2, false, "default_chest", "mcl_chests_chest") local meta = minetest.get_meta(pos) diff --git a/mods/ITEMS/mcl_signs/init.lua b/mods/ITEMS/mcl_signs/init.lua index 441fcbb4c..d21b58242 100644 --- a/mods/ITEMS/mcl_signs/init.lua +++ b/mods/ITEMS/mcl_signs/init.lua @@ -197,7 +197,9 @@ local destruct_sign = function(pos) end local players = minetest.get_connected_players() for p=1, #players do - minetest.close_formspec(players[p]:get_player_name(), "mcl_signs:set_text_"..pos.x.."_"..pos.y.."_"..pos.z) + if vector.distance(players[p]:get_pos(), pos) <= 30 then + minetest.close_formspec(players[p]:get_player_name(), "mcl_signs:set_text_"..pos.x.."_"..pos.y.."_"..pos.z) + end end end