Skip to content

v1.8-PRE-1

Pre-release
Pre-release
Compare
Choose a tag to compare
@retrooper retrooper released this 25 Jan 12:07

CHANGELOG

The official release of PacketEvents 1.8 is very near. We only need to finish the official guide, finish documenting the API and make sure PacketEvents 1.8 will be as bug-free as possible.
We are doing our best to have 1.8 be stable unlike most previous releases.
This is a pre release, meaning it might NOT be production ready.
Thank you to all users that have been frequently updating to the dev builds to help us fix all the bugs and improve the API.
We would really appreciate if you read this changelog as a lot of effort is put into our changelogs.
A couple of users end up discovering new features and get surprised that they have been added many versions ago.
The changelog is a summary of the changes, we'd like to let you know that this pre release is just under 200 commits ahead of the last release! (1.7.9)

BUG FIXES

  • Cancelling events in the PacketListenerDynamic works again.
  • Internal netty early injector bug fixes.
  • WrappedPacketInAbilities#isFlying fixed for 1.16
  • Couple of ClientVersion resolving bugs fixed.

NEW FEATURES

NEW WRAPPERS / NEW WRAPPER FEATURES

  • WrappedPacketInUseEntity#getHand added.
  • WrappedPacketOutOpenWindow added. (NOT SENDABLE)
  • WrappedPacketInEnchantItem added.
  • WrappedPacketInSpectate added.
  • WrappedPacketInSetCreativeSlot added by @NikV2 .
  • WrappedPacketInTeleportAccept added by @Tecnio .
  • WrappedPacketInItemName added by @Tecnio .
  • WrappedPacketInPickItem added by @Tecnio .
  • WrappedPacketInBeacon added by @Tecnio .
  • WrappedPacketOutChat(BaseComponent, ChatPosition, UUID) created. (support for hoverable messages in the wrapper)

OTHER NEW FEATURES

  • NMSPacket class created.
  • ClientVersion#isPreRelease added.
  • PacketType.Play.Server.NAMED_ENTITY_SPAWN added by @LIWKK

OPTIMIZATIONS

  • Wrapper internal field caching improved.
  • Internal channel caching improved.
  • Internal packet and event processing optimized.
  • Dynamic wrapper loading, PacketEvents won't load every single wrapper.
    As soon as you use a wrapper for the first time, that is when PacketEvents will load that wrapper.
    Leading to faster PacketEvents load times and lower memory usage.
  • Dynamic event system optimized. (WARNING, registering listeners is NOT thread safe)
  • Legacy event system minimally optimized (STILL unrecommended to use)
  • Injection system improved/optimized.
  • WrappedPacketOutAnimation cleaned up and optimized.

CHANGES

  • TinyProtocol removed, wrote my own similar injector (same approach as TinyProtocol).

  • PostPlayerInjectEvent is no longer always called asynchronously. PostPlayerInjectEvent#isAsync will let you know if it has been called on the main thread or not.

  • PacketEvents instance accessor method renamed.
    PacketEvents.getAPI() has been deprecated for now.

PacketEvents.getAPI() -> PacketEvents.get()
  • Added jetbrains annotations dependency with scope "compile" to use the Nullable and NotNull annotation.
  • Renaming/Refactoring...
PacketType.Client -> PacketType.Play.Client
PacketType.Server -> PacketType.Play.Server
-
PacketType.Login split up into:
PacketType.Login.Client
PacketType.Login.Server
-
PacketType.Status split up into:
PacketType.Status.Client
PacketType.Status.Server

PacketReceiveEvent -> PacketPlayReceiveEvent
PacketSendEvent -> PacketPlaySendEvent

PacketLoginEvent -> PacketLoginReceiveEvent & PacketLoginSendEvent

PacketStatusEvent -> PacketStatusReceiveEvent & PacketStatusSendEvent

PacketListenerDynamic#onPacketReceive -> PacketListenerDynamic#onPacketPlayReceive
PacketListenerDynamic#onPacketSend -> PacketListenerDynamic#onPacketPlaySend

PacketListenerDynamic#onPacketLogin -> PacketListenerDynamic#onPacketLoginReceive & PacketListenerDynamic#onPacketLoginSend

PacketListenerDynamic#onPacketStatus -> PacketListenerDynamic#onPacketStatusReceive & PacketListenerDynamic#onPacketStatusSend

PacketListenerDynamic#onPostPacketReceive -> PacketListenerDynamic#onPostPacketPlayReceive
PacketListenerDynamic#onPostPacketSend -> PacketListenerDynamic#onPostPacketPlaySend

Please check the example repository linked at the very bottom, I have not listed all renames/refactors. Hopefully the example will help you, otherwise make an issue on the GitHub repository or ask in the discord server.

  • Cleaned up the built-in events with better abstraction.
    All events relating to packets extend NMSPacketEvent or CancellableNMSPacketEvent (depends if they support cancelling)
  • PacketEvents supporting multiple plugins shading the same API under ONE condition. The PacketEvents version of the plugins must be the SAME for them to be compatible and for you to avoid ClassLoader issues.
  • PacketEventPriority is now an enum and contains enum constants instead of byte constants.
    The legacy event system still uses bytes. To access the byte value of an enum constant in the PacketEventPriority enum use the getPriorityValue method.
  • NMS Entity cache accessing fixed for mSpigot and its forks by @LIWKK .

EXAMPLE USAGE

View packetevents-example source code for 1.8-PRE-1