From 90a08584954b5c0a019b791df80336ff6f4d6c8a Mon Sep 17 00:00:00 2001 From: epCode Date: Fri, 12 Mar 2021 15:36:43 -0800 Subject: [PATCH] Make new arrow mesh work with tipped arrows --- mods/ITEMS/mcl_bows/models/mcl_bows_arrow.obj | 42 +++++++++--------- .../mcl_bows/textures/mcl_bows_arrow.png | Bin 272 -> 359 bytes .../textures/mcl_bows_arrow_overlay.png | Bin 317 -> 260 bytes mods/ITEMS/mcl_potions/tipped_arrow.lua | 27 +++++++++-- 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/mods/ITEMS/mcl_bows/models/mcl_bows_arrow.obj b/mods/ITEMS/mcl_bows/models/mcl_bows_arrow.obj index 09b37852b..8530efa78 100644 --- a/mods/ITEMS/mcl_bows/models/mcl_bows_arrow.obj +++ b/mods/ITEMS/mcl_bows/models/mcl_bows_arrow.obj @@ -2,26 +2,26 @@ # www.blender.org mtllib mcl_bows_arrow.mtl o Plane -v 3.782006 -1.443249 -0.000500 -v 3.782006 1.444249 -0.000500 -v -3.782006 1.444249 -0.000500 -v -3.782006 -1.443249 -0.000500 -v -3.331104 1.069925 -1.085017 -v -3.331104 -1.100076 -1.085017 -v -3.331104 1.069925 1.064829 -v -3.331104 -1.100076 1.064829 -v -3.782006 0.001000 -1.443749 -v -3.782006 0.001000 1.443749 -v 3.782006 0.001000 1.443749 -v 3.782006 0.001000 -1.443749 -v -3.782006 0.000000 1.443749 -v -3.782006 0.000000 -1.443749 -v 3.782006 0.000000 -1.443749 -v 3.782006 0.000000 1.443749 -v -3.782006 1.444249 0.000500 v -3.782006 -1.443249 0.000500 -v 3.782006 -1.443249 0.000500 +v -3.782006 1.444249 0.000500 v 3.782006 1.444249 0.000500 +v 3.782006 -1.443249 0.000500 +v 3.331104 1.069925 1.085017 +v 3.331104 -1.100076 1.085017 +v 3.331104 1.069925 -1.064830 +v 3.331104 -1.100076 -1.064829 +v 3.782006 0.001000 1.443749 +v 3.782006 0.001000 -1.443750 +v -3.782006 0.001000 -1.443749 +v -3.782006 0.001000 1.443750 +v 3.782006 0.000000 -1.443750 +v 3.782006 0.000000 1.443749 +v -3.782006 0.000000 1.443750 +v -3.782006 0.000000 -1.443749 +v 3.782006 1.444249 -0.000500 +v 3.782006 -1.443249 -0.000500 +v -3.782006 -1.443249 -0.000500 +v -3.782006 1.444249 -0.000500 vt 0.000000 0.300000 vt 0.000000 0.700000 vt 1.000000 0.700000 @@ -42,10 +42,10 @@ vt 0.000000 0.300000 vt 0.000000 0.700000 vt 1.000000 0.700000 vt 1.000000 0.300000 -vn 0.0000 -0.0000 1.0000 -vn -1.0000 -0.0000 -0.0000 +vn -0.0000 -0.0000 -1.0000 +vn 1.0000 -0.0000 0.0000 vn 0.0000 1.0000 0.0000 -vn 0.0000 0.0000 -1.0000 +vn 0.0000 0.0000 1.0000 vn 0.0000 -1.0000 0.0000 usemtl Material.002 s off diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_arrow.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_arrow.png index 69267d098bde85f77f975a65c50ec6164113f18d..244405288e2c450361c3e274a1a7847c2b8fc384 100644 GIT binary patch delta 296 zcmV+@0oVSJ0_OsdDhdAp{{a7>y{D6rGa`Q>D#>PyIRF3v^hrcPR9M4fWS|dVgkmNr zW`<%Ws5k=)1N{K9W0;XJ-5kP*hLJ-B#-?kC;Byp&7z}{kA@Uy$|AR>|4`8&w#Qrld zF#Knxqa%=M^bq>TJOGImTQvP+9w0{ys6&t)fZ-s<0m`iyX@>E|ix>Z~sg#hAV5EO% zbg?iDEclP%B6@|)(sCMJY!*$JBkax{rHQbfQtir#)7HCC67zJj*SZg z0|Ns?P*?w>ZX delta 208 zcmV;>05AXN0+0fbDhcQS=m6;G$J{fKGa`Qs6<;d*>i_@%ok>JNR9M4fU>F6XU=)mk zQ7{T<3m9L#c<~>bgoK0yBRw6$G-yHu#-LZoJbm&2#U5!H1;)V@B85@zC@%c=<1dN= zE)Hg_8e!^i$>UP5W8=cWz`(!|6c#a>Mi>|v7#Jq^b)eXjTU0T~(#U8zG73lqFJ3&n z_>U{yjEFQc>JW6mf}9@y{`tYsSrm`8q@{Ja!Zey|Mic8$aR>l6Z9k}icFLsy0000< KMNUMnLSTXu1XslX diff --git a/mods/ITEMS/mcl_bows/textures/mcl_bows_arrow_overlay.png b/mods/ITEMS/mcl_bows/textures/mcl_bows_arrow_overlay.png index 2ca26c58a8cc478a025a0f8708c1113600c96466..a043eb37eac89aa293ed0de5717391d33ec9bc8f 100644 GIT binary patch delta 232 zcmdnX)WS4DrJgOx+ueoXKL{?^yL>VO0|RG)M`SSr1Gg{;GcwGYBLNg-FY)wsWq-=d zBQDF4|8eayA$UuwIZa>}U`>m!hbbnEccu>7i6pu!h?X-7P{c zJZ5TI|E|j}`BAe&#=*tKTv)K<#AC~*`zFS-851{4?z`M!mCeSm<=S@Bq784_HT-{XKe22z`(F;zO~oS gpNe*Nap_yjeZsWBHS+T@pz9bsUHx3vIVCg!0H`xs%K!iX literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeoy;#^NA%Cx&(BWL^R}7O4@QX}-P; zT0k}j17mw80}DtA5K93u0|V0nCb)>w0%imoB&oQmIS)u}_H=O!iQr65kYHV`XduM| zCPMfc#r5O cbjafXhKP~Pfv%lW*&uIty85}Sb4q9e0ODF%DgXcg diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index 2853487c9..860019e8a 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -100,9 +100,10 @@ function mcl_potions.register_arrow(name, desc, color, def) local ARROW_ENTITY={ physical = true, - visual = "wielditem", - visual_size = {x=0.4, y=0.4}, - textures = {"mcl_potions:"..name.."_arrow_box"}, + visual = "mesh", + mesh = "mcl_bows_arrow.obj", + visual_size = {x=1, y=1}, + textures = arrow_image(color, 100), collisionbox = {-0.19, -0.125, -0.19, 0.19, 0.125, 0.19}, collide_with_objects = false, @@ -177,6 +178,26 @@ function mcl_potions.register_arrow(name, desc, color, def) -- Check for object "collision". Done every tick (hopefully this is not too stressing) else + + if self._damage == 10 or self._damage == 9 then + minetest.add_particlespawner({ + amount = 1, + time = .001, + minpos = pos, + maxpos = pos, + minvel = vector.new(-0.1,-0.1,-0.1), + maxvel = vector.new(0.1,0.1,0.1), + minexptime = 0.5, + maxexptime = 0.5, + minsize = 2, + maxsize = 2, + collisiondetection = false, + vertical = false, + texture = "mobs_mc_arrow_particle.png", + glow = 1, + }) + end + -- We just check for any hurtable objects nearby. -- The radius of 3 is fairly liberal, but anything lower than than will cause -- arrow to hilariously go through mobs often.