From 327bb68927c1a96c4eb491e36605cb40a969ff1b Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 19 Mar 2021 12:03:32 +0100 Subject: [PATCH 01/12] Fix crystal on_place handler --- mods/ITEMS/mcl_end/end_crystal.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_end/end_crystal.lua b/mods/ITEMS/mcl_end/end_crystal.lua index 8686f1de0..b6b9fdd6a 100644 --- a/mods/ITEMS/mcl_end/end_crystal.lua +++ b/mods/ITEMS/mcl_end/end_crystal.lua @@ -85,14 +85,15 @@ minetest.register_craftitem("mcl_end:crystal", { on_place = function(itemstack, placer, pointed_thing) if pointed_thing.type == "node" then local pos = minetest.get_pointed_thing_position(pointed_thing) - local node = minetest.get_node(pos).name + local node = minetest.get_node(pos) + local node_name = node.name if placer and not placer: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, placer, itemstack) or itemstack + 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, placer, itemstack) or itemstack end end if find_crystal(pos) then return itemstack end - if node == "mcl_core:obsidian" or node == "mcl_core:bedrock" then + if node_name == "mcl_core:obsidian" or node_name == "mcl_core:bedrock" then if not minetest.is_creative_enabled(placer:get_player_name()) then itemstack:take_item() end From 9391628813e219fd9d591e3f037be2cd80e096eb Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 19 Mar 2021 12:41:03 +0100 Subject: [PATCH 02/12] Fix wielded nodes being upside down --- mods/PLAYER/wieldview/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/PLAYER/wieldview/init.lua b/mods/PLAYER/wieldview/init.lua index a170f7870..6c0f08569 100644 --- a/mods/PLAYER/wieldview/init.lua +++ b/mods/PLAYER/wieldview/init.lua @@ -72,7 +72,7 @@ minetest.register_on_joinplayer(function(player) minetest.after(0, function(player) wieldview:update_wielded_item(player) local itementity = minetest.add_entity(player:get_pos(), "wieldview:wieldnode") - itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(-90, 0, 45)) + itementity:set_attach(player, "Hand_Right", vector.new(0, 1, 0), vector.new(90, 0, 45)) itementity:get_luaentity().wielder = name end, player) end) From 67cedf1308b30c4fd3832eefa827288d62f002e4 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 19 Mar 2021 14:32:02 +0100 Subject: [PATCH 03/12] Fix villager visual_size (Closes #1338) --- mods/ENTITIES/mobs_mc/villager.lua | 2 +- mods/ENTITIES/mobs_mc/villager_evoker.lua | 2 +- mods/ENTITIES/mobs_mc/villager_illusioner.lua | 2 +- mods/ENTITIES/mobs_mc/villager_vindicator.lua | 2 +- mods/ENTITIES/mobs_mc/villager_zombie.lua | 2 +- mods/ENTITIES/mobs_mc/witch.lua | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 0021a1adb..a38c78719 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -960,7 +960,7 @@ mobs:register_mob("mobs_mc:villager", { "mobs_mc_villager_smith.png", --hat }, }, - visual_size = {x=3, y=3}, + visual_size = {x=2.75, y=2.75}, makes_footstep_sound = true, walk_velocity = 1.2, run_velocity = 2.4, diff --git a/mods/ENTITIES/mobs_mc/villager_evoker.lua b/mods/ENTITIES/mobs_mc/villager_evoker.lua index 226c82a32..abe0e9ca2 100644 --- a/mods/ENTITIES/mobs_mc/villager_evoker.lua +++ b/mods/ENTITIES/mobs_mc/villager_evoker.lua @@ -28,7 +28,7 @@ mobs:register_mob("mobs_mc:evoker", { "blank.png", --no hat -- TODO: Attack glow } }, - visual_size = {x=3, y=3}, + visual_size = {x=2.75, y=2.75}, makes_footstep_sound = true, damage = 6, walk_velocity = 0.2, diff --git a/mods/ENTITIES/mobs_mc/villager_illusioner.lua b/mods/ENTITIES/mobs_mc/villager_illusioner.lua index 30e9f6f36..0bbe2a5f6 100644 --- a/mods/ENTITIES/mobs_mc/villager_illusioner.lua +++ b/mods/ENTITIES/mobs_mc/villager_illusioner.lua @@ -36,7 +36,7 @@ mobs:register_mob("mobs_mc:illusioner", { -- TODO: more sounds distance = 16, }, - visual_size = {x=3, y=3}, + visual_size = {x=2.75, y=2.75}, walk_velocity = 0.6, run_velocity = 2, jump = true, diff --git a/mods/ENTITIES/mobs_mc/villager_vindicator.lua b/mods/ENTITIES/mobs_mc/villager_vindicator.lua index 3e611acdd..56b295066 100644 --- a/mods/ENTITIES/mobs_mc/villager_vindicator.lua +++ b/mods/ENTITIES/mobs_mc/villager_vindicator.lua @@ -30,7 +30,7 @@ mobs:register_mob("mobs_mc:vindicator", { -- TODO: Glow when attacking (mobs_mc_vindicator.png) }, }, - visual_size = {x=3, y=3}, + visual_size = {x=2.75, y=2.75}, makes_footstep_sound = true, damage = 13, reach = 2, diff --git a/mods/ENTITIES/mobs_mc/villager_zombie.lua b/mods/ENTITIES/mobs_mc/villager_zombie.lua index d7f2203e1..09539fa76 100644 --- a/mods/ENTITIES/mobs_mc/villager_zombie.lua +++ b/mods/ENTITIES/mobs_mc/villager_zombie.lua @@ -45,7 +45,7 @@ mobs:register_mob("mobs_mc:villager_zombie", { {"mobs_mc_zombie_smith.png"}, {"mobs_mc_zombie_villager.png"} }, - visual_size = {x=3, y=3}, + visual_size = {x=2.75, y=2.75}, makes_footstep_sound = true, damage = 3, reach = 2, diff --git a/mods/ENTITIES/mobs_mc/witch.lua b/mods/ENTITIES/mobs_mc/witch.lua index 05f5098e5..383cbd36f 100644 --- a/mods/ENTITIES/mobs_mc/witch.lua +++ b/mods/ENTITIES/mobs_mc/witch.lua @@ -25,7 +25,7 @@ mobs:register_mob("mobs_mc:witch", { textures = { {"mobs_mc_witch.png"}, }, - visual_size = {x=3, y=3}, + visual_size = {x=2.75, y=2.75}, makes_footstep_sound = true, damage = 2, reach = 2, From c20bd768ec8aa5ea458601599e01a47c6e8d1a44 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 19 Mar 2021 14:36:48 +0100 Subject: [PATCH 04/12] Revert "Fix #1277". The commit caused each enchanted armor piece to overlay an additional violet layer over all previous armor layers. A better fix needs to be found. This reverts commit b82da0559008297a9668f28cd2c72726af666f22. --- mods/ITEMS/mcl_armor/armor.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_armor/armor.lua b/mods/ITEMS/mcl_armor/armor.lua index ec06f19ee..a879f7240 100644 --- a/mods/ITEMS/mcl_armor/armor.lua +++ b/mods/ITEMS/mcl_armor/armor.lua @@ -149,8 +149,8 @@ armor.set_player_armor = function(self, player) if level then local texture = def.texture or item:gsub("%:", "_") local enchanted_addition = (mcl_enchanting.is_enchanted(item) and mcl_enchanting.overlay or "") - table.insert(textures, texture..".png"..enchanted_addition) - preview = "player.png^[opacity:0^"..texture.."_preview.png"..enchanted_addition..""..(preview and "^"..preview or "") + table.insert(textures, "("..texture..".png"..enchanted_addition..")") + preview = "(player.png^[opacity:0^"..texture.."_preview.png"..enchanted_addition..")"..(preview and "^"..preview or "") armor_level = armor_level + level items = items + 1 mcl_armor_points = mcl_armor_points + (def.groups["mcl_armor_points"] or 0) From d168bfa791bab470d588ec590b9492f137293199 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 19 Mar 2021 14:47:52 +0100 Subject: [PATCH 05/12] Fix pumpking breaking armor display --- .../textures/mcl_farming_pumpkin_face.png | Bin 628 -> 2732 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_face.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_face.png index a2fd0fbf9b4e115697162aef807e8723f5b6354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` z&~dv3ysiEdhd)|xxatVGqr*# dV#$(8zETsuI)gt0Xt4kQ002ovPDHLkV1fjq9o_%{ delta 603 zcmV-h0;K({74!rtiBL{Q4GJ0x0000DNk~Le0001h0000$1Oos703i5cOaK4?Cs0gO zMU!+1Cx30fqR{{V00DGTPE!Ct=GbNc00H|+L_t(|0qv79bDJ<2hVvJMvNRif$U{9z zfIK9N0pq1hg(15!@?dW?=r^=mw_dk&YS&~WYrDihs<@}q&^sR}Gw&Vu+&g^FY2dvY z8{~Oz{~_cd$8$V%Wg90<7)}G%3FBxP2ClUL`+vm_iWoW3z7)ms4T25d&1#prL`hyd z)LL+T-{hnr0)o&dm5i+g9{=5!6-IlaU|0WRa3ixvGxrYQ_Z2;{8h6&JXInsraYbj@LbTC}{$ z8a#h)Z@aG1-EdIgtF?;Sb>nw0>h3jbbbmJ-C0MEc;BZnO_KQY$!(lP=e*M0a8Lj;lN-smaCm;2-*#Kw4MzyL%+CkMuFuO>cg<0Pnam3= z;P~2gr<2g#aKxV&)?!5jF8`cP$KOJC!(l Date: Fri, 19 Mar 2021 23:28:33 +0800 Subject: [PATCH 06/12] Slightly lift your right arm when holding an item. --- mods/PLAYER/wieldview/init.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mods/PLAYER/wieldview/init.lua b/mods/PLAYER/wieldview/init.lua index 6c0f08569..a5e04ced6 100644 --- a/mods/PLAYER/wieldview/init.lua +++ b/mods/PLAYER/wieldview/init.lua @@ -106,14 +106,25 @@ minetest.register_entity("wieldview:wieldnode", { if player then local wielded = player:get_wielded_item() local itemstring = wielded:get_name() + if self.itemstring ~= itemstring then + minetest.chat_send_all(dump2(itemstring, "itemstring")) local def = minetest.registered_items[itemstring] self.object:set_properties({glow = def and def.light_source or 0}) + + -- wield item as cubic if armor.textures[self.wielder].wielditem == "blank.png" then self.object:set_properties({textures = {itemstring}}) - else + else -- displayed item as flat self.object:set_properties({textures = {""}}) end + + if itemstring == "" then -- holding item + player:set_bone_position("Arm_Right", vector.new(0, 0, 0), vector.new(0, 0, 0)) + else -- empty hands + player:set_bone_position("Arm_Right", vector.new(0, 0, 0), vector.new(20, 0, 0)) + end + self.itemstring = itemstring end else From 249b5cfd1efdbca9973873ee3dd1994a885e79be Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Sat, 20 Mar 2021 00:11:12 +0800 Subject: [PATCH 07/12] Remove debug information --- mods/PLAYER/wieldview/init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/mods/PLAYER/wieldview/init.lua b/mods/PLAYER/wieldview/init.lua index a5e04ced6..4db711622 100644 --- a/mods/PLAYER/wieldview/init.lua +++ b/mods/PLAYER/wieldview/init.lua @@ -108,7 +108,6 @@ minetest.register_entity("wieldview:wieldnode", { local itemstring = wielded:get_name() if self.itemstring ~= itemstring then - minetest.chat_send_all(dump2(itemstring, "itemstring")) local def = minetest.registered_items[itemstring] self.object:set_properties({glow = def and def.light_source or 0}) From df8fdda2c5562bf16107566c94c32c094dfcec55 Mon Sep 17 00:00:00 2001 From: Nicu Date: Fri, 19 Mar 2021 17:25:40 +0000 Subject: [PATCH 08/12] Fix #1346 Fixes crash trying to place cocoa --- mods/ITEMS/mcl_cocoas/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_cocoas/init.lua b/mods/ITEMS/mcl_cocoas/init.lua index d0d96b300..f19f85154 100644 --- a/mods/ITEMS/mcl_cocoas/init.lua +++ b/mods/ITEMS/mcl_cocoas/init.lua @@ -19,7 +19,7 @@ function mcl_cocoas.place(itemstack, placer, pt, plantname) -- Am I right-clicking on something that has a custom on_rightclick set? if placer and not placer:get_player_control().sneak then if minetest.registered_nodes[under.name] and minetest.registered_nodes[under.name].on_rightclick then - return minetest.registered_nodes[under.name].on_rightclick(pointed_thing.under, under, placer, itemstack) or itemstack + return minetest.registered_nodes[under.name].on_rightclick(pt.under, under, placer, itemstack) or itemstack end end From a40e1c4737ba0b76a6fa60f56401a6093b06701a Mon Sep 17 00:00:00 2001 From: Nicu Date: Fri, 19 Mar 2021 17:41:37 +0000 Subject: [PATCH 09/12] Reduce the size of the pumpkin texture 2732 -> 303 bytes * We need smaller file sizes for better game startup time, especially for multiplayer and mobile gaming. --- .../textures/mcl_farming_pumpkin_face.png | Bin 2732 -> 303 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_face.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_face.png index 0fb980b40ff9c12ab8d0a3a7083e8d72de28d10b..095b90cc6725a2e25c84b0b7f05232890683696b 100644 GIT binary patch delta 41 xcmZ1@x}Ir*G6#cJfKP}kgW=?2P7T4myL?j_7#J8!g8YIR9G=}soBWXTGywFc4MP9` delta 2486 zcmV;n2}$;^0<0B~BYy|1dQ@0+Qek%>aB^>EX>4U6ba`-PAZ2)IW&i+q+U=KHlH@iH zMgO@9FF|~QTnKv+~4sk_xJrNuSeW}84v00L1HL#&d;srYk$5nUO!%V+au1e-rM=QJ_qPakl(Jtx6$u^5d5UC z8Tp%7wpWa}_d|QTz zlaS~8wZl3k{DhSp)%pC{yn$Hrm#t&}g8|Tct%K1s5 z7{p!+5F+-j7!xxHTrK7rTf8JCiIF&V08%VZxugjKvDRc5nM%$r1xY>m-n=96o||fF z$%oM9w~mz4y^|q><6UI@*xY#~7+9C>tqjDf5+)nP#44*4d`aKF8DreO6g@wI!>svDA`f zLnf@5Shr!iW7sIgF1zlwW%oU{9=LY$DW{%x>7!rs0kyhV-qYoVnA4SO!dTf>^_kD zDcnNsKZRTRE98Ph_bZSKK=(avKS0gA&aE4 zlg)i16g6GP92G|@TiCkiCZW#@d?W6M=)0hmdu!^T4Ad?IPE%FmspX5zh^&*oG#Y zwn*B1WbAnsS*JQKymGXJKxa&-8h^8GM8loqP6M!%rq%Lg7V9a^oZ4V~{3=so+L$DUQO?WJ({2%auxKK zr2lDQ5@y5-Tqi-f=?}W37(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: iliekprogrammar Date: Sat, 20 Mar 2021 08:42:48 +0800 Subject: [PATCH 10/12] Move holding code into mcl_playerplus --- mods/PLAYER/mcl_playerplus/init.lua | 14 ++++++++++++-- mods/PLAYER/wieldview/init.lua | 8 +------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 1f66b344f..2759ebc30 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -96,6 +96,8 @@ minetest.register_globalstep(function(dtime) local player_velocity = player:get_velocity() or player:get_player_velocity() + local wielded = player:get_wielded_item() + -- controls head bone local pitch = - degrees(player:get_look_vertical()) local yaw = degrees(player:get_look_horizontal()) @@ -107,13 +109,21 @@ minetest.register_globalstep(function(dtime) player_vel_yaw = limit_vel_yaw(player_vel_yaw, yaw) player_vel_yaws[name] = player_vel_yaw - -- controls right and left arms pitch when shooting a bow or punching - if string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB and not controls.LMB and not controls.up and not controls.down and not controls.left and not controls.right then + -- controls right and left arms pitch when shooting a bow + if string.find(wielded:get_name(), "mcl_bows:bow") and controls.RMB and not controls.LMB and not controls.up and not controls.down and not controls.left and not controls.right then + minetest.chat_send_all("entered 1") player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch+90,-30,pitch * -1 * .35)) player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3.5,5.785,0), vector.new(pitch+90,43,pitch * .35)) + -- when punching elseif controls.LMB and player:get_attach() == nil then + minetest.chat_send_all("entered 2") player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch,0,0)) player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0)) + -- when holding an item. + elseif wielded:get_name() ~= "" then + player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(20,0,0)) + player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0)) + -- resets arms pitch else player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0)) player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(0,0,0)) diff --git a/mods/PLAYER/wieldview/init.lua b/mods/PLAYER/wieldview/init.lua index 4db711622..48f3f99bd 100644 --- a/mods/PLAYER/wieldview/init.lua +++ b/mods/PLAYER/wieldview/init.lua @@ -114,16 +114,10 @@ minetest.register_entity("wieldview:wieldnode", { -- wield item as cubic if armor.textures[self.wielder].wielditem == "blank.png" then self.object:set_properties({textures = {itemstring}}) - else -- displayed item as flat + else -- wield item as flat self.object:set_properties({textures = {""}}) end - if itemstring == "" then -- holding item - player:set_bone_position("Arm_Right", vector.new(0, 0, 0), vector.new(0, 0, 0)) - else -- empty hands - player:set_bone_position("Arm_Right", vector.new(0, 0, 0), vector.new(20, 0, 0)) - end - self.itemstring = itemstring end else From 03be45b9839cb3661973c88995e99404db004c9e Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Sat, 20 Mar 2021 09:17:43 +0800 Subject: [PATCH 11/12] Fix indentation from iliekprogrammar's previous PRs --- mods/ITEMS/mcl_fire/init.lua | 106 +++++++++++++++++------------------ 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index f11c683a6..95d76c45d 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -50,69 +50,69 @@ 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.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.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 = 4.5, - -- texture = "mcl_particles_smoke_anim.png^[colorize:#000000:(3 colourize variants)", - animation = { - type = "vertical_frames", - aspect_w = 8, - aspect_h = 8, - -- length = 3 exptime variants - }, - collisiondetection = true, + 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.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 = 4.5, + -- texture = "mcl_particles_smoke_anim.png^[colorize:#000000:(3 colourize variants)", + animation = { + type = "vertical_frames", + aspect_w = 8, + aspect_h = 8, + -- length = 3 exptime variants + }, + 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 }) + 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 = { 0.75, 1.5, 4.0 } - local colorizes = { "199", "209", "243" } -- round(78%, 82%, 90% of 256) - 1 + -- 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 = { 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 - 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 - -- 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 + 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 + -- 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 - smoke_pdef_cached[id] = table.copy(smoke_pdef_base) + smoke_pdef_cached[id] = table.copy(smoke_pdef_base) - mcl_particles.add_node_particlespawner(pos, smoke_pdef_cached[id], "high") + mcl_particles.add_node_particlespawner(pos, smoke_pdef_cached[id], "high") - id = id + 1 - end - end + 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, "high") - 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, "high") + end + end --[[ Old smoke pdef - local spawn_smoke = function(pos) + local spawn_smoke = function(pos) mcl_particles.add_node_particlespawner(pos, { amount = 0.1, time = 0, @@ -132,7 +132,7 @@ local spawn_smoke = function(pos) length = 2.1, }, }, "high") - -- ]] + -- ]] end From 12745bd450d0f3d0b8f39d473eaff56d2e938678 Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Sat, 20 Mar 2021 10:13:48 +0800 Subject: [PATCH 12/12] Remove debug information... again :/ --- mods/PLAYER/mcl_playerplus/init.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 2759ebc30..7122cc894 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -111,12 +111,10 @@ minetest.register_globalstep(function(dtime) -- controls right and left arms pitch when shooting a bow if string.find(wielded:get_name(), "mcl_bows:bow") and controls.RMB and not controls.LMB and not controls.up and not controls.down and not controls.left and not controls.right then - minetest.chat_send_all("entered 1") player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch+90,-30,pitch * -1 * .35)) player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3.5,5.785,0), vector.new(pitch+90,43,pitch * .35)) -- when punching elseif controls.LMB and player:get_attach() == nil then - minetest.chat_send_all("entered 2") player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch,0,0)) player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3,5.785,0), vector.new(0,0,0)) -- when holding an item.