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

Fabric module refactor #1032

Merged
merged 29 commits into from
Oct 27, 2024
Merged

Fabric module refactor #1032

merged 29 commits into from
Oct 27, 2024

Conversation

booky10
Copy link
Collaborator

@booky10 booky10 commented Oct 20, 2024

Breaking changes

  • Nearly all packetevents fabric internals have been changed

Changes

  • Splits sources into client and common sources to prevent accidentally using client code
  • Sets up a PacketEvents api instance on both the client and server
  • Simplifies network pipeline injection and encoder/decoder handling
  • Uses proper SLF4J logger instead of System.out
  • Uses fabric access wideners for accessing player connection internals instead of reflection
  • Fixes PacketEvents Fabric Client issue #1025

Todo

  • Look at other platforms and search for stuff which could be missing
    • Associate platform player instance with connection channel
  • Testing on client and dedicated server
  • Find a way to create packetevents instances for singleplayer worlds (internal server; maybe using events other mods could listen to?)
    • Not possible without loading packetevents on an additional, separate classpath or removing usage of the static instance (which is used everywhere...)

Closes #1026
Closes #1027

@booky10 booky10 mentioned this pull request Oct 21, 2024
22 tasks
The behaviour of the fabric platform is a bit different here, as the player instance gets re-created on respawn
@booky10 booky10 marked this pull request as ready for review October 21, 2024 02:01
@booky10 booky10 marked this pull request as draft October 21, 2024 16:43
@booky10 booky10 marked this pull request as ready for review October 21, 2024 17:27
@Bram1903
Copy link
Contributor

@booky10 once again a great PR! Looks really good! Now I can add support for Fabric to my AntiHealthIndicator!

@Axionize
Copy link

I've worked with Booky to ensure this works. Can we please merge this into upstream so I don't have to maintain this upstream fork and have everyone who contributes to my project build packevents just to build my project?

@booky10 booky10 merged commit fc31b7d into retrooper:2.0 Oct 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PacketEvents Fabric Client issue
3 participants