From 7ce64857178eb4387ba075247606f750bf27d4d7 Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Sun, 14 Mar 2021 20:10:12 +0800 Subject: [PATCH 1/7] Allow portals to break only in creative and to be pointed. --- mods/ITEMS/mcl_portals/portal_nether.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 7e23a9f7bf..d8efc1067a 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -64,7 +64,7 @@ local function destroy_nether_portal(pos) local meta = minetest.get_meta(pos) local node = minetest.get_node(pos) local nn, orientation = node.name, node.param2 - local obsidian = nn == "mcl_core:obsidian" + local obsidian = nn == "mcl_core:obsidian" local has_meta = minetest.string_to_pos(meta:get_string("portal_frame1")) if has_meta then @@ -138,8 +138,6 @@ minetest.register_node("mcl_portals:portal", { sunlight_propagates = true, use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "blend" or true, walkable = false, - diggable = false, - pointable = false, buildable_to = false, is_ground_content = false, drop = "", @@ -152,7 +150,7 @@ minetest.register_node("mcl_portals:portal", { {-0.5, -0.5, -0.1, 0.5, 0.5, 0.1}, }, }, - groups = {portal=1, not_in_creative_inventory = 1}, + groups = { creative_breakable = 1, portal = 1, not_in_creative_inventory = 1 }, on_destruct = destroy_nether_portal, _mcl_hardness = -1, @@ -583,7 +581,7 @@ local function check_and_light_shape(pos, orientation) meta:set_string("portal_time", tostring(0)) meta:set_string("portal_target", "") end - return true + return true end -- Attempts to light a Nether portal at pos @@ -842,7 +840,7 @@ minetest.override_item("mcl_core:obsidian", { _on_ignite = function(user, pointed_thing) 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 = + 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}) @@ -863,4 +861,3 @@ minetest.override_item("mcl_core:obsidian", { end end, }) - From 1b003467904564e41d8d71a938ce2479c77fb02d Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Sun, 14 Mar 2021 20:39:10 +0800 Subject: [PATCH 2/7] Add breaking sounds. --- mods/ITEMS/mcl_portals/portal_nether.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index d8efc1067a..32a24e092a 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -151,6 +151,7 @@ minetest.register_node("mcl_portals:portal", { }, }, groups = { creative_breakable = 1, portal = 1, not_in_creative_inventory = 1 }, + sounds = mcl_sounds.node_sound_glass_defaults(), on_destruct = destroy_nether_portal, _mcl_hardness = -1, From b23495b9c1fbd7015df141c67f0367714bcc571f Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Mon, 15 Mar 2021 02:57:13 +0800 Subject: [PATCH 3/7] Implement new fire particles --- mods/ITEMS/mcl_fire/init.lua | 65 ++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index 50303e3b2b..68e16bb231 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -28,7 +28,70 @@ local alldirs= { x = 0, y = 0, z = 1} } +-- 3 exptime variants because the animation is not tied to particle expiration time. +local smoke_pdef_base = { + amount = 0.5, + 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.1, z = 0 }, + maxvel = { x = 0, y = 1.4, z = 0 }, + -- minexptime = ???, + -- maxexptime = ???, + minsize = 4.0, + maxsize = 5.0, + -- texture = "mcl_particles_smoke_anim.png^[colorize:#000000:???", + animation = { + type = "vertical_frames", + aspect_w = 8, + aspect_h = 8, + -- length = ???, + }, + collisiondetection = true, +} +local smoke_pdef_cached = {} local spawn_smoke = function(pos) + local min = math.min + local new_minpos = vector.add(pos, { x = -0.45, y = -0.45, z = -0.45 }) + local new_maxpos = vector.add(pos, { x = 0.45, y = 0.45, z = 0.45 }) + + -- populate the cache + if not next(smoke_pdef_cached) then + -- the last frame plays for 1/8 * N seconds, so we can take advantage of it + -- to have varying exptime for each variant. + local exptimes = { 1.0, 3.0, 5.0 } + local colorizes = { "178", "204", "243" } + + local id = 1 + for _,exptime in ipairs(exptimes) do + for _,colorize in ipairs(colorizes) do + smoke_pdef_base.minpos = new_minpos + smoke_pdef_base.maxpos = new_maxpos + smoke_pdef_base.maxexptime = exptime + smoke_pdef_base.animation.length = exptime + 0.1 + smoke_pdef_base.minexptime = min(exptime, (7.0/8.0 * (exptime + 0.1) + 0.1)) + smoke_pdef_base.texture = "mcl_particles_smoke_anim.png^[colorize:#000000:" ..colorize + + smoke_pdef_cached[id] = table.copy(smoke_pdef_base) + + mcl_particles.add_node_particlespawner(pos, smoke_pdef_cached[id], "high") + + id = id + 1 + end + end + + + -- cache already populated + else + for i, smoke_pdef in ipairs(smoke_pdef_cached) do + smoke_pdef.minpos = new_minpos + smoke_pdef.maxpos = new_maxpos + mcl_particles.add_node_particlespawner(pos, smoke_pdef, "low") + end + end + +--[[ Old smoke pdef + local spawn_smoke = function(pos) mcl_particles.add_node_particlespawner(pos, { amount = 0.1, time = 0, @@ -48,6 +111,8 @@ local spawn_smoke = function(pos) length = 2.1, }, }, "high") + -- ]] + end -- From 39c357672ce05ef739776d4b246c156f64d51d29 Mon Sep 17 00:00:00 2001 From: epCode Date: Sun, 14 Mar 2021 17:13:23 -0700 Subject: [PATCH 4/7] Add cammera zoom effect while drawing bow --- mods/PLAYER/mcl_sprint/init.lua | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/mods/PLAYER/mcl_sprint/init.lua b/mods/PLAYER/mcl_sprint/init.lua index f3ea42f2cf..9dc678000c 100644 --- a/mods/PLAYER/mcl_sprint/init.lua +++ b/mods/PLAYER/mcl_sprint/init.lua @@ -50,16 +50,27 @@ end local function setSprinting(playerName, sprinting) --Sets the state of a player (0=stopped/moving, 1=sprinting) local player = minetest.get_player_by_name(playerName) + local controls = player:get_player_control() if players[playerName] then players[playerName].sprinting = sprinting - if sprinting == true then - players[playerName].fov = math.min(players[playerName].fov + 0.05, 1.2) - player:set_fov(players[playerName].fov, true, 0.15) - playerphysics.add_physics_factor(player, "speed", "mcl_sprint:sprint", mcl_sprint.SPEED) - elseif sprinting == false then + if sprinting == true or controls.RMB and string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and player:get_wielded_item():get_name() ~= "mcl_bows:bow" then + if sprinting == true then + players[playerName].fov = math.min(players[playerName].fov + 0.05, 1.2) + players[playerName].fade_time = .15 + else + players[playerName].fov = .7 + players[playerName].fade_time = .3 + end + player:set_fov(players[playerName].fov, true, players[playerName].fade_time) + if sprinting == true then + playerphysics.add_physics_factor(player, "speed", "mcl_sprint:sprint", mcl_sprint.SPEED) + end + elseif sprinting == false and player:get_wielded_item():get_name() ~= "mcl_bows:bow_0" and player:get_wielded_item():get_name() ~= "mcl_bows:bow_1" and player:get_wielded_item():get_name() ~= "mcl_bows:bow_2" then players[playerName].fov = math.max(players[playerName].fov - 0.05, 1.0) player:set_fov(players[playerName].fov, true, 0.15) - playerphysics.remove_physics_factor(player, "speed", "mcl_sprint:sprint") + if sprinting == false then + playerphysics.remove_physics_factor(player, "speed", "mcl_sprint:sprint") + end end return true end From 8519730ee4e818bc5aff79594af38421d455a1d9 Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Mon, 15 Mar 2021 10:04:47 +0800 Subject: [PATCH 5/7] Further tweak fire particles. Highlights: - Reduce amount of smoke significantly - Reduced smoke size - Rarer chance of smoke rising up to 8 blocks - Better smoke colors --- mods/ITEMS/mcl_fire/init.lua | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index 68e16bb231..1be1da635c 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -29,23 +29,24 @@ local alldirs= } -- 3 exptime variants because the animation is not tied to particle expiration time. +-- 3 colorized variants to imitate minecraft's local smoke_pdef_base = { - amount = 0.5, + amount = 0.001, 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.1, z = 0 }, - maxvel = { x = 0, y = 1.4, z = 0 }, - -- minexptime = ???, - -- maxexptime = ???, + minvel = { x = -0.1, y = 0.3, z = -0.1 }, + maxvel = { x = 0.1, y = 1.6, z = 0.1 }, + -- minexptime = 3 exptime variants, + -- maxexptime = 3 exptime variants minsize = 4.0, - maxsize = 5.0, - -- texture = "mcl_particles_smoke_anim.png^[colorize:#000000:???", + maxsize = 4.5, + -- texture = "mcl_particles_smoke_anim.png^[colorize:#000000:(3 colourize variants)", animation = { type = "vertical_frames", aspect_w = 8, aspect_h = 8, - -- length = ???, + -- length = 3 exptime variants }, collisiondetection = true, } @@ -59,8 +60,8 @@ local spawn_smoke = function(pos) if not next(smoke_pdef_cached) then -- the last frame plays for 1/8 * N seconds, so we can take advantage of it -- to have varying exptime for each variant. - local exptimes = { 1.0, 3.0, 5.0 } - local colorizes = { "178", "204", "243" } + local exptimes = { 0.75, 1.5, 4.0 } + local colorizes = { "199", "209", "243" } -- round(78%, 82%, 90% of 256) - 1 local id = 1 for _,exptime in ipairs(exptimes) do @@ -69,6 +70,8 @@ local spawn_smoke = function(pos) smoke_pdef_base.maxpos = new_maxpos smoke_pdef_base.maxexptime = exptime smoke_pdef_base.animation.length = exptime + 0.1 + -- minexptime must be set such that the last frame is actully rendered, + -- even if its very short. Larger exptime -> larger range smoke_pdef_base.minexptime = min(exptime, (7.0/8.0 * (exptime + 0.1) + 0.1)) smoke_pdef_base.texture = "mcl_particles_smoke_anim.png^[colorize:#000000:" ..colorize @@ -80,7 +83,6 @@ local spawn_smoke = function(pos) end end - -- cache already populated else for i, smoke_pdef in ipairs(smoke_pdef_cached) do From c30e9e511dde2c21f90c153aa819aa2a6a34cdf9 Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Mon, 15 Mar 2021 10:09:56 +0800 Subject: [PATCH 6/7] Fix inconsistent setting for cached smoke pdef --- 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 1be1da635c..6d8536fecd 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -88,7 +88,7 @@ local spawn_smoke = function(pos) for i, smoke_pdef in ipairs(smoke_pdef_cached) do smoke_pdef.minpos = new_minpos smoke_pdef.maxpos = new_maxpos - mcl_particles.add_node_particlespawner(pos, smoke_pdef, "low") + mcl_particles.add_node_particlespawner(pos, smoke_pdef, "high") end end From 19e5670e85afad31d012e3dd0dc1a5e5ec4a7b9e Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Mon, 15 Mar 2021 09:23:47 +0100 Subject: [PATCH 7/7] Revert liquid_interval setting to default --- minetest.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/minetest.conf b/minetest.conf index d63436c415..7e1ca9cd86 100644 --- a/minetest.conf +++ b/minetest.conf @@ -34,7 +34,6 @@ keepInventory = false # Performance settings dedicated_server_step = 0.001 -liquid_update = 0.25 abm_interval = 0.25 max_objects_per_block = 4096 max_packets_per_iteration = 10096