From e2fd8b804c2030c2cfed13d8e9fa0e304d320989 Mon Sep 17 00:00:00 2001 From: Faerraven Date: Sun, 9 Oct 2022 17:30:42 +0200 Subject: [PATCH 01/16] Add glow squids from mcl5 --- mods/ENTITIES/mobs_mc/glow_squid.lua | 253 ++++++++++++++++++ mods/ENTITIES/mobs_mc/init.lua | 2 + .../mobs_mc/models/extra_mobs_glow_squid.b3d | Bin 0 -> 40908 bytes .../textures/extra_mobs_glow_squid.png | Bin 0 -> 9028 bytes .../textures/extra_mobs_glow_squid_glint1.png | Bin 0 -> 170 bytes .../textures/extra_mobs_glow_squid_glint2.png | Bin 0 -> 175 bytes .../textures/extra_mobs_glow_squid_glint3.png | Bin 0 -> 175 bytes .../textures/extra_mobs_glow_squid_glint4.png | Bin 0 -> 175 bytes 8 files changed, 255 insertions(+) create mode 100644 mods/ENTITIES/mobs_mc/glow_squid.lua create mode 100644 mods/ENTITIES/mobs_mc/models/extra_mobs_glow_squid.b3d create mode 100644 mods/ENTITIES/mobs_mc/textures/extra_mobs_glow_squid.png create mode 100644 mods/ENTITIES/mobs_mc/textures/extra_mobs_glow_squid_glint1.png create mode 100644 mods/ENTITIES/mobs_mc/textures/extra_mobs_glow_squid_glint2.png create mode 100644 mods/ENTITIES/mobs_mc/textures/extra_mobs_glow_squid_glint3.png create mode 100644 mods/ENTITIES/mobs_mc/textures/extra_mobs_glow_squid_glint4.png diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua new file mode 100644 index 000000000..37bf72eab --- /dev/null +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -0,0 +1,253 @@ +--MCmobs v0.4 +--maikerumine +--made for MC like Survival game +--License for code WTFPL and otherwise stated in readmes + +local S = minetest.get_translator("extra_mobs") + +mcl_mobs:register_mob("mobs_mc:glow_squid", { + type = "animal", + spawn_class = "water", + can_despawn = true, + passive = true, + hp_min = 10, + hp_max = 10, + xp_min = 1, + xp_max = 3, + armor = 100, + rotate = 270, + -- tilt_swim breaks the animations. + --tilt_swim = true, + -- FIXME: If the qlow squid is near the floor, it turns black + collisionbox = { -0.4, 0.0, -0.4, 0.4, 0.9, 0.4 }, + visual = "mesh", + mesh = "extra_mobs_glow_squid.b3d", + textures = { + { "extra_mobs_glow_squid.png" } + }, + sounds = { + damage = { name = "mobs_mc_squid_hurt", gain = 0.3 }, + death = { name = "mobs_mc_squid_death", gain = 0.4 }, + flop = "mobs_mc_squid_flop", + distance = 16, + }, + animation = { + stand_start = 1, + stand_end = 60, + walk_start = 1, + walk_end = 60, + run_start = 1, + run_end = 60, + }, + drops = { + { name = "mobs_mc:glow_ink_sac", + chance = 1, + min = 1, + max = 3, + looting = "common", }, + }, + visual_size = { x = 3, y = 3 }, + makes_footstep_sound = false, + swim = true, + breathes_in_water = true, + jump = false, + view_range = 16, + runaway = true, + fear_height = 4, + fly = true, + fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, + -- don't add "mcl_core:water_flowing", or it won't move vertically. + + glow = minetest.LIGHT_MAX, + + do_custom = function(self, dtime) + local glowSquidPos = 0 + if self.object:get_pos() ~= nil then + glowSquidPos = self.object:get_pos() + + local chanceOfParticle = math.random(0, 2) + if chanceOfParticle >= 1 then + minetest.add_particle({ + pos = { x = glowSquidPos.x + math.random(-2, 2) * math.random() / 2, y = glowSquidPos.y + math.random(-1, 2), z = glowSquidPos.z + math.random(-2, 2) * math.random() / 2 }, + velocity = { x = math.random(-0.25, 0.25), y = math.random(-0.25, 0.25), z = math.random(-0.25, 0.25) }, + acceleration = { x = math.random(-0.5, 0.5), y = math.random(-0.5, 0.5), z = math.random(-0.5, 0.5) }, + expirationtime = math.random(), + size = 1.5 + math.random(), + collisiondetection = true, + vertical = false, + texture = "extra_mobs_glow_squid_glint" .. math.random(1, 4) .. ".png", + glow = minetest.LIGHT_MAX, + }) + end + end + end +}) + +-- spawning +local water = mobs_mc.water_level - 1 +-- local water = mobs_mc.spawn_height.water + 1 +mcl_mobs:spawn_specific( + "mobs_mc:glow_squid", + "overworld", + "water", + { + "Mesa", + "FlowerForest", + "Swampland", + "Taiga", + "ExtremeHills", + "Jungle", + "Savanna", + "BirchForest", + "MegaSpruceTaiga", + "MegaTaiga", + "ExtremeHills+", + "Forest", + "Plains", + "Desert", + "ColdTaiga", + "MushroomIsland", + "IcePlainsSpikes", + "SunflowerPlains", + "IcePlains", + "RoofedForest", + "ExtremeHills+_snowtop", + "MesaPlateauFM_grasstop", + "JungleEdgeM", + "ExtremeHillsM", + "JungleM", + "BirchForestM", + "MesaPlateauF", + "MesaPlateauFM", + "MesaPlateauF_grasstop", + "MesaBryce", + "JungleEdge", + "SavannaM", + "FlowerForest_beach", + "Forest_beach", + "StoneBeach", + "ColdTaiga_beach_water", + "Taiga_beach", + "Savanna_beach", + "Plains_beach", + "ExtremeHills_beach", + "ColdTaiga_beach", + "Swampland_shore", + "MushroomIslandShore", + "JungleM_shore", + "Jungle_shore", + "MesaPlateauFM_sandlevel", + "MesaPlateauF_sandlevel", + "MesaBryce_sandlevel", + "Mesa_sandlevel", + "RoofedForest_ocean", + "JungleEdgeM_ocean", + "BirchForestM_ocean", + "BirchForest_ocean", + "IcePlains_deep_ocean", + "Jungle_deep_ocean", + "Savanna_ocean", + "MesaPlateauF_ocean", + "ExtremeHillsM_deep_ocean", + "Savanna_deep_ocean", + "SunflowerPlains_ocean", + "Swampland_deep_ocean", + "Swampland_ocean", + "MegaSpruceTaiga_deep_ocean", + "ExtremeHillsM_ocean", + "JungleEdgeM_deep_ocean", + "SunflowerPlains_deep_ocean", + "BirchForest_deep_ocean", + "IcePlainsSpikes_ocean", + "Mesa_ocean", + "StoneBeach_ocean", + "Plains_deep_ocean", + "JungleEdge_deep_ocean", + "SavannaM_deep_ocean", + "Desert_deep_ocean", + "Mesa_deep_ocean", + "ColdTaiga_deep_ocean", + "Plains_ocean", + "MesaPlateauFM_ocean", + "Forest_deep_ocean", + "JungleM_deep_ocean", + "FlowerForest_deep_ocean", + "MushroomIsland_ocean", + "MegaTaiga_ocean", + "StoneBeach_deep_ocean", + "IcePlainsSpikes_deep_ocean", + "ColdTaiga_ocean", + "SavannaM_ocean", + "MesaPlateauF_deep_ocean", + "MesaBryce_deep_ocean", + "ExtremeHills+_deep_ocean", + "ExtremeHills_ocean", + "MushroomIsland_deep_ocean", + "Forest_ocean", + "MegaTaiga_deep_ocean", + "JungleEdge_ocean", + "MesaBryce_ocean", + "MegaSpruceTaiga_ocean", + "ExtremeHills+_ocean", + "Jungle_ocean", + "RoofedForest_deep_ocean", + "IcePlains_ocean", + "FlowerForest_ocean", + "ExtremeHills_deep_ocean", + "MesaPlateauFM_deep_ocean", + "Desert_ocean", + "Taiga_ocean", + "BirchForestM_deep_ocean", + "Taiga_deep_ocean", + "JungleM_ocean", + "FlowerForest_underground", + "JungleEdge_underground", + "StoneBeach_underground", + "MesaBryce_underground", + "Mesa_underground", + "RoofedForest_underground", + "Jungle_underground", + "Swampland_underground", + "MushroomIsland_underground", + "BirchForest_underground", + "Plains_underground", + "MesaPlateauF_underground", + "ExtremeHills_underground", + "MegaSpruceTaiga_underground", + "BirchForestM_underground", + "SavannaM_underground", + "MesaPlateauFM_underground", + "Desert_underground", + "Savanna_underground", + "Forest_underground", + "SunflowerPlains_underground", + "ColdTaiga_underground", + "IcePlains_underground", + "IcePlainsSpikes_underground", + "MegaTaiga_underground", + "Taiga_underground", + "ExtremeHills+_underground", + "JungleM_underground", + "ExtremeHillsM_underground", + "JungleEdgeM_underground", + }, + 0, + minetest.LIGHT_MAX + 1, + 30, + 10000, + 3, + water - 16, + water) + +-- spawn egg +mcl_mobs:register_egg("mobs_mc:glow_squid", S("Glow Squid"), "#0000FF", "#ffffff", 1) + +-- dropped item (used to craft glowing itemframe) + +minetest.register_craftitem("mobs_mc:glow_ink_sac", { + description = S("Glow Ink Sac"), + _doc_items_longdesc = S("Use it to craft the Glow Item Frame."), + _doc_items_usagehelp = S("Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame."), + inventory_image = "extra_mobs_glow_ink_sac.png", + groups = { craftitem = 1 }, +}) diff --git a/mods/ENTITIES/mobs_mc/init.lua b/mods/ENTITIES/mobs_mc/init.lua index f32255d39..9c845c93e 100644 --- a/mods/ENTITIES/mobs_mc/init.lua +++ b/mods/ENTITIES/mobs_mc/init.lua @@ -148,3 +148,5 @@ dofile(path .. "/cod.lua") dofile(path .. "/salmon.lua") dofile(path .. "/tropical_fish.lua") dofile(path .. "/dolphin.lua") + +dofile(path .. "/glow_squid.lua") diff --git a/mods/ENTITIES/mobs_mc/models/extra_mobs_glow_squid.b3d b/mods/ENTITIES/mobs_mc/models/extra_mobs_glow_squid.b3d new file mode 100644 index 0000000000000000000000000000000000000000..887576b28a8948bdd4aa0f19099db2303936f196 GIT binary patch literal 40908 zcmeI5cXSj-+V007GA8FJld&7oT1FO8JQE%kt^`?D|Uiit7jBe_Qz~pAS|) z9wk0l`kw#u{K@)L(pRqktbF}S`HA>I`HJ>sQNCP0GCp|uK8v?#U)(-r`&I5QSo^fS z|0#d(=Kpi;W=*GBw0|SMf<^o1_%^F*HdW&T?c3|-__h?UrXPq8*R13D{$+gd^kw_1 zzOSW6iC5Y`myg%Y@yhi@`;ga{{o6X8>o;7pPG8nP$8-7N{$FVSMm+BSh4yJ3FZ;g{ z|6=;G|6A9O%%2gjmcQ(O^8T#LpW_`4zJBoXlkL;UU-0{r^&h-_1e@eV) z-+}sbIE?#K+n+i<8~J;&{ABz2oz_sF^4}-K_)P7k4v&v9!{c>h{O9fA4P_xPQ_9<^9R>{fgpS2ku|A z|3G}WmR)>y>1S6z9B)^@*5xnTzjgV@_GzDguiN_if%*wvzA}C5`j_K>cK4rM`Sl+7 zg{Ml@wL#ja93T5qd^L*a??2DCZ#lje+3eOn{bRo%?XM}dL9d(R|4Q*Mwm*&!*R11Z z`?pSCw*PltnX6R~$bkWtRL(04Wu8ueaZHp-Th}*KjDXO zcs71sMSMSbeteeoQ-$I;Q9O_T&$oY$_qr$Ob+y^Ii-`E=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eBKT1)c`w{Lrh(`Jq>n^FyyD=ZEB2 z2VIt+{G+~n`ky{Ow0ZvF`5D-k#!CB_+H;K!OPgFREcd0c(zfro(Acmvvg=35V#87^ zZHp!=j15a8t4~W78kJ+&OZ zbZqeFzFcR!SUyy>>UV}NADvIfhNbRGUvCr3hpJXhcUHHD>9j8mZ&>PSGis|?KD5%7 z`1td5Y*^~Ky>GKvK2)`89!B2%cRDsK^>jG0Q7j)?X%A%O^ zJ&qbn#PXr4Rqt)tltw;mSn4^pYOz>8w9>B4o$14drJfe$onraWN}F~mL!`^gh!GQ= zV);}f2P53RIU#`{Ejpbbks|ET8?%ZIAgs58#Xg+Cp6*3J%AZZ4J& zRjr!e&KD1e_DdU8ZVX) zt+eT%&+}o!(#Wwt^%u*BR@(1>nd8HTrI8OF4-os(SZN18nC-)crA_)w7%29ovC`7~ J?z!jN{{oUE<@Nvo literal 0 HcmV?d00001 diff --git a/mods/ENTITIES/mobs_mc/textures/extra_mobs_glow_squid.png b/mods/ENTITIES/mobs_mc/textures/extra_mobs_glow_squid.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbdb9707a87ab43dfb41969e2c6e8cbe7672814 GIT binary patch literal 9028 zcmeHLc|6o>+aFsfWheU>`!a?Z%V6yLzVD)08QU;3mXef660&7qB3a5#6e3Ynl#o4A z6d^(=)jQNVr}IANeV+GxKJWYA;WNv9-QVkbUHA9CuKVW}XKiV8_#p2=003~<#8}^! z@~KUE0T~WZ-iz{1M*{#%w@=zTlWmcqz(67ahxfw*$tMD_Kx`Nu2LObPS7!O9yoMi% z{=Uu;PP@kV5q?S-MW}f=&78JGbO^QbTQXN2PZ7IFo7_WN81hByyWdv8JKLj82o*6eYu)^_o?T}fVD3Z!Q37y)ES_MVc&1g@qE9tGR;02+wbx%v#kH^ zgYDDB8fLMd(M4W!-dtllC&hi9>MKmD?80=~n}X9F=SYXp(+@YtP1?Szelgu_8EfC= zYHfnP?_vqrSesSv3gly1E(on9&F;(_*3=XGA$QTIEY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TITIES/mobs_mc/textures/extra_mobs_glow_squid_glint1.png b/mods/ENTITIES/mobs_mc/textures/extra_mobs_glow_squid_glint1.png new file mode 100644 index 0000000000000000000000000000000000000000..2ed9a013c75a6f6a4dbb3965eb66a8b8aedf1d62 GIT binary patch literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VY)RhkE)4%caKYZ?lR?r29+AZi z40_5S%viD1z6>bHUgGKN%Knsvl}k+ea%O)YP{`cV#W6(Ua&m$K`1|%O$WD@{VY)RhkE)4%caKYZ?lR?r29+AZi z40_5S%viD1z6>bHUgGKN%Knsvl}m!-WXR)tKp`7X7sn8Z%gG4}>}#yHJhtB@A#5lW zC}OHN_nZ98Hb%FYumcV==CUg*@A90r$&2T@{Qcw={pXUF>^t1a#30!tcGSVG{{YY& N22WQ%mvv4FO#sC$Ga3K@ literal 0 HcmV?d00001 diff --git a/mods/ENTITIES/mobs_mc/textures/extra_mobs_glow_squid_glint3.png b/mods/ENTITIES/mobs_mc/textures/extra_mobs_glow_squid_glint3.png new file mode 100644 index 0000000000000000000000000000000000000000..e0fe8919a477e8da124b8ed4e9a66eeee842fd2a GIT binary patch literal 175 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VY)RhkE)4%caKYZ?lR?r29+AZi z40_5S%viD1z6>bHUgGKN%Knsvl}pT$jq_XCN{I}+l`DC%~nxWJow?wQSP?QpPw5A-GAu9$WUA$Tw3z$1|%O$WD@{VY)RhkE)4%caKYZ?lR?r29+AZi z40_5S%viD1z6>bHUgGKN%Knsvl}pqlcUkf_KZrG|L)?+N^Z(s zO04Y@{+}@6F?h6ziEZ86h*Kvz@`S|Mtq*UPx0jTYi8$<0+b+z?;D23+op<8$ZlE~~ Mp00i_>zopr07c9%qW}N^ literal 0 HcmV?d00001 From a599f6636056e090bae2abcf06389b8003817359 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 9 Oct 2022 17:37:01 +0200 Subject: [PATCH 02/16] move ink sac to mcl_mobitems --- mods/ENTITIES/mobs_mc/glow_squid.lua | 12 +----------- mods/ITEMS/mcl_mobitems/init.lua | 9 +++++++++ .../textures/extra_mobs_glow_ink_sac.png | Bin 0 -> 407 bytes 3 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 mods/ITEMS/mcl_mobitems/textures/extra_mobs_glow_ink_sac.png diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index 37bf72eab..22faaec16 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -240,14 +240,4 @@ mcl_mobs:spawn_specific( water) -- spawn egg -mcl_mobs:register_egg("mobs_mc:glow_squid", S("Glow Squid"), "#0000FF", "#ffffff", 1) - --- dropped item (used to craft glowing itemframe) - -minetest.register_craftitem("mobs_mc:glow_ink_sac", { - description = S("Glow Ink Sac"), - _doc_items_longdesc = S("Use it to craft the Glow Item Frame."), - _doc_items_usagehelp = S("Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame."), - inventory_image = "extra_mobs_glow_ink_sac.png", - groups = { craftitem = 1 }, -}) +mcl_mobs:register_egg("mobs_mc:glow_squid", S("Glow Squid"), "#0000FF", "#ffffff", 0) diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index d5b43058e..a5c2a4214 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -390,6 +390,15 @@ minetest.register_alias("mobs_mc:iron_horse_armor", "mcl_mobitems:iron_horse_arm minetest.register_alias("mobs_mc:gold_horse_armor", "mcl_mobitems:gold_horse_armor") minetest.register_alias("mobs_mc:diamond_horse_armor", "mcl_mobitems:diamond_horse_armor") +minetest.register_craftitem("mcl_mobitems:glow_ink_sac", { + description = S("Glow Ink Sac"), + _doc_items_longdesc = S("Use it to craft the Glow Item Frame."), + _doc_items_usagehelp = S("Use the Glow Ink Sac and the normal Item Frame to craft the Glow Item Frame."), + inventory_image = "extra_mobs_glow_ink_sac.png", + groups = { craftitem = 1 }, +}) + + ----------- -- Crafting ----------- diff --git a/mods/ITEMS/mcl_mobitems/textures/extra_mobs_glow_ink_sac.png b/mods/ITEMS/mcl_mobitems/textures/extra_mobs_glow_ink_sac.png new file mode 100644 index 0000000000000000000000000000000000000000..6628e6abb1b239b3ca6c325b131baadbec05f1b6 GIT binary patch literal 407 zcmV;I0cie-P)Px$QAtEWR5*?8kvmHRK@>*MiZ2qgV6lRdI00>puQC!FQ6fI7XiBw>SXx-w+50D~ z)hb{kY9R<}p@G Date: Sun, 9 Oct 2022 17:59:31 +0200 Subject: [PATCH 03/16] Fix glow squid rotation / swimming direction --- mods/ENTITIES/mobs_mc/glow_squid.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index 22faaec16..6aac27a75 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -15,7 +15,7 @@ mcl_mobs:register_mob("mobs_mc:glow_squid", { xp_min = 1, xp_max = 3, armor = 100, - rotate = 270, + rotate = 0, -- tilt_swim breaks the animations. --tilt_swim = true, -- FIXME: If the qlow squid is near the floor, it turns black From af8b1baba5e88941e0b7167d1f9162dc09b8ffea Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 9 Oct 2022 17:59:51 +0200 Subject: [PATCH 04/16] Do not spam the network with individual particles --- mods/ENTITIES/mobs_mc/glow_squid.lua | 58 +++++++++++++++++++--------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index 6aac27a75..5b3e5f8b0 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -5,6 +5,30 @@ local S = minetest.get_translator("extra_mobs") +local base_psdef = { + amount = 8, + time=0, + minpos = vector.new(-1,-1,-1), + maxpos = vector.new(1,1,1), + minvel = vector.new(-0.25,-0.25,-0.25), + maxvel = vector.new(0.25,0.25,0.25), + minacc = vector.new(-0.5,-0.5,-0.5), + maxacc = vector.new(0.5,0.5,0.5), + minexptime = 1, + maxexptime = 2, + minsize = 0.8, + maxsize= 1.5, + glow = 5, + collisiondetection = true, + collision_removal = true, +} +local psdefs = {} +for i=1,4 do + local p = table.copy(base_psdef) + p.texture = "extra_mobs_glow_squid_glint"..i..".png" + table.insert(psdefs,p) +end + mcl_mobs:register_mob("mobs_mc:glow_squid", { type = "animal", spawn_class = "water", @@ -61,24 +85,22 @@ mcl_mobs:register_mob("mobs_mc:glow_squid", { glow = minetest.LIGHT_MAX, do_custom = function(self, dtime) - local glowSquidPos = 0 - if self.object:get_pos() ~= nil then - glowSquidPos = self.object:get_pos() - - local chanceOfParticle = math.random(0, 2) - if chanceOfParticle >= 1 then - minetest.add_particle({ - pos = { x = glowSquidPos.x + math.random(-2, 2) * math.random() / 2, y = glowSquidPos.y + math.random(-1, 2), z = glowSquidPos.z + math.random(-2, 2) * math.random() / 2 }, - velocity = { x = math.random(-0.25, 0.25), y = math.random(-0.25, 0.25), z = math.random(-0.25, 0.25) }, - acceleration = { x = math.random(-0.5, 0.5), y = math.random(-0.5, 0.5), z = math.random(-0.5, 0.5) }, - expirationtime = math.random(), - size = 1.5 + math.random(), - collisiondetection = true, - vertical = false, - texture = "extra_mobs_glow_squid_glint" .. math.random(1, 4) .. ".png", - glow = minetest.LIGHT_MAX, - }) - end + if not self.particlespawners then self.particlespawners = {} end + local pos = self.object:get_pos() + for _,p in pairs(minetest.get_connected_players()) do + if vector.distance(pos,p:get_pos()) < 150 and not self.particlespawners[p] then + self.particlespawners[p] = {} + for _,psdef in pairs(psdefs) do + psdef.attached = self.object + psdef.playername = p:get_player_name() + table.insert(self.particlespawners[p],minetest.add_particlespawner(psdef)) + end + elseif vector.distance(pos,p:get_pos()) > 150 then + for _,ps in pairs(self.particlespawners[p]) do + minetest.delete_particlespawner(ps) + end + self.particlespawners[p] = nil + end end end }) From ddd39b553df0b5fe6be17c9cc24ddad430c99723 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 9 Oct 2022 18:01:30 +0200 Subject: [PATCH 05/16] Fix indentation --- mods/ENTITIES/mobs_mc/glow_squid.lua | 418 +++++++++++++-------------- 1 file changed, 209 insertions(+), 209 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index 5b3e5f8b0..958688941 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -30,64 +30,64 @@ for i=1,4 do end mcl_mobs:register_mob("mobs_mc:glow_squid", { - type = "animal", - spawn_class = "water", - can_despawn = true, - passive = true, - hp_min = 10, - hp_max = 10, - xp_min = 1, - xp_max = 3, - armor = 100, - rotate = 0, - -- tilt_swim breaks the animations. - --tilt_swim = true, - -- FIXME: If the qlow squid is near the floor, it turns black - collisionbox = { -0.4, 0.0, -0.4, 0.4, 0.9, 0.4 }, - visual = "mesh", - mesh = "extra_mobs_glow_squid.b3d", - textures = { - { "extra_mobs_glow_squid.png" } - }, - sounds = { - damage = { name = "mobs_mc_squid_hurt", gain = 0.3 }, - death = { name = "mobs_mc_squid_death", gain = 0.4 }, - flop = "mobs_mc_squid_flop", - distance = 16, - }, - animation = { - stand_start = 1, - stand_end = 60, - walk_start = 1, - walk_end = 60, - run_start = 1, - run_end = 60, - }, - drops = { - { name = "mobs_mc:glow_ink_sac", - chance = 1, - min = 1, - max = 3, - looting = "common", }, - }, - visual_size = { x = 3, y = 3 }, - makes_footstep_sound = false, - swim = true, - breathes_in_water = true, - jump = false, - view_range = 16, - runaway = true, - fear_height = 4, - fly = true, - fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, - -- don't add "mcl_core:water_flowing", or it won't move vertically. + type = "animal", + spawn_class = "water", + can_despawn = true, + passive = true, + hp_min = 10, + hp_max = 10, + xp_min = 1, + xp_max = 3, + armor = 100, + rotate = 0, + -- tilt_swim breaks the animations. + --tilt_swim = true, + -- FIXME: If the qlow squid is near the floor, it turns black + collisionbox = { -0.4, 0.0, -0.4, 0.4, 0.9, 0.4 }, + visual = "mesh", + mesh = "extra_mobs_glow_squid.b3d", + textures = { + { "extra_mobs_glow_squid.png" } + }, + sounds = { + damage = { name = "mobs_mc_squid_hurt", gain = 0.3 }, + death = { name = "mobs_mc_squid_death", gain = 0.4 }, + flop = "mobs_mc_squid_flop", + distance = 16, + }, + animation = { + stand_start = 1, + stand_end = 60, + walk_start = 1, + walk_end = 60, + run_start = 1, + run_end = 60, + }, + drops = { + { name = "mobs_mc:glow_ink_sac", + chance = 1, + min = 1, + max = 3, + looting = "common", }, + }, + visual_size = { x = 3, y = 3 }, + makes_footstep_sound = false, + swim = true, + breathes_in_water = true, + jump = false, + view_range = 16, + runaway = true, + fear_height = 4, + fly = true, + fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, + -- don't add "mcl_core:water_flowing", or it won't move vertically. - glow = minetest.LIGHT_MAX, + glow = minetest.LIGHT_MAX, - do_custom = function(self, dtime) - if not self.particlespawners then self.particlespawners = {} end - local pos = self.object:get_pos() - for _,p in pairs(minetest.get_connected_players()) do + do_custom = function(self, dtime) + if not self.particlespawners then self.particlespawners = {} end + local pos = self.object:get_pos() + for _,p in pairs(minetest.get_connected_players()) do if vector.distance(pos,p:get_pos()) < 150 and not self.particlespawners[p] then self.particlespawners[p] = {} for _,psdef in pairs(psdefs) do @@ -101,165 +101,165 @@ mcl_mobs:register_mob("mobs_mc:glow_squid", { end self.particlespawners[p] = nil end - end - end + end + end }) -- spawning local water = mobs_mc.water_level - 1 -- local water = mobs_mc.spawn_height.water + 1 mcl_mobs:spawn_specific( - "mobs_mc:glow_squid", - "overworld", - "water", - { - "Mesa", - "FlowerForest", - "Swampland", - "Taiga", - "ExtremeHills", - "Jungle", - "Savanna", - "BirchForest", - "MegaSpruceTaiga", - "MegaTaiga", - "ExtremeHills+", - "Forest", - "Plains", - "Desert", - "ColdTaiga", - "MushroomIsland", - "IcePlainsSpikes", - "SunflowerPlains", - "IcePlains", - "RoofedForest", - "ExtremeHills+_snowtop", - "MesaPlateauFM_grasstop", - "JungleEdgeM", - "ExtremeHillsM", - "JungleM", - "BirchForestM", - "MesaPlateauF", - "MesaPlateauFM", - "MesaPlateauF_grasstop", - "MesaBryce", - "JungleEdge", - "SavannaM", - "FlowerForest_beach", - "Forest_beach", - "StoneBeach", - "ColdTaiga_beach_water", - "Taiga_beach", - "Savanna_beach", - "Plains_beach", - "ExtremeHills_beach", - "ColdTaiga_beach", - "Swampland_shore", - "MushroomIslandShore", - "JungleM_shore", - "Jungle_shore", - "MesaPlateauFM_sandlevel", - "MesaPlateauF_sandlevel", - "MesaBryce_sandlevel", - "Mesa_sandlevel", - "RoofedForest_ocean", - "JungleEdgeM_ocean", - "BirchForestM_ocean", - "BirchForest_ocean", - "IcePlains_deep_ocean", - "Jungle_deep_ocean", - "Savanna_ocean", - "MesaPlateauF_ocean", - "ExtremeHillsM_deep_ocean", - "Savanna_deep_ocean", - "SunflowerPlains_ocean", - "Swampland_deep_ocean", - "Swampland_ocean", - "MegaSpruceTaiga_deep_ocean", - "ExtremeHillsM_ocean", - "JungleEdgeM_deep_ocean", - "SunflowerPlains_deep_ocean", - "BirchForest_deep_ocean", - "IcePlainsSpikes_ocean", - "Mesa_ocean", - "StoneBeach_ocean", - "Plains_deep_ocean", - "JungleEdge_deep_ocean", - "SavannaM_deep_ocean", - "Desert_deep_ocean", - "Mesa_deep_ocean", - "ColdTaiga_deep_ocean", - "Plains_ocean", - "MesaPlateauFM_ocean", - "Forest_deep_ocean", - "JungleM_deep_ocean", - "FlowerForest_deep_ocean", - "MushroomIsland_ocean", - "MegaTaiga_ocean", - "StoneBeach_deep_ocean", - "IcePlainsSpikes_deep_ocean", - "ColdTaiga_ocean", - "SavannaM_ocean", - "MesaPlateauF_deep_ocean", - "MesaBryce_deep_ocean", - "ExtremeHills+_deep_ocean", - "ExtremeHills_ocean", - "MushroomIsland_deep_ocean", - "Forest_ocean", - "MegaTaiga_deep_ocean", - "JungleEdge_ocean", - "MesaBryce_ocean", - "MegaSpruceTaiga_ocean", - "ExtremeHills+_ocean", - "Jungle_ocean", - "RoofedForest_deep_ocean", - "IcePlains_ocean", - "FlowerForest_ocean", - "ExtremeHills_deep_ocean", - "MesaPlateauFM_deep_ocean", - "Desert_ocean", - "Taiga_ocean", - "BirchForestM_deep_ocean", - "Taiga_deep_ocean", - "JungleM_ocean", - "FlowerForest_underground", - "JungleEdge_underground", - "StoneBeach_underground", - "MesaBryce_underground", - "Mesa_underground", - "RoofedForest_underground", - "Jungle_underground", - "Swampland_underground", - "MushroomIsland_underground", - "BirchForest_underground", - "Plains_underground", - "MesaPlateauF_underground", - "ExtremeHills_underground", - "MegaSpruceTaiga_underground", - "BirchForestM_underground", - "SavannaM_underground", - "MesaPlateauFM_underground", - "Desert_underground", - "Savanna_underground", - "Forest_underground", - "SunflowerPlains_underground", - "ColdTaiga_underground", - "IcePlains_underground", - "IcePlainsSpikes_underground", - "MegaTaiga_underground", - "Taiga_underground", - "ExtremeHills+_underground", - "JungleM_underground", - "ExtremeHillsM_underground", - "JungleEdgeM_underground", - }, - 0, - minetest.LIGHT_MAX + 1, - 30, - 10000, - 3, - water - 16, - water) + "mobs_mc:glow_squid", + "overworld", + "water", + { + "Mesa", + "FlowerForest", + "Swampland", + "Taiga", + "ExtremeHills", + "Jungle", + "Savanna", + "BirchForest", + "MegaSpruceTaiga", + "MegaTaiga", + "ExtremeHills+", + "Forest", + "Plains", + "Desert", + "ColdTaiga", + "MushroomIsland", + "IcePlainsSpikes", + "SunflowerPlains", + "IcePlains", + "RoofedForest", + "ExtremeHills+_snowtop", + "MesaPlateauFM_grasstop", + "JungleEdgeM", + "ExtremeHillsM", + "JungleM", + "BirchForestM", + "MesaPlateauF", + "MesaPlateauFM", + "MesaPlateauF_grasstop", + "MesaBryce", + "JungleEdge", + "SavannaM", + "FlowerForest_beach", + "Forest_beach", + "StoneBeach", + "ColdTaiga_beach_water", + "Taiga_beach", + "Savanna_beach", + "Plains_beach", + "ExtremeHills_beach", + "ColdTaiga_beach", + "Swampland_shore", + "MushroomIslandShore", + "JungleM_shore", + "Jungle_shore", + "MesaPlateauFM_sandlevel", + "MesaPlateauF_sandlevel", + "MesaBryce_sandlevel", + "Mesa_sandlevel", + "RoofedForest_ocean", + "JungleEdgeM_ocean", + "BirchForestM_ocean", + "BirchForest_ocean", + "IcePlains_deep_ocean", + "Jungle_deep_ocean", + "Savanna_ocean", + "MesaPlateauF_ocean", + "ExtremeHillsM_deep_ocean", + "Savanna_deep_ocean", + "SunflowerPlains_ocean", + "Swampland_deep_ocean", + "Swampland_ocean", + "MegaSpruceTaiga_deep_ocean", + "ExtremeHillsM_ocean", + "JungleEdgeM_deep_ocean", + "SunflowerPlains_deep_ocean", + "BirchForest_deep_ocean", + "IcePlainsSpikes_ocean", + "Mesa_ocean", + "StoneBeach_ocean", + "Plains_deep_ocean", + "JungleEdge_deep_ocean", + "SavannaM_deep_ocean", + "Desert_deep_ocean", + "Mesa_deep_ocean", + "ColdTaiga_deep_ocean", + "Plains_ocean", + "MesaPlateauFM_ocean", + "Forest_deep_ocean", + "JungleM_deep_ocean", + "FlowerForest_deep_ocean", + "MushroomIsland_ocean", + "MegaTaiga_ocean", + "StoneBeach_deep_ocean", + "IcePlainsSpikes_deep_ocean", + "ColdTaiga_ocean", + "SavannaM_ocean", + "MesaPlateauF_deep_ocean", + "MesaBryce_deep_ocean", + "ExtremeHills+_deep_ocean", + "ExtremeHills_ocean", + "MushroomIsland_deep_ocean", + "Forest_ocean", + "MegaTaiga_deep_ocean", + "JungleEdge_ocean", + "MesaBryce_ocean", + "MegaSpruceTaiga_ocean", + "ExtremeHills+_ocean", + "Jungle_ocean", + "RoofedForest_deep_ocean", + "IcePlains_ocean", + "FlowerForest_ocean", + "ExtremeHills_deep_ocean", + "MesaPlateauFM_deep_ocean", + "Desert_ocean", + "Taiga_ocean", + "BirchForestM_deep_ocean", + "Taiga_deep_ocean", + "JungleM_ocean", + "FlowerForest_underground", + "JungleEdge_underground", + "StoneBeach_underground", + "MesaBryce_underground", + "Mesa_underground", + "RoofedForest_underground", + "Jungle_underground", + "Swampland_underground", + "MushroomIsland_underground", + "BirchForest_underground", + "Plains_underground", + "MesaPlateauF_underground", + "ExtremeHills_underground", + "MegaSpruceTaiga_underground", + "BirchForestM_underground", + "SavannaM_underground", + "MesaPlateauFM_underground", + "Desert_underground", + "Savanna_underground", + "Forest_underground", + "SunflowerPlains_underground", + "ColdTaiga_underground", + "IcePlains_underground", + "IcePlainsSpikes_underground", + "MegaTaiga_underground", + "Taiga_underground", + "ExtremeHills+_underground", + "JungleM_underground", + "ExtremeHillsM_underground", + "JungleEdgeM_underground", + }, + 0, + minetest.LIGHT_MAX + 1, + 30, + 10000, + 3, + water - 16, + water) -- spawn egg mcl_mobs:register_egg("mobs_mc:glow_squid", S("Glow Squid"), "#0000FF", "#ffffff", 0) From 26ba771a0219b46a79c8fd96cd6a4296080bbfed Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 9 Oct 2022 21:24:27 +0200 Subject: [PATCH 06/16] Fix translator to use mobs_mc instead of extra_mobs --- mods/ENTITIES/mobs_mc/glow_squid.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index 958688941..b1280ce2a 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -3,7 +3,7 @@ --made for MC like Survival game --License for code WTFPL and otherwise stated in readmes -local S = minetest.get_translator("extra_mobs") +local S = minetest.get_translator("mobs_mc") local base_psdef = { amount = 8, From 438d22e52eec57831c332d85f5b238725018443c Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 9 Oct 2022 21:54:40 +0200 Subject: [PATCH 07/16] Fix glow inksac itemstring --- mods/ENTITIES/mobs_mc/glow_squid.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index b1280ce2a..92e7fe108 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -64,7 +64,7 @@ mcl_mobs:register_mob("mobs_mc:glow_squid", { run_end = 60, }, drops = { - { name = "mobs_mc:glow_ink_sac", + { name = "mcl_mobitems:glow_ink_sac", chance = 1, min = 1, max = 3, From dc873f4de22bf7e2a1fdc1459e46687ea454eb49 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 9 Oct 2022 23:21:01 +0200 Subject: [PATCH 08/16] Fix crash when deleting particlespawners --- mods/ENTITIES/mobs_mc/glow_squid.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index 92e7fe108..703d5eb7c 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -95,7 +95,7 @@ mcl_mobs:register_mob("mobs_mc:glow_squid", { psdef.playername = p:get_player_name() table.insert(self.particlespawners[p],minetest.add_particlespawner(psdef)) end - elseif vector.distance(pos,p:get_pos()) > 150 then + elseif vector.distance(pos,p:get_pos()) > 150 and self.particlespawners[p] then for _,ps in pairs(self.particlespawners[p]) do minetest.delete_particlespawner(ps) end From ef4b243a30075a925f1bc976a2e141a17a07a7ce Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 10 Oct 2022 03:42:51 +0200 Subject: [PATCH 09/16] Add coord safe infinite particlespawners api for mobs --- mods/ENTITIES/mcl_mobs/api.lua | 63 +++++++++++++++++++++++++++++++++- mods/ENTITIES/mcl_mobs/api.txt | 2 ++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index e85cfc160..5cb7fcf85 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -68,6 +68,7 @@ local disable_blood = minetest.settings:get_bool("mobs_disable_blood") local mobs_drop_items = minetest.settings:get_bool("mobs_drop_items") ~= false local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= false +local player_transfer_distance = minetest.settings:get("player_transfer_distance") or 128 local remove_far = true local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0 local show_health = false @@ -84,6 +85,8 @@ if minetest.settings:get_bool("only_peaceful_mobs", false) then end) end +local active_particlespawners = {} + local function dir_to_pitch(dir) --local dir2 = vector.normalize(dir) @@ -121,6 +124,60 @@ minetest.register_chatcommand("clearmobs",{ end end}) +local function remove_particlespawners(pn,self) + if not active_particlespawners[pn] then return end + if not active_particlespawners[pn][self.object] then return end + for k,v in pairs(active_particlespawners[pn][self.object]) do + minetest.delete_particlespawner(v) + end +end + +local function add_particlespawners(pn,self) + if not active_particlespawners[pn] then active_particlespawners[pn] = {} end + if not active_particlespawners[pn][object] then active_particlespawners[pn][self.object] = {} end + for _,ps in pairs(self.particlespawners) do + ps.attached = self.object + ps.playername = pn + table.insert(active_particlespawners[pn][self.object],minetest.add_particlespawner(ps)) + end +end + +local function particlespawner_check(self,dtime) + if not self.particlespawners then return end + --minetest.log(dump(active_particlespawners)) + if self._particle_timer and self._particle_timer >= 1 then + self._particle_timer = 0 + local players = {} + for _,player in pairs(minetest.get_connected_players()) do + local pn = player:get_player_name() + table.insert(players,pn) + if not active_particlespawners[pn] then + active_particlespawners[pn] = {} end + + local dst = vector.distance(player:get_pos(),self.object:get_pos()) + if dst < player_transfer_distance and not active_particlespawners[pn][self.object] then + add_particlespawners(pn,self) + elseif dst >= player_transfer_distance and active_particlespawners[pn][self.object] then + remove_particlespawners(pn,self) + end + end + elseif not self._particle_timer then + self._particle_timer = 0 + end + self._particle_timer = self._particle_timer + dtime +end + +minetest.register_on_leaveplayer(function(player) + local pn = player:get_player_name() + if not active_particlespawners[pn] then return end + for _,m in pairs(active_particlespawners[pn]) do + for k,v in pairs(m) do + minetest.delete_particlespawner(v) + end + end + active_particlespawners[pn] = nil +end) + ----For Water Flowing: local enable_physics = function(object, luaentity, ignore_check) if luaentity.physical_state == false or ignore_check == true then @@ -3477,7 +3534,9 @@ end -- get entity staticdata local mob_staticdata = function(self) - + for _,p in pairs(minetest.get_connected_players()) do + remove_particlespawners(p:get_player_name(),self) + end -- remove mob when out of range unless tamed if remove_far and self.can_despawn @@ -3711,6 +3770,7 @@ local mob_step = function(self, dtime) self.lifetimer = self.lifetimer - dtime check_item_pickup(self) check_aggro(self,dtime) + particlespawner_check(self,dtime) if not self.fire_resistant then mcl_burning.tick(self.object, dtime, self) -- mcl_burning.tick may remove object immediately @@ -4226,6 +4286,7 @@ minetest.register_entity(name, { spawn_in_group = def.spawn_in_group, spawn_in_group_min = def.spawn_in_group_min, noyaw = def.noyaw or false, + particlespawners = def.particlespawners, -- 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 a73cc2e3e..038c34a77 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -260,6 +260,8 @@ functions needed for the mob to work properly which contains the following: 'pick_up' table of itemstrings the mob will pick up (e.g. for breeding) 'on_pick_up' function that will be called on item pickup - return true to not pickup the item 'custom_visual_size' will not reset visual_size from the base class on reload + 'noyaw' If true this mob will not automatically change yaw + 'particlespawners' Table of particlespawners attached to the mob. This is implemented in a coord safe manner i.e. spawners are only sent to players within the player_transfer_distance (and automatically removed). This enables infinitely lived particlespawners. mobs:gopath(self,target,callback_arrived) pathfind a way to target and run callback on arrival From 063102cc1e8b3d14d784824edbc9d2be7394b910 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 10 Oct 2022 03:48:20 +0200 Subject: [PATCH 10/16] Make glow squids use the particlespawner api --- mods/ENTITIES/mobs_mc/glow_squid.lua | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index 703d5eb7c..e459bd5a7 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -83,26 +83,7 @@ mcl_mobs:register_mob("mobs_mc:glow_squid", { -- don't add "mcl_core:water_flowing", or it won't move vertically. glow = minetest.LIGHT_MAX, - - do_custom = function(self, dtime) - if not self.particlespawners then self.particlespawners = {} end - local pos = self.object:get_pos() - for _,p in pairs(minetest.get_connected_players()) do - if vector.distance(pos,p:get_pos()) < 150 and not self.particlespawners[p] then - self.particlespawners[p] = {} - for _,psdef in pairs(psdefs) do - psdef.attached = self.object - psdef.playername = p:get_player_name() - table.insert(self.particlespawners[p],minetest.add_particlespawner(psdef)) - end - elseif vector.distance(pos,p:get_pos()) > 150 and self.particlespawners[p] then - for _,ps in pairs(self.particlespawners[p]) do - minetest.delete_particlespawner(ps) - end - self.particlespawners[p] = nil - end - end - end + particlespawners = psdefs, }) -- spawning From 11742b61b2ac0e45a9b07dd201f70a4d53b754fb Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 10 Oct 2022 03:48:37 +0200 Subject: [PATCH 11/16] Make Endermen also use the api instead of the old method --- mods/ENTITIES/mobs_mc/enderman.lua | 64 +++++++++--------------------- 1 file changed, 18 insertions(+), 46 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index e00906cd4..4e08ae731 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -237,7 +237,23 @@ local select_enderman_animation = function(animation_type) end local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false -local spawners = {} +local psdefs = {{ + amount = 5, + minpos = vector.new(-0.6,0,-0.6), + maxpos = vector.new(0.6,3,0.6), + minvel = vector.new(-0.25,-0.25,-0.25), + maxvel = vector.new(0.25,0.25,0.25), + minacc = vector.new(-0.5,-0.5,-0.5), + maxacc = vector.new(0.5,0.5,0.5), + minexptime = 0.2, + maxexptime = 3, + minsize = 0.2, + maxsize = 1.2, + collisiondetection = true, + vertical = false, + time = 0, + texture = "mcl_portals_particle"..math.random(1, 5)..".png", +}} mcl_mobs:register_mob("mobs_mc:enderman", { description = S("Enderman"), @@ -280,6 +296,7 @@ mcl_mobs:register_mob("mobs_mc:enderman", { run_velocity = 3.4, damage = 7, reach = 2, + particlespawners = psdefs, drops = { {name = "mcl_throwing:ender_pearl", chance = 1, @@ -293,42 +310,6 @@ mcl_mobs:register_mob("mobs_mc:enderman", { return #minetest.find_nodes_in_area(vector.offset(pos,0,1,0),vector.offset(pos,0,3,0),{"air"}) > 2 end, do_custom = function(self, dtime) - -- PARTICLE BEHAVIOUR HERE. - local enderpos = self.object:get_pos() - if self._particle_timer and self._particle_timer >= 1 then - for _,player in pairs(minetest.get_connected_players()) do - if not spawners[player] then spawners[player] = {} end - local dst = vector.distance(player:get_pos(),enderpos) - if dst < 128 and not spawners[player][self.object] then - self._particle_timer = 0 - spawners[player][self.object] = minetest.add_particlespawner({ - amount = 5, - minpos = vector.new(-0.6,0,-0.6), - maxpos = vector.new(0.6,3,0.6), - minvel = vector.new(-0.25,-0.25,-0.25), - maxvel = vector.new(0.25,0.25,0.25), - minacc = vector.new(-0.5,-0.5,-0.5), - maxacc = vector.new(0.5,0.5,0.5), - minexptime = 0.2, - maxexptime = 3, - minsize = 0.2, - maxsize = 1.2, - collisiondetection = true, - vertical = false, - time = 0, - texture = "mcl_portals_particle"..math.random(1, 5)..".png", - attached = self.object, - playername = player:get_player_name(), - }) - elseif dst > 128 and spawners[player][self.object] then - minetest.delete_particlespawner(spawners[player][self.object]) - spawners[player][self.object] = nil - end - end - elseif not self._particle_timer then - self._particle_timer = 0 - end - self._particle_timer = self._particle_timer + dtime -- RAIN DAMAGE / EVASIVE WARP BEHAVIOUR HERE. enderpos = self.object:get_pos() local dim = mcl_worlds.pos_to_dimension(enderpos) @@ -648,15 +629,6 @@ mcl_mobs:register_mob("mobs_mc:enderman", { attack_type = "dogfight", }) -minetest.register_on_leaveplayer(function(player) - if not spawners[player] then return end - for _,s in pairs(spawners[player]) do - minetest.delete_particlespawner(s) - end - spawners[player] = nil -end) - - -- End spawn mcl_mobs:spawn_specific( "mobs_mc:enderman", From 01791cf5503abad345b9766acad7afdf5ad7a7ce Mon Sep 17 00:00:00 2001 From: cora Date: Tue, 11 Oct 2022 05:42:45 +0200 Subject: [PATCH 12/16] fix crash when player_transfer_distance is not set --- 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 5cb7fcf85..af58de3b6 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -68,7 +68,7 @@ local disable_blood = minetest.settings:get_bool("mobs_disable_blood") local mobs_drop_items = minetest.settings:get_bool("mobs_drop_items") ~= false local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= false -local player_transfer_distance = minetest.settings:get("player_transfer_distance") or 128 +local player_transfer_distance = tonumber(minetest.settings:get("player_transfer_distance")) or 128 local remove_far = true local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0 local show_health = false From fb07fee7f0de22a7912744602c3fe6e65d9eb86d Mon Sep 17 00:00:00 2001 From: cora Date: Tue, 11 Oct 2022 11:22:09 +0200 Subject: [PATCH 13/16] Glow squid spawn egg colors --- mods/ENTITIES/mobs_mc/glow_squid.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/glow_squid.lua b/mods/ENTITIES/mobs_mc/glow_squid.lua index e459bd5a7..092206998 100644 --- a/mods/ENTITIES/mobs_mc/glow_squid.lua +++ b/mods/ENTITIES/mobs_mc/glow_squid.lua @@ -243,4 +243,4 @@ mcl_mobs:spawn_specific( water) -- spawn egg -mcl_mobs:register_egg("mobs_mc:glow_squid", S("Glow Squid"), "#0000FF", "#ffffff", 0) +mcl_mobs:register_egg("mobs_mc:glow_squid", S("Glow Squid"), "#095757", "#87f6c0", 0) From b770ce42e30cf2f9b1d6c435425dc5e2e0533407 Mon Sep 17 00:00:00 2001 From: cora Date: Tue, 11 Oct 2022 11:58:27 +0200 Subject: [PATCH 14/16] Fix particlespawners not showing on player_transfer_distance == 0 --- mods/ENTITIES/mcl_mobs/api.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index af58de3b6..ac8d57bcd 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -69,6 +69,7 @@ local mobs_drop_items = minetest.settings:get_bool("mobs_drop_items") ~= false local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= false local player_transfer_distance = tonumber(minetest.settings:get("player_transfer_distance")) or 128 +if player_transfer_distance == 0 then player_transfer_distance = math.huge end local remove_far = true local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0 local show_health = false From 3e312af3b9fe7607858a537710d8ffe0275e3841 Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 14 Oct 2022 00:07:26 +0200 Subject: [PATCH 15/16] fix warning / wrong var --- 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 ac8d57bcd..a4b74a237 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -135,7 +135,7 @@ end local function add_particlespawners(pn,self) if not active_particlespawners[pn] then active_particlespawners[pn] = {} end - if not active_particlespawners[pn][object] then active_particlespawners[pn][self.object] = {} end + if not active_particlespawners[pn][self.object] then active_particlespawners[pn][self.object] = {} end for _,ps in pairs(self.particlespawners) do ps.attached = self.object ps.playername = pn From 80ff5f12072364a3c11ab9342dd3d121c0180b1d Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 14 Oct 2022 00:24:44 +0200 Subject: [PATCH 16/16] Fix enderpos global warning --- mods/ENTITIES/mobs_mc/enderman.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index 4e08ae731..2849b62b6 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -311,7 +311,7 @@ mcl_mobs:register_mob("mobs_mc:enderman", { end, do_custom = function(self, dtime) -- RAIN DAMAGE / EVASIVE WARP BEHAVIOUR HERE. - enderpos = self.object:get_pos() + local enderpos = self.object:get_pos() local dim = mcl_worlds.pos_to_dimension(enderpos) if dim == "overworld" then if mcl_weather.state == "rain" or mcl_weather.state == "lightning" then