packetevents

PacketEvents is emerging as a strong contender in the realm of Minecraft packet processing libraries. Designed to simplify packet manipulation while delivering high performance, this powerful tool aims to demystify the complexities of projects utilizing packets.

GPL-3.0 License

Stars
515
Committers
88

Bot releases are hidden (Show)

packetevents - 1.8-pre-13

Published by retrooper over 3 years ago

CHANGELOG

Please remember this is only a summary of the changes, I won't list every single change to keep this readable.

IMPORTANT NOTES

Make sure you set load in your plugin.yml to POSTWORLD!
Setting load to STARTUP will cause users with late-bind enabled to run into issues.

...
load: POSTWORLD
...

BUG FIXES

  • NPC despawning.

NEW FEATURES

  • WrappedPacketOutEntityEffect created.
  • WrappedPacketOutRemoveEntityEffect created.
  • WrappedPacketInArmAnimation created.

OPTIMIZATIONS

  • Packet Type system optimized.

CHANGES

  • All wrapper getters/setters that used to throw UnsupportedOperationExceptions when they were accessed on server versions they weren't supported on now return an Optional. It should be much clearer for developers using the PacketEvents API when a field is NOT supported on all server versions.

EXAMPLE USAGE

None available

packetevents - 1.8-pre-12

Published by retrooper over 3 years ago

CHANGELOG

Please remember this is only a summary of the changes, I won't list every single change to keep this readable. I only specify the most important changes.

IMPORTANT NOTES

Make sure you set load in your plugin.yml to POSTWORLD!!! Or just don't specify anything as its default value is POSTWORLD.
Not doing this will break late-bind support.

...
load: POSTWORLD
...

BUG FIXES

  • Late/Compatibility injector fixed. (broken since pre-10 update)
  • Finally added late-bind support, but it still might break if some other packet-based plugins are present.

CHANGES

  • WrappedPacketOutPlayerInfo now accepts arrays, we don't support lists anymore.
  • PacketEventsSettings#backupServerVersion deprecated, use PacketEventsSettings#fallbackServerVersion

OPTIMIZATIONS

  • Internal injector cleanup.

EXAMPLE USAGE

Example for packetevents-1.8-pre-12

packetevents - 1.8-pre-11

Published by retrooper over 3 years ago

CHANGELOG

Please remember this is only a summary of the changes, I won't list every single change to keep this readable. I only specify the most important changes.

BUG FIXES

  • All CustomPayload wrappers' getData() methods can be used outside of the netty thread, under one condition. You need to call its "retain" method while on the netty thread, and once you are done using it on your custom thread you "release" it. Or you might aswell just process the packet on the netty thread.
  • Java 16+ incompatibilities fixed.
  • Few plugins with custom NMS Player Connection classes should now work.(For example for NPCs)

CHANGES

  • PacketListenerDynamic is deprecated, PacketListenerAbstract is the new class.

OPTIMIZATIONS

  • Internal optimizations and cleanup.

EXAMPLE USAGE

Example for packetevents-1.8-pre-11

packetevents - 1.8-pre-10

Published by retrooper over 3 years ago

CHANGELOG

Please remember this is only a summary of the changes, I won't list every single change to keep this readable. I only specify the most important changes.

BUG FIXES

  • Few concurrent modification exceptions fixed.
  • All injector bypasses
  • WrappedPacketOutBlockChange broken on 1.7.10 fixed.
  • Reloading should be working. We won't claim to officially support it. You can expect bugs when reloading.
  • Packet ID issues with some obfuscators fixed.

NEW FEATURES

  • NPCManager created to store your NPCs.
  • WrappedPacketOutEntityHeadRotation created.
  • WrappedPacketOutEntityTeleport created.
  • WrappedPacketOutEntityDestroy created, thanks @yanjulang .

CHANGES

  • We give a warning when late-bind is enabled on older versions of minecraft. It breaks a ton of plugins and we do not support it.

OPTIMIZATIONS

  • Cleaned up injectors.
  • Players are no longer ejected when they leave the server.
  • Internal cleanups and reflection caches thanks @terrarier2111 .

EXAMPLE USAGE

Example for packetevents-1.8-pre-10

packetevents - 1.8-pre-9

Published by retrooper over 3 years ago

CHANGELOG

Please remember this is only a summary of the changes, I won't list every single change to keep this readable. I only specify the most important changes.

IMPORTANT NOTES

  • You need to soft-depend ProtocolLib, ViaVersion and ProtocolSupport in your plugin. (if you are shading PacketEvents)
  • You are recommended to make your plugin load at server STARTUP, not POSTWORLD.
    Example plugin.yml
name: myplugin
version: 1.0.0
main: me.opdeveloper.myplugin.MainClass
load: STARTUP
author: myname
softdepend:
  - ProtocolLib
  - ProtocolSupport
  - ViaVersion

BUG FIXES

  • Early injector now supports Java 12 and above.
  • Early injector will automatically revert to the compatibility/late injector if it fails.(and warn you in the console that it failed)
  • WrappedPacketInEntityAction issues on spigot 1.8.0 fixed.

NEW FEATURES

  • WrappedPacketOutPlayerInfo created.
  • WrappedPacketOutNamedEntitySpawn created.
    (CREATING AND MOVING NPCS is now possible)
  • WrappedPacketOutEntity.WrappedPacketOutEntityLook created
  • WrappedPacketOutEntity.WrappedPacketOutEntityMove created,
  • WrappedPacketOutEntity.WrappedPacketOutRelEntityMoveLook created

CHANGES

  • PacketEvents#init() no longer requires a plugin instance. Old function with the plugin instance argument is now deprecated.

EXAMPLE USAGE

Example for packetevents-1.8-pre-9

packetevents - 1.8-pre-8

Published by retrooper over 3 years ago

CHANGELOG

Please remember this is only a summary of the changes, I won't list every single change to keep this readable. I only specify the most important changes.

IMPORTANT NOTES

  • You need to soft-depend ProtocolLib, ViaVersion and ProtocolSupport in your plugin. (if you are shading PacketEvents)
  • You are recommended to make your plugin load at server STARTUP, not POSTWORLD.
    Example plugin.yml
name: plugin-name
version: 1.0.0
main: package.MainClass
load: STARTUP
author: username
softdepend:
  - ProtocolLib
  - ProtocolSupport
  - ViaVersion

BUG FIXES

  • All PacketType IDs are now final, you can use them in switch statements again!

EXAMPLE USAGE

Example for packetevents-1.8-pre-8

packetevents - 1.8-pre-7

Published by retrooper over 3 years ago

CHANGELOG

Please remember this is only a summary of the changes, I won't list every single change to keep this readable. I only specify the most important changes.

IMPORTANT NOTES

  • You need to soft-depend ProtocolLib, ViaVersion and ProtocolSupport in your plugin. (if you are shading PacketEvents)
  • You are recommended to make your plugin load at server STARTUP, not POSTWORLD.
    Example plugin.yml
name: plugin-name
version: 1.0.0
main: package.MainClass
load: STARTUP
author: username
softdepend:
  - ProtocolLib
  - ProtocolSupport
  - ViaVersion

BUG FIXES

  • Pretty rare ConcurrentModificationExceptions when accessing an Entity in a wrapper.
  • Reloading support added(NOT RECOMMENDED)

NEW FEATURES

  • PacketEvents ASYNCHRONOUS loading. You can now load asynchronously.
PacketEvents#loadAsync(ExecutorService)

or

PacketEvents#loadAsyncNewThread()
  • Most wrappers that contain an Entity getter, will now have a second Entity getter, but with a World argument. This can potentially allow faster entity resolving. If the entity wasn't found in the specified world, it will be searched for in all other worlds.
    For example:
@Override
public void onPacketPlayReceive(PacketPlayReceiveEvent event) {
    Player player = event.getPlayer();
    byte packetID = event.getPacketId();
    if (packetID == PacketType.Play.Client.USE_ENTITY) {
       WrappedPacketInUseEntity useEntity = new WrappedPacketInUseEntity(event.getNMSPacket());
       Entity entity = useEntity.getEntity(player.getWorld());
    }
}
  • WrappedPacketOutBlockBreakAnimation created
  • WrappedPacketOutUpdateAttributes created

CHANGES

  • PacketType IDs in different states will never have the same value. For example if you accidentally use a PacketType.Status ID on a Play event, you shouldn't get weird results. Nothing will call. Each ID is unique. Do not try to hardcode the ID values, use the variables.

EXAMPLE USAGE

Example for packetevents-1.8-pre-7

packetevents - 1.8-pre-6

Published by retrooper over 3 years ago

CHANGELOG

Please remember this is only a summary of the changes, I won't list every single change to keep this readable. I only specify the most important changes.

IMPORTANT NOTES

  • You now need to soft-depend ProtocolLib, ViaVersion and ProtocolSupport in your plugin(if you are shading PacketEvents)
  • You are recommended to make your plugin load at server STARTUP, not POSTWORLD.
    Example plugin.yml

BUG FIXES

  • ProtocolSupport incompatibilities fixed
  • Other minor bug fixes

NEW FEATURES

  • WrappedPacketOutBlockChange now supports org.bukkit.Material instead of illogical Block IDs.
  • WrappedPacketInBoatMove created by @Tecnio
  • WrappedPacketInDifficultyChange created by @Tecnio
  • WrappedPacketInDifficultyLock created by @Tecnio
  • WrappedPacketOutOpenWindowHorse created by @Tecnio , finished by me
  • WrappedPacketOutUnloadChunk created by @Tecnio , finished by me

OPTIMIZATIONS

  • Code cleanup

CHANGES

  • PacketListenerDynamic#onPacketHandshakeReceiveEvent renamed to PacketListenerDynamic#onPacketHandshakeReceive

EXAMPLE USAGE

Example for packetevents-1.8-pre-6

packetevents - 1.8-pre-5

Published by retrooper over 3 years ago

CHANGELOG

Please remember this is only a summary of the changes, I won't list every single change to keep this readable. I only specify the most important changes.

IMPORTANT NOTES

  • You now need to soft-depend ProtocolLib, ViaVersion and ProtocolSupport in your plugin(if you are shading PacketEvents)
  • You are recommended to make your plugin load at server STARTUP, not POSTWORLD.
    Example plugin.yml

BUG FIXES

  • Early injector "Failed to inject" issue fixed!
  • PlayerAction returning wrong values on 1.7.10 fixed by @LIWKK
  • PacketEvents not loading on 1.7.10 fixed by @LIWKK
  • Rare concurrent modification exception when accessing entity in most wrappers really fixed this time.
  • Accessing player ping NPE fixed.
  • Many more bug fixes in multiple wrappers.

NEW FEATURES

  • WrappedPacketOutEntityMetadata created by @DragonHunt3r (UNTESTED)
  • WrappedPacketOutSetSlot created by @AoElite
  • WrappedPacketOutBlockChange created
  • All wrappers now have setters, allowing you to modify packets easily(Not so tested).
  • ByteBufUtil#setBytes created by @terrarier2111 (Used internally)

OPTIMIZATIONS

  • ServerUtils OS lookup optimized by @terrarier2111

CHANGES

  • Many PacketEvents settings removed, a lot of them were to account for flaws in the injector.
  • PacketEvents no longer uses ProtocolLib as a dependency to resolve player client versions.

EXAMPLE USAGE

Example for packetevents-1.8-pre-5

packetevents - 1.8-pre-4

Published by retrooper over 3 years ago

CHANGELOG

BUG FIXES

  • Rare concurrent modification exceptions when registering packet listeners fixed.
  • WrappedPacketOutChat bug fix when compiled on a different java version.
  • Random "lol" debug removed since last pre-release.

NEW FEATURES

  • Injection rescheduling is now toggleable. The last pre-release would re-inject when an injection failed by default. This had one down-side. PacketEvents won't be able to detect client-versions without any dependencies if it ever has to re-inject. Re-injection would usually be required if a user joined while the server was still booting up. If you don't care about client-versions, you are recommended to enable this setting. It is disabled by default FYI.
  • Registering listeners is now thread safe!
  • WrapperUnsupportedUsageException exception will be thrown whenever you attempt to use a packet-wrapper which happens to be unsupported on the local server version. Its stacktrace will explain the wrapper you attempted to use, but it won't mention what versions that wrapper is supported on. Decompile the class/view the documentation to check what versions it is supported on.

OPTIMIZATIONS

  • WrappedPacketInBlockDig optimized by @True-cc
  • WrappedPacketInBlockPlace optimized by @True-cc
  • WrappedPacketInUpdateSign optimized by @True-cc
  • Internal NMS utils cleaned up by @True-cc

CHANGES

  • You can no longer un-register packet event listeners.
packetevents - 1.8-pre-3

Published by retrooper over 3 years ago

CHANGELOG

BUG FIXES

  • ClientVersion#isPreRelease bug fix by @terrarier2111
  • Before PacketEvents used to kick users, because it "Failed to inject" them. This would usually occur when users join while the server is starting. We have FIXED this. We will schedule a re-injection a bit later(one second), and with our testing, it seems to work! You are now able to configure the action PacketEvents should do when the re-injection fails(should never be the case, unless there are incompatibilities). By default PacketEvents will kick the user.
    Example of how to modify the action: https://github.com/retrooper/packetevents-example/blob/master/src/main/java/Main.java#L35

NEW FEATURES

  • WrappedPacketOutChat(BaseComponent, UUID) constructor added.

  • WrappedPacketOutNamedSoundEffect wrapper finished(NOT sendable yet).

  • WrappedPacketInBlockPlace#getCursorX, WrappedPacketInBlockPlace#getCursorY, WrappedPacketInBlockPlace#getCursorZ added by @Tecnio
    WARNING: These methods are only supported on 1.7.10 up to 1.8.8 versions of minecraft as newer versions no longer give us this data.

  • WrappedPacketOutPosition finished, new methods added. You can now check if the values in the wrapper are relative or absolute.

  • You can now filter out what packets get called in your packet listener.(NOT SUPPORTED ON LEGACY EVENT SYSTEM/legacy packet listener).
    Doing this might noticeably improve performance of your plugin.
    Learn how to use this new feature by viewing this example: https://github.com/retrooper/packetevents-example/blob/master/src/main/java/Main.java#L69

  • PacketListenerDynamic#onPacketEventExternal added. Since the PacketListenerDynamic has a method for every in-built event. You might ask how can I use a custom event created using the PacketEvents event system. You can use the PacketListenerDynamic#onPacketEventExternal. It is only fired for external events, events that aren't built into the PacketEvents API!

OPTIMIZATIONS

  • WrappedPacketInEntityAction optimized and cleaned up.
  • ClientVersion cleaned up by @terrarier2111

CHANGES

  • Direction enum import changed.
    Direction.OTHER is when the face is equal to 255(check wiki.vg/Protocol for more information)
    Direction.INVALID is when the face is not recognized. The user might be cheating or might be a new protocol change? Not sure?
  • PacketListenerDynamic#onPacketEvent used to be a method called for every single event, allowing you to do "instanceof" checks to use your target event, but this feature is useless due to how little events we have. We removed it to help improve performance, we also realized that barely anyone used this feature.

EXAMPLE USAGE

View packetevents-example source code for 1.8-pre-3

packetevents - 1.8-PRE-2

Published by retrooper over 3 years ago

CHANGELOG

This pre-release mainly focussed on fixing bugs.
Again, this is intentionally marked as a pre-release as it MIGHT not be production-ready. Updating to the pre-releases can help us spot more bugs until the 1.8 release. Help us make 1.8 stable! Till now

BUG FIXES

  • Fixed ping being 0 on extremely laggy players.
  • ServerVersion comparisons falsing on server versions with the same protocol version (for example 1.16.4 and 1.16.5) FIXED.

NEW FEATURES

  • You are now given the control to perform update checks.
    The update check will run on the current thread you are on.
UpdateChecker.UpdateCheckerStatus  status = PacketEvents.get().getUpdateChecker().checkForUpdate(); 
switch (status) {
        //Your build is outdated, an update is available.
        case OUTDATED: 
                break;
        //You are on a dev or pre-released build. Not on the latest release. Your build is newer than the latest release.
        case PRE_RELEASE:
                break;
        //Your build is up to date.
        case UP_TO_DATE:
                break;
        //Failed to check for an update. There might be an issue with your connection. 
        case FAILED:
                break;
}

OPTIMIZATIONS

  • Cleanup to internal packet processor by @terrarier2111
  • We now create a temporary thread for the update check (as the server starts) as we no longer need that thread after the update check.
    We don't perform any updates after that.
  • Cleaned up a few wrappers and sped up load times for a couple of wrappers.

CHANGES

  • Usage of the direction/face in wrappers changed.
    Wrappers now return the face as a byte.
    You can now use the Direction class to find out the face.
    Example:
WrappedPacketInBlockPlace blockPlaceWrapper = new WrappedPacketInBlockPlace(event.getNMSPacket());
byte face = blockPlaceWrapper.getDirection();
if (face == Direction.DOWN) {
       //Face is down
}

You can check the Direction class to see what faces exist.

  • ServerVersion#isNewerThan, ServerVersion#isNewerThanOrEquals, ServerVersion#isOlderThan, ServerVersion#isOlderThanOrEquals created, other comparison methods DEPRECATED.
ServerVersion#isHigherThan -> ServerVersion#isNewerThan
ServerVersion#isHigherThanOrEquals -> ServerVersion#isNewerThanOrEquals
ServerVersion#isLowerThan -> ServerVersion#isOlderThan
ServerVersion#isLowerThanOrEquals -> ServerVersion#isOlderThanOrEquals
  • ClientVersion#isNewerThan, ClientVersion#isNewerThanOrEquals, ClientVersion#isOlderThan, ClientVersion#isOlderThanOrEquals created, other comparison methods DEPRECATED.
ClientVersion#isHigherThan -> ClientVersion#isNewerThan
ClientVersion#isHigherThanOrEquals -> ClientVersion#isNewerThanOrEquals
ClientVersion#isLowerThan -> ClientVersion#isOlderThan
ClientVersion#isLowerThanOrEquals -> ClientVersion#isOlderThanOrEquals

EXAMPLE USAGE

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

packetevents - v1.8-PRE-1

Published by retrooper over 3 years ago

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

packetevents - v1.7.9

Published by retrooper almost 4 years ago

CHANGELOG

I tried to prioritize bug fixes rather than new features to prevent the creation of new bugs in this update.
I tested everything and everything should be working fine!

BUG FIXES
  • Cached Entity Not Found when accessed in wrappers FIXED
  • ClientVersion was unresolvable for 1.16.3 and 1.16.4 clients FIXED
  • PacketEvents failing to inject you and doesn't call any events for your player (RARE BUG) fixed.
    This bug could only happened if you had injectEarly set to true.
  • PacketEvents' version lookup utilities now prioritizes ViaVersion, then ProtocolLib and then lastly ProtocolSupport.
    There was a bug where ProtocolSupport errored if PacketEvents used it for the protocol version lookup.
  • UpdateChecker not working FIXED
NEW FEATURES
  • PostPlayerInjectEvent created, this event is fired after the ClientVersion gets resolved.
    The event contains the client version and the netty channel object.
    The event is always called synchronously and it is recommended to register all your player data in this event.
packetevents - v1.7.8

Published by retrooper almost 4 years ago

CHANGELOG

INFO
  • The PacketEvents.getSettings().useProtocolLibIfAvailable(boolean) setting is most likely not be coming back.
  • Recommended to have ViaVersion, ProtocolSupport or ProtocolLib on your spigot server, as PacketEvents makes use of them to resolve client version ONLY if they are available.
NEW FEATURES
  • Official 1.16.4 support
    ClientVersion.v_1_16_4, ServerVersion.v_1_16_4 created
BUG FIXES
  • Bungee client version resolving bug fixed
    One of the recommended dependencies(ViaVersion, ProtocolSupport, ProtocolLib) are only required on the spigot server if you have a bungee network.
  • Interruption of PacketEvents.stop() protected(Two plugins calling the method will no longer break PacketEvents)
packetevents - v1.7.7

Published by retrooper almost 4 years ago

Changelog

BUG FIXES

  • Accessing Entity by ID on servers with more than one world ERROR FIX
  • Possibly cleared console error spam on player injection failures, by handling the exception and kicking the player instead.(Fix only for developers with the "earlyInject" setting disabled)

CHANGES/FEATURES

  • In the WrappedPacketOutChat(String, ChatPosition, UUID) constructor, the String(=message) shouldn't be passed in JSON string format, it can be passed in as an ordinary string message!
    Example:
WrappedPacketOutChat packet = new WrappedPacketOutChat("Hello", ChatPosition.CHAT, uuid);
packetevents - v1.7.6

Published by retrooper almost 4 years ago

Changelog

Bug fixes

  • Resolving ClientVersion on BungeeCord servers fixed.

New Custom Exceptions

  • PacketEventsLoadFailureException exception thrown if PacketEvents fails to load.
  • PacketEventsMethodAccessException exception thrown if PacketEvents fails to access a method of a PacketListener for invoking.
  • PacketEventsMethodInvokeException exception thrown if an exception is thrown from the invoked method in the PacketListener.
  • PacketEventsNMSCachedEntityNotFoundException exception created and is thrown when the cached entity in an “Entity By ID” lookup isn’t found.
    Can be thrown when accessing entity in multiple different wrappers, like the WrappedPacketInUseEntity#getEntity().

New Features

  • PacketListenerDynamic, you can now register listeners differently and more dynamically.
PacketListenerDynamic listener= new PacketListenerDynamic(PacketEventPriority.NORMAL) {
            @Override
            public void onPacketReceive(PacketReceiveEvent event) {
                if(event.getPacketId() == PacketType.Client.CHAT) {
                    event.getPlayer().sendMessage("You sent a message!");
                }
            }
        };
        PacketEvents.getAPI().getEventManager().registerListener(listener);

Why should you switch?
The previous system is much slower than this new system as we are forced to use reflection to cal your methods.
The previous system didn’t call the event methods in any order, this new system calls the lowest priorities first and the highest priorities last.

Deprecations

  • The previous packet listening system, it is recommended to slowly start switching to the new system.
    The new system performs much faster, is cleaner, overall better.

Removed

  • PacketEvents.getSettings().useProtocolLibIfAvailable(boolean) temporarily removed, currently unsupported, so has been removed.
    Expect it to be back in the next update.
  • ViaVersion and ProtocolSupport ClientVersion lookup utils removed.
packetevents - v1.7.5

Published by retrooper almost 4 years ago

Changelog

  • WrappedPacketInBlockPlace#getX,Y,Z returning -1 on 1.8 servers FIXED.
packetevents - v1.7.4

Published by retrooper almost 4 years ago

Changelog

  • Direction enum cleaned up, unneeded enum constant values removed.
  • NullPointerException with the Player in PacketSendEvent FIXED.
  • WrappedPacketInBlockDig getX(), getY(), getZ() not working FIXED.
  • WrappedPacketInBlockDig.getDirection() optimized and now works on 1.7.10.
    FYI the direction is also known as the block face.
  • WrappedPacketInBlockPlace#getX(), getY(), getZ() not working FIXED.
  • WrappedPacketInBlockPlace#getItemStack() removed as the itemstack field doesn't exist in newer versions.
    Legacy packetevents was lazily coded and actually used a block iterator to find the block you are looking at.
    I now removed the field as we cannot have full cross version compatibility with the method.
    If you don't want to be supporting the newer versions, use my wrapper creation utilities to access it yourself.
  • WrappedPacketInBlockPlace#getDirection() added
  • WrappedPacketInUpdateSign#getX(), getY(), getZ() not working FIXED.
  • WrappedPacketInUpdateSign#getTextLines() errors FIXED.
  • WrappedPacketOutHeldItemSlot wrapper created.(Basically change player's current selected slot)
  • Incompatibility and errors with paper(1.16.x) fixed.
  • PacketEvents.getSettings().packetHandlingThreadCount(int) setting added.
    It lets you decide how many threads PacketEventsshould use when asynchronously injecting/ejecting players, processing packets(PacketEvents' end) and event calling(processing on your end).
    PacketEvents' current default settings are the most recommended settings.
    Having more than one thread doing all that processing might cause you (or PacketEvents, as that feature hasn't been tested that much) some concurrency issues where multiple threads are accessing/modifying the same data at the same time!
packetevents - v1.7.3

Published by retrooper almost 4 years ago

Changelog

  • Performance improvement when players leave
  • Fixed error when you leave the server
Related Projects