DragonSurvivalTeam / DragonSurvival

Other
51 stars 39 forks source link

Add startDestroyBlock as another tool swapping injection #544

Closed MetaflameDragon closed 4 months ago

MetaflameDragon commented 4 months ago

Fixes #388

Previously, startDestroyBlock and continueDestroyBlock would trigger a block attack with two different items (an empty hand first, and the claw tool afterwards). My understanding is that this would cause attack() to fire twice on the target block, leading to bugs including Storage Drawers dropping two items. This makes both methods use the same held item.

MetaflameDragon commented 4 months ago

I'm not sure how updates to both 1.19 and 1.20 are handled - I hope a PR like this is enough to be used for both?

seelderr commented 4 months ago

We just cherry pick and manually tweak them

MetaflameDragon commented 4 months ago

I haven't been able to test this in multiplayer yet. I couldn't set up a local server for the love of me for some reason, kept crashing outside of the IDE; and Storage Drawers had packet issues within the IDE.

Assuming that startDestroyBlock behaves similarly to continueDestoryBlock in terms of networking, it should work fine though.

MetaflameDragon commented 4 months ago

Confirming that this works on a server too. (The testing environment was our somewhat-larger modpack.) This should be ready to merge, from my side at least.

BlackAures1 commented 4 months ago

We'll double-check that a little later. Make sure that mods like Ore Exavation or just enchantments don't stop working.