Update textures and prevent double shooting while async after is being executed

This commit is contained in:
Juraj Vajda 2023-04-25 13:45:26 -04:00
parent c901d9c204
commit 140c2ad467
14 changed files with 115 additions and 108 deletions

View File

@ -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 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 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES. 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

109
README.md
View File

@ -94,114 +94,7 @@ There are few indications on how to know when the bow shot arrow from quiver:
## License: ## License:
### Code - see included LICENSE.txt file
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
## Installation ## Installation

View File

@ -651,6 +651,11 @@ function XBows.shoot(self, itemstack, user, pointed_thing)
local tflp = (time_shoot - time_load) / 1000000 local tflp = (time_shoot - time_load) / 1000000
---@type ItemStack ---@type ItemStack
local arrow_itemstack = ItemStack(minetest.deserialize(meta:get_string('arrow_itemstack_string'))) 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_itemstack_meta = arrow_itemstack:get_meta()
local arrow_name = arrow_itemstack:get_name() local arrow_name = arrow_itemstack:get_name()
local is_arrow_from_quiver = arrow_itemstack_meta:get_int('is_arrow_from_quiver') 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 sound_name = x_bows_registered_bow_charged_def.custom.sound_shoot_crit
end 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 ---stop punching close objects/nodes when shooting
minetest.after(0.2, function() minetest.after(0.2, function()
local wield_item = user:get_wielded_item() local wield_item = user:get_wielded_item()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 594 B