DragonSurvivalTeam / DragonSurvival

Other
49 stars 41 forks source link

[1.20.1 Bug]: Weapon in claw slot deleted when placing same tier weapon from hotbar on an item frame #617

Closed Jagkros closed 1 month ago

Jagkros commented 2 months ago

■ Your Discord ID or other contacts

voraciousdragon

■ Dragon Survival version

DragonSurvival-1.20.1-18.07.2024.jar

■ Forge/Neoforge version

Forge 47.3.0

■ Single game or server?

Self-made dedicated server

■ Describe the bug

Steps to reproduce:

  1. Place a weapon in your weapon claw slot.
  2. Place the same tier of weapon in your hotbar.
  3. Right click an item frame with your weapon selected on your hotbar.

If performed correctly, the weapon in your claw slot should have been deleted. The item from your hotbar should be on the item frame.

A member of mine reported this glitch to me. I thought I'd let the DS team know. Please let me know if you require more information.

■ Crash Report File and Logs

No response

Jagkros commented 2 months ago

image image image

SiverDX commented 2 months ago

apparently because of this

https://github.com/DragonSurvivalTeam/DragonSurvival/blob/7ee99859ed40edfe2fbf4e38a8edb7a1f3e73f7e/src/main/java/by/dragonsurvivalteam/dragonsurvival/common/handlers/magic/ClawToolHandler.java#L225

the event seems to be called when a player can interact with sth. and the interaction "consumes" the item

https://github.com/DragonSurvivalTeam/DragonSurvival/blob/7ee99859ed40edfe2fbf4e38a8edb7a1f3e73f7e/src/main/java/by/dragonsurvivalteam/dragonsurvival/common/handlers/magic/ClawToolHandler.java#L250

not sure what's a good way to do a check (since a copy is passed to the event and itemstack matches would eventually run into the same issue)

maybe that part is not needed anyway anymore due to the tool swap logic?

seelderr commented 1 month ago

Fixed in 5633993

Also added a sound when a claw tool is broken