From 140c2ad467eeef251382e954ad4593f3afaf3563 Mon Sep 17 00:00:00 2001 From: Juraj Vajda Date: Tue, 25 Apr 2023 13:45:26 -0400 Subject: [PATCH] Update textures and prevent double shooting while async after is being executed --- LICENSE.txt | 106 ++++++++++++++++++++++++++ README.md | 109 +-------------------------- api.lua | 8 ++ textures/x_bows_arrow_bronze.png | Bin 171 -> 179 bytes textures/x_bows_arrow_diamond.png | Bin 171 -> 179 bytes textures/x_bows_arrow_mese.png | Bin 171 -> 179 bytes textures/x_bows_arrow_mesh.png | Bin 232 -> 236 bytes textures/x_bows_arrow_slot.png | Bin 124 -> 129 bytes textures/x_bows_arrow_steel.png | Bin 171 -> 187 bytes textures/x_bows_arrow_stone.png | Bin 171 -> 187 bytes textures/x_bows_arrow_wood.png | Bin 182 -> 186 bytes textures/x_bows_bow_wood.png | Bin 179 -> 187 bytes textures/x_bows_bow_wood_charged.png | Bin 225 -> 282 bytes textures/x_bows_target.png | Bin 264 -> 594 bytes 14 files changed, 115 insertions(+), 108 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 7fe94c9..a6ab12c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -453,3 +453,109 @@ RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +### Code + +GNU Lesser General Public License v2.1 or later + +### Textures + +**CC-BY-SA-4.0, Pixel Perfection by XSSheep**, https://minecraft.curseforge.com/projects/pixel-perfection-freshly-updated + +- x_bows_arrow_particle.png +- x_bows_bubble.png + +**CC-BY-SA-3.0, by paramat** + +- x_bows_hotbar_selected.png +- x_bows_quiver_hotbar.png +- x_bows_single_hotbar.png + +**CC-BY-SA-4.0, by SaKeL** + +- x_bows_quiver.png +- x_bows_quiver_open.png +- x_bows_arrow_slot.png +- x_bows_arrow_mesh.png +- x_bows_quiver_mesh.png +- x_bows_quiver_empty_mesh.png +- x_bows_quiver_blank_mesh.png +- x_bows_quiver_slot.png +- x_bows_dmg_0.png +- x_bows_dmg_1.png +- x_bows_dmg_2.png +- x_bows_dmg_3.png +- x_bows_dmg_4.png +- x_bows_dmg_5.png +- x_bows_dmg_6.png +- x_bows_dmg_7.png +- x_bows_dmg_8.png +- x_bows_dmg_9.png +- x_bows_bow_wood.png +- x_bows_bow_wood_charged.png +- x_bows_arrow_wood.png +- x_bows_arrow_stone.png +- x_bows_arrow_bronze.png +- x_bows_arrow_steel.png +- x_bows_arrow_mese.png +- x_bows_arrow_diamond.png +- x_bows_target.png + +### Sounds + +**Creative Commons License, EminYILDIRIM**, https://freesound.org + +- x_bows_bow_load.1.ogg +- x_bows_bow_load.2.ogg +- x_bows_bow_load.3.ogg + +**Creative Commons License, bay_area_bob**, https://freesound.org + +- x_bows_bow_loaded.ogg + +**Creative Commons License**, https://freesound.org + +- x_bows_bow_shoot_crit.ogg + +**Creative Commons License, robinhood76**, https://freesound.org + +- x_bows_arrow_hit.1.ogg +- x_bows_arrow_hit.2.ogg +- x_bows_arrow_hit.3.ogg + +**Creative Commons License, brendan89**, https://freesound.org + +- x_bows_bow_shoot.1.ogg + +**Creative Commons License, natty23**, https://freesound.org + +- x_bows_arrow_successful_hit.ogg + +**Creative Commons License, Shamewap**, https://freesound.org + +- x_bows_quiver.1.ogg +- x_bows_quiver.2.ogg +- x_bows_quiver.3.ogg +- x_bows_quiver.4.ogg +- x_bows_quiver.5.ogg +- x_bows_quiver.6.ogg +- x_bows_quiver.7.ogg +- x_bows_quiver.8.ogg +- x_bows_quiver.9.ogg + +### Models + +**CC-BY-SA-4.0, by SaKeL** + +- x_bows_arrow.obj +- x_bows_arrow.blend + +**Original model by MirceaKitsune (CC BY-SA 3.0).** +**Various alterations and fixes by kilbith, sofar, xunto, Rogier-5, TeTpaAka, Desour, stujones11, An0n3m0us (CC BY-SA 3.0):** + +Modified by SaKeL (added quiver): + +- x_bows_3d_armor_character.b3d +- x_bows_3d_armor_character.blend +- x_bows_character.b3d +- x_bows_character.blend diff --git a/README.md b/README.md index b9de0d7..4406375 100644 --- a/README.md +++ b/README.md @@ -94,114 +94,7 @@ There are few indications on how to know when the bow shot arrow from quiver: ## License: -### Code - -GNU Lesser General Public License v2.1 or later (see included LICENSE file) - -### Textures - -**CC BY-SA 4.0, Pixel Perfection by XSSheep**, https://minecraft.curseforge.com/projects/pixel-perfection-freshly-updated - -- x_bows_bow_wood.png -- x_bows_bow_wood_charged.png -- x_bows_arrow_wood.png -- x_bows_arrow_particle.png -- x_bows_bubble.png -- x_bows_target.png - -Modified by SaKeL: - -- x_bows_arrow_stone.png -- x_bows_arrow_bronze.png -- x_bows_arrow_steel.png -- x_bows_arrow_mese.png -- x_bows_arrow_diamond.png - -**CC-BY-SA-3.0, by paramat** - -- x_bows_hotbar_selected.png -- x_bows_quiver_hotbar.png -- x_bows_single_hotbar.png - -**LGPL-2.1-or-later, by SaKeL** - -- x_bows_quiver.png -- x_bows_quiver_open.png -- x_bows_arrow_slot.png -- x_bows_arrow_mesh.png -- x_bows_quiver_mesh.png -- x_bows_quiver_empty_mesh.png -- x_bows_quiver_blank_mesh.png -- x_bows_quiver_slot.png -- x_bows_dmg_0.png -- x_bows_dmg_1.png -- x_bows_dmg_2.png -- x_bows_dmg_3.png -- x_bows_dmg_4.png -- x_bows_dmg_5.png -- x_bows_dmg_6.png -- x_bows_dmg_7.png -- x_bows_dmg_8.png -- x_bows_dmg_9.png - -### Sounds - -**Creative Commons License, EminYILDIRIM**, https://freesound.org - -- x_bows_bow_load.1.ogg -- x_bows_bow_load.2.ogg -- x_bows_bow_load.3.ogg - -**Creative Commons License, bay_area_bob**, https://freesound.org - -- x_bows_bow_loaded.ogg - -**Creative Commons License**, https://freesound.org - -- x_bows_bow_shoot_crit.ogg - -**Creative Commons License, robinhood76**, https://freesound.org - -- x_bows_arrow_hit.1.ogg -- x_bows_arrow_hit.2.ogg -- x_bows_arrow_hit.3.ogg - -**Creative Commons License, brendan89**, https://freesound.org - -- x_bows_bow_shoot.1.ogg - -**Creative Commons License, natty23**, https://freesound.org - -- x_bows_arrow_successful_hit.ogg - -**Creative Commons License, Shamewap**, https://freesound.org - -- x_bows_quiver.1.ogg -- x_bows_quiver.2.ogg -- x_bows_quiver.3.ogg -- x_bows_quiver.4.ogg -- x_bows_quiver.5.ogg -- x_bows_quiver.6.ogg -- x_bows_quiver.7.ogg -- x_bows_quiver.8.ogg -- x_bows_quiver.9.ogg - -### Models - -**LGPL-2.1-or-later, by SaKeL** - -- x_bows_arrow.obj -- x_bows_arrow.blend - -**Original model by MirceaKitsune (CC BY-SA 3.0).** -**Various alterations and fixes by kilbith, sofar, xunto, Rogier-5, TeTpaAka, Desour, stujones11, An0n3m0us (CC BY-SA 3.0):** - -Modified by SaKeL (added quiver): - -- x_bows_3d_armor_character.b3d -- x_bows_3d_armor_character.blend -- x_bows_character.b3d -- x_bows_character.blend +- see included LICENSE.txt file ## Installation diff --git a/api.lua b/api.lua index ff814fc..3376b8e 100644 --- a/api.lua +++ b/api.lua @@ -651,6 +651,11 @@ function XBows.shoot(self, itemstack, user, pointed_thing) local tflp = (time_shoot - time_load) / 1000000 ---@type ItemStack local arrow_itemstack = ItemStack(minetest.deserialize(meta:get_string('arrow_itemstack_string'))) + + if arrow_itemstack:is_empty() then + return itemstack + end + local arrow_itemstack_meta = arrow_itemstack:get_meta() local arrow_name = arrow_itemstack:get_name() local is_arrow_from_quiver = arrow_itemstack_meta:get_int('is_arrow_from_quiver') @@ -741,6 +746,9 @@ function XBows.shoot(self, itemstack, user, pointed_thing) sound_name = x_bows_registered_bow_charged_def.custom.sound_shoot_crit end + -- remove arrow meta to prevent multiple shots while waiting for async `after` + meta:set_string('arrow_itemstack_string', '') + ---stop punching close objects/nodes when shooting minetest.after(0.2, function() local wield_item = user:get_wielded_item() diff --git a/textures/x_bows_arrow_bronze.png b/textures/x_bows_arrow_bronze.png index 074ace85410de3c649436cc541f97d7ff5d36672..f99efa6b74f441fb88e06349734d16b36a0da127 100644 GIT binary patch delta 151 zcmV;I0BHZK0kZ*+B!4PUOjJcja7>m?4}UfT;de0R+1By!?$P1)u*BZy@A}5o=dX*4 z*5U5$?d`^=rGYML9{>OV0d!JMQvg8b*k%9#05?fQK~#9!t;jI~03Zm%z^W)B`2X*^ zLT9sGP*U|ui?7=n+$96m54!gODiG|ZyQcsE002ovPDHLk FV1iz+M~eUe delta 143 zcmV;A0C4}a0jmL!B!47OOjJcja7>eqh|B6hes`~|rE6nemQD}hcQAi81IDMN zuZxRxqucxd0004WQchCD%PDHLkV1huOKTZGu diff --git a/textures/x_bows_arrow_diamond.png b/textures/x_bows_arrow_diamond.png index 542c4973422d6f0e6c7106e2ecbd6ca76494c70c..88dcbd7e7f5de474cae9f0accf51c9b015ce3f8c 100644 GIT binary patch delta 151 zcmV;I0BHZK0kZ*+B!4PUOjJcja7+MFP$7hZZ_v*1@b2c>*3seiu*BZR)#vB$`mc+N z*5U5$?d`^=r7|){v;Y7A0d!JMQvg8b*k%9#05?fQK~#9!t;jI~03Zm%z^W)9`v32` zLT9sGP*RObJ1g7lcpm6M9?e%Z*!X9e>^<3n+$96m54 iA)3ChPzJ002ovPDHLk FV1m55M}7bR delta 143 zcmV;A0C4}a0jmL!B!47OOjJcja7>eqh|B6hes`~|rE6neA%uc&(9Qr-P{yaF zuZxSUiu@e_0004WQchCD%PDHLkV1h}iKT-ey diff --git a/textures/x_bows_arrow_mese.png b/textures/x_bows_arrow_mese.png index aa4f0f824e5845da522e07efc5373fa6c1675773..3765187f30c164f9af72057ba4654b61ff6a2d1f 100644 GIT binary patch delta 151 zcmV;I0BHZK0kZ*+B!4PUOjJcja7?ho-qzvn#?|NT?d{Rw_UG^VcYgr9!T?oS0P*nd z=GoS-i;KpmrLOT!h5!Hn0d!JMQvg8b*k%9#05?fQK~#9!t;o3n03Zy*K!@-L_FtDa zc8$6dD6_)!+Opki&jX`~=jx3OHU4>r`hS002ovPDHLk FV1j6zNizTd delta 143 zcmV;A0C4}a0jmL!B!47OOjJcja7>eqh|B6hes`~|rE6necYgr9!T?oS0LG`K zuZxQtPi_|g0004WQchCD%PDHLkV1j?WJw5;c diff --git a/textures/x_bows_arrow_mesh.png b/textures/x_bows_arrow_mesh.png index 21aae461fc12196868c3fa4e44b14d0b55c34f7c..9fc09354788945b2f1cb15f2380d572dad576c0b 100644 GIT binary patch delta 200 zcmV;(05|{W0qg;gEPuwQrIU_`-OIcVgY~bAh z0004WQchCjhy6ytyFlza0zG%(B{=Rsu}11R}C*gH5rASJuM ztX^;O8IU=XS^ypz55i`osJA~p7;v(_-U{Xsk9`1E(*pO=%RavV0000*a{G}mB758&V znaT2)BS5#??zZg(JY+dZfPMDZ=U&(QpIhz*?iEo%+Z5xl1i19=J%PQs}?_J_yZ@&w&D2z0000LBs{q0OT7Ld%^`B|buxpD1A|e} SG|4#(K;Y@>=d#Wzp$P!A6cob% diff --git a/textures/x_bows_arrow_steel.png b/textures/x_bows_arrow_steel.png index edde5faf3fb03f5d3eacb46b46852c109ebdd2b1..b139b707b6c3f33153af9c2f21f6edf3b330e012 100644 GIT binary patch delta 159 zcmV;Q0AT;C0lNW^B!4haOjJcja7?ho-qzvn#?|NT?d{Rw_UG^VgnoCElat)s+-qZA zXlQ8h@b2c>)~}0;#;2tRJ(AG?0004WQchC delta 143 zcmV;A0C4}i0jmL!B!47OOjJcja7>eqh|B6hes`~|rE6nelarI&+}vnrXvU|d zuZxSW$vQ6p0004WQchCD%PDHLkV1n6tK$-vm diff --git a/textures/x_bows_arrow_stone.png b/textures/x_bows_arrow_stone.png index 35086a0346166841f135d194eefc0d09bce9105e..9defc2ac90aa1db9f8020f088adfa243aec95a7e 100644 GIT binary patch delta 159 zcmV;Q0AT;C0lNW^B!4haOjJcja7?ho-qzvn#?|NT?d{Rw_UG^VgnoBmUtWB9cxz)` zTUl7~@b2c>)~}0;#;2uh7J delta 143 zcmV;A0C4}i0jmL!B!47OOjJcja7>eqh|B6hes`~|rE6neU|(K*d3ak{SjMNN zuZxT8OeLZK0004WQchCD%PDHLkV1gB`KFI(8 diff --git a/textures/x_bows_arrow_wood.png b/textures/x_bows_arrow_wood.png index 47c472c53807fe8aed48b30dabee49077bf30a8e..4a63d3d131d225212861f759de0f6c7e995ce04c 100644 GIT binary patch delta 158 zcmV;P0Ac^O0lEQ@B!4YXOjJcja7=4A8+t}6hEg`>+1By!?y$t((c$)AD-Y-I`o`7g zuZxS;;qLA2?Z&6253h1!00001bW%=J06^y0W&i*HJ4r-ARCwB@$hQFiFbKrJ2OM$O ze_Xflt<{~7YHerw>Cx_I#sS%69cicu*!Zy6h^$4)tFS9#mlq6VKg$ULNAGkW`~Uy| M07*qoM6N<$f^j)Z!~g&Q delta 154 zcmV;L0A>HW0k#2eqh|B6hes`~|rE6neQ9w0gPC#*5M?p0! z#;2vPi;E7n+M@sf00DGTPE!Ct=GbNc002EnL_t(|+NI1l5&$6#1VI@Dr{NB+Ys1tSpUmQ_{*#H0l07*qo IM6N<$f_L6NUjP6A diff --git a/textures/x_bows_bow_wood.png b/textures/x_bows_bow_wood.png index e895ef1f0591dd6874d69138328dd69909ef68c5..d606d57514b2c6ff545a177599c9b7fb515367d4 100644 GIT binary patch delta 171 zcmV;c096080lNW^7=H)@0000eEe}%w001FSOjJcja7q!eNOZF`b~_(J)mYE{TAB@H6(1N9L7zJ`P$23Ig18T Zs3&}90Nhz1*}eb(002ovPDHLkV1fdkM(_Xt delta 163 zcmdnZxS4T+L_G^L0|Ud`yN`l^lth3}h^u>nkC~=IZiro=twC>&|B3yp?p`~#eZ?fh zzsVv%HH;-ee!&b5&u*jvIi8*_jv*YftOpPBHYf-%Y+&2-!`56N(m}S-fgTe~DWM4fY-c-E diff --git a/textures/x_bows_bow_wood_charged.png b/textures/x_bows_bow_wood_charged.png index 205220f2c2ca9a01b2acc9a938fc874e04a666f9..63bceb94935510a14fb4d01115b8691c1eee6435 100644 GIT binary patch delta 267 zcmV+m0rdXi0h$7k7=H)@0000eEe}%w003H0OjJcja7@R!rRvAA@$l|-DtL_t&-83n-y0)jvc z0I&cDZ5iU;{{NdM0001p2*C9QQJJxU`{Vr)l`1O(UJI3=629%H-+>uu%d-bMi0az` zFd-`Uz8ye^sD!q_gh-$raY1AOZ5;;?2^iP$3|j$)@dRXH?j{2ua_%O8KLfr4f(x zogU=Up60!M#iVIvp@mWIC-$$pd+pfD{OOHAJ&Ywme!&b5&u*jvIq{w@jv*C{tOp$# z866oI4lpt>A1VhIY!3t){mI9z%44$rj JF6*2UngAJtQJDY$ diff --git a/textures/x_bows_target.png b/textures/x_bows_target.png index 7799aeca797163189aab78e3fc6a548f56b52d02..64bc0e2e667ce5610e7b496e7ccd3f8a324a1ceb 100644 GIT binary patch delta 580 zcmV-K0=xZ)0@4JK8Gix*005AYXf^-<0vSm}K~#7FEmB2--7pNb9pmTWIY1c?P*`UgGNqPBgMPO+SASO}3;5Re-FMdvM_)+9 z)01vzXSBS$ytDHg41g!3*xp{Fi?r9HaU7RrdHQ9TWr|Zu)1sVeXti2-p6iK0M!(-j z(CKuFqEJflAVzlFfDd>GA^F7{kiVBYp;R8noklaV@t=O*JbwrVp)`j9Kq^w#YD1QhrbaeKdAw)`PU4O#`&hhA0f-#|s7?S}}J=YluPMlfQ(}EX&ZWDTQw~ zn;?Yes7{iEFL96x%Cf2gp3|RzU4$Vjq|u0B0D^vwG=JU&9@vZruqh|-5M$RHm2Z0w z3D5)O;}UHYCPp2>@~__Bu$Fq?fHp=qC`+rdRoBP_QaR_ihHhG8zZkc;dxv>H&pAXR z2l!?X02?v>w=`Xovc<+MLgH%rhk2KCq*Jg^oP7EoZAN0wt6I~tyO6G`F1*y5>- z)>)cDsy%c6dcB@aGY@kS&lBgGbZu=70>C~P46rEhU}7*#dGJaIVAv$?!Sf#-9c}50 S=0cGG0000gs3$0_El9-QC^SCoSOM;O_43?HInr0001uNklHpf~Q@OsT!7&j*^xRW@wUErI|$`@Wrt3L2Dxc!fq(!2002ovPDHLkV1jCidFcQE