Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various issues #21

Merged
merged 16 commits into from
Aug 29, 2024
Merged

Fix various issues #21

merged 16 commits into from
Aug 29, 2024

Conversation

Lyfts
Copy link
Member

@Lyfts Lyfts commented Jul 30, 2024

This attempts to fix a lot of problems such as:

  1. Previously ignoreSetSlot was basically always active client-side when ticking hotswap was enabled & the offhand was active. Since we only need to block that packet in very specific cases the check has been moved serverside and made a lot more selective. This also saves us from sending 2 packets to tell the client to ignore it + the one we're ignoring every tick. This fixes Inventory bugs #20, fixes Visual glitch when clearing inventory (1.5.3-pre) #16, fixes Display issue when using totem of undying and tinted arrows from EFR #11 (Not 100% sure but I can't reproduce anymore)

  2. Any block that had the method onBlockActivated() used to be blocked from being harvested, having that method doesn't necessarily mean that the player will interact with it though. To fix that I stole the fake player & fake world from BlockRenderer6343 and use that to simulate onBlockActivated() clientside. I have tested it with a number of blocks that can activate and it seems to work as expected but it's very possible that there are some cases where it won't. (This affected a ton of blocks from https://www.curseforge.com/minecraft/mc-mods/artifice & likely a lot of other mods)

  3. Ticking hotswap has been changed to use the actual offhand ItemStack rather than a copy. This fixes Some items do not update quantity after use (visual only) 1.5.3-pre #15

  4. The arrow hotswap has been changed to check the BlockDispenser.dispenseBehaviorRegistry rather than check specifically for vanilla/EFR arrows. This should in theory allow us to support a lot more arrows/projectiles from other mods but has the funny side effect of hotswapping if you are using a bow in mainhand + armor (and a few other things) in the offhand, this doesn't affect gameplay and the bow will act as normal.

On top of that a few unused mixins have been removed & some static variables that the server used to track player specific states have been moved into OffhandExtendedProperty.

@Lyfts Lyfts requested review from Caedis and a team July 30, 2024 17:25
@Lyfts Lyfts requested a review from a team August 2, 2024 19:48
@Lyfts Lyfts linked an issue Aug 3, 2024 that may be closed by this pull request
Copy link
Member

@Caedis Caedis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Been working fine in my playthrough

@Lyfts Lyfts merged commit 33f87d0 into master Aug 29, 2024
1 check passed
@Lyfts Lyfts deleted the various-fixes branch August 29, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment