Skip to content

Releases: retrooper/packetevents

v1.7.3

03 Nov 08:55
552f63a
Compare
Choose a tag to compare

Changelog

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

v1.7.2

02 Nov 15:30
8e652f0
Compare
Choose a tag to compare

Changelog

• PacketSendEvent accidentally called on a server list ping resulting Player to be null, corrected to be a PacketStatusEvent.
It is a good practice to check if the packet ID in the PacketReceiveEvent and PacketSendEvent isn't -1, and THEN start processing and access the player to be as error free as possible.
• WrappedPacketInVehicleMove wrapper created(packet only exists on 1.9+)

v1.7.1

01 Nov 07:19
d268224
Compare
Choose a tag to compare

Changelog

• Early player login bug fixed.
If you would join while the server was still starting, PacketEvents would spam errors, if you had early inject mode enabled. This has been fixed and you will be kicked and asked to rejoin in the kick reason.

v1.7

30 Oct 13:01
1d383a7
Compare
Choose a tag to compare

Changelog:

This changelog displays all changes since the last release(1.6.9).

These changes are listed from the oldest to the most recently added features/bug fixes.

I have not had the time to test every single feature, but I am very certain that a lot of things will work.
Make sure to report bugs as soon as you find them, so they can be fixed in a patch update.

All Changes Summarized:

• All deprecated methods since 1.6.9 have been cut off.
• The wrappers cache the fields efficiently for an even better performance experience. (Thanks to @terrarier2111)
• Usage of PacketEventsSettings changed.
Doing this is now possible:

PacketEvents.getSettings().injectAsync(true).ejectAsync(true).
useProtocolLibIfAvailable(true);

• Bug in WrappedPacketInWindowClick fixed.
• Cleaner errors, a few custom exceptions created(for example WrapperFieldNotFoundException) to help us spot bugs easier.
• WrappedPacketInArmAnimation removed as it was just a redundant wrapper, nothing to read.
• WrappedPacketOutGameStateChange "value" field accidentally returned the "reason" field.
• Finding entities by their ID optimized to use less reflection calls than necessary.
• WrappedPacketOutEntityMetadata created, for now only provides entity ID(so unfinished).
• WrappedPacketOutEntityTeleport wrapper created, performs best on 1.7-1.8.x.
Not recommended to use wrappers if it is possible with the Bukkit API as we will most likely be slower due to our reflection calls.
It is common that the required reflection calls of a field in a wrapper unfortunately increases every 3rd/4th minecraft update.
So wrappers perform best on 1.7.10 and 1.8.
• WrappedPacket now supports a nice util to write to fields.
Use this if a sendable wrapper you want to use does not exist yet.
• All wrappers optimized to only read the fields you access with its getter method.
For example, in the flying packet, if you only need access the xyz coordinates and nothing else, PacketEvents will not use reflection calls to redundantly read the other fields.
• Optimized ServerVersion enum, isHigherThan, isLowerThan.. with the ServerVersion have been optimized and are now not heavy at all, you no longer need to cache these things. (Thanks to @terrarier2111)
• Netty channel accessing (even when cached) optimized. (Thanks to @terrarier2111)
• Lots and lots of code cleanup. (Thanks to @terrarier2111)
• PacketEvents now calculates player ping independently with Keep Alive packets(we don't send any ourselves).
If you would still like to access NMS' calculated ping, now use:

PacketEvents.getAPI().getPlayerUtils().getNMSPing(Player);

The NMS ping is smoothed, so if you want a value close to NMS' calculations use:

PacketEvents.getAPI().getPlayerUtils().getSmoothedPing(Player);

• PostPacketReceiveEvent and PostPacketSendEvent created. (Not cancellable, they events assure you the relating event wasn't cancelled)
• Update checking uses the same thread pool that is used to inject players, eject players, and process events.
• WrappedPacketOutEntity can now be sent to players.
• BungeeCord support added(Check out the Bungee version)
• Vector3i utility class created
• PacketEvents auto resolve client version setting removed as it may cause falses and is now unneeded.
• PacketEvents now has a setting to use TinyProtocol and basically inject players earlier, so you won't need a dependency to resolve client versions.
• PacketLoginEvent created
• PacketStatusEvent created
• WrappedGameProfile utility class created
• Setting to inject earlier created(Basically if TinyProtocol should be used)
TinyProtocol allegedly has bugs when users join while the server is still starting, I will double check and test.
• New Setting to activate/deactivate TinyProtocol. If ViaVersion, ProtocolSupport or ProtocolLib is found, we will use their APIs to access their already resolved client version, so we don't have to. :)
This setting is enabled by default btw.

PacketEvents.getSettings().injectEarly(boolean);

• PacketType.Login.x and PacketType.Status.x Packet IDs created.
• All new login wrappers created:
WrappedPacketLoginDisconnect, WrappedPacketLoginHandshake, WrappedPacketLoginInCustomPayload(roughly since 1.13.2), WrappedPacketLoginInStart, WrappedPacketLoginOutEncryptionBegin, WrappedPacketLoginInEncryptionBegin, WrappedPacketLoginOutSetCompression(roughly since 1.8), WrappedPacketLoginOutSuccess
• All new status wrappers:
WrappedPacketStatusPing, WrappedPacketStatusPong
• The login and status event will only be triggered if you toggle on the early inject setting, as we need to inject early to listen to them.
• WrappedPacketOutExplosion created and can be sent to players.
• WrappedPacketOutEntityStatus created and can be sent to players.
• WrappedPacketOutExperience created and supports being sent to players.

v1.7 PRE RELEASE 2

04 Oct 07:20
4a4b7b0
Compare
Choose a tag to compare
v1.7 PRE RELEASE 2 Pre-release
Pre-release

Sadly no changelog for now, I might later edit this and post the changes.

v1.6.9

20 Sep 09:12
Compare
Choose a tag to compare

Changelog

  • Support 1.16.3 spigot(bugs for 1.16.3 fixed)
  • ClientVersion enum optimized, takes much less memory
  • ClientVersion#isHigherThan(ClientVersion) and ClientVersion#isLowerThan(ClientVersion) are very cheap to call now
  • ClientVersion resolving is faster
  • ClientVersion.v_1_16_1 and ClientVersion.v_1_16_2 protocol version corrected (Thanks to @LIWKK)
  • ClientVersion.v_1_16_3 added
  • PacketEvents.getVersion() function to get the local PacketEvents version (Thanks to @NikV2)
  • PacketEvents Update reporter added, that compares the local version to the latest RELEASED version
  • Auto update reporting togglable with a setting
boolean value = true;
PacketEvents.getAPI().getSettings().setShouldCheckForUpdates(value);
value = PacketEvents.getAPI().getSettings().shouldCheckForUpdates();
  • Player not injecting on second join FIXED
  • The netty channel cache is now functioning, we don't have to access it each time with reflection whenever we need it
  • Sending packets to players should be faster as we cache the netty channel and no longer use reflection to send packets
  • WrappedPacketOutCustomPayload wrapper added(supports sending to players)
  • WrappedPacket fields are now cached, so reading should be faster now

v1.6.8

16 Sep 18:21
Compare
Choose a tag to compare

Changelog

The changelog might be small, but a lot of work has been added to each change.

• Official 1.16.3 support(not everything has been tested)
• PacketType has been moved from io.github.retrooper.packetevents.packet.PacketType to io.github.retrooper.packetevents.packettype.PacketType
• Reflection usage optimized, packet wrappers are overall faster now, memory usage should be much lower now. (Thanks to @funkemunky)
• WrappedPacketOutGameStateChange wrapper created(supports sending to players)
• WrappedPacketInUpdateSign wrapper created
• Sending packets to players has been optimized, I no longer use reflection(Suggested by @funkemunky)
• New functions appended to WrappedPacketReader interface and implemented in WrappedPacket.

WrappedPacket wrapper = new WrappedPacket(object);
byte[] bArray = wrapper.readByteArray(0);
short[] sArray = wrapper.readShortArray(0);
int[] iArray = wrapper.readIntArray(0);
...
String[] strArray = wrapper.readStringArray(0);
Object[] array = wrapper.readObjectArray(0, MyClass.class);

• Setting to prevent PacketEvents from interacting with ProtocolLib if ProtocolLib is available added, some people experience issues with ProtocolLib.

PacketEvents.getAPI().getSettings().setUseProtocolLibIfAvailable(boolean)

To-Do for 1.6.9-1.7?

• Update Checker in PacketEvents letting you know if a new version of PacketEvents has been released
• WrappedPacketOutCustomPayload wrapper
• WrappedPacketOutEntityMetadata wrapper

v1.6.7

10 Sep 17:55
Compare
Choose a tag to compare

Changelog

• Creating wrappers is much easier, cleaner and shorter.
• Thread safety issues with the new event priority system fixed(didn't let users connect to the server)
• You can make your own mini wrappers, example:

@PacketHandler
public void onReceive(PacketReceiveEvent event) {
    if(event.getPacketId() == PacketType.Client.FLYING) {
        WrappedPacket miniWrapper = new WrappedPacket(event.getNMSPacket());

        double x = miniWrapper.readDouble(0);
        double y = miniWrapper.readDouble(1);
        double z = miniWrapper.readDouble(2);
        boolean onGround = miniWrapper.readBoolean(0);
    }
}

All current packet wrappers use these new functions ('readDouble', ect...).
So if a wrapper doesn't already exist, you can use these functions.
• Code cleanup in ALL wrappers
• WrappedPacketOutAbilities#getWalkSpeed() accidentally returned the value of WrappedPacketOutAbilities#getFlySpeed()
• WrappedPacketOutChat.fromStringToJSON() debug removed
• WrappedPacketOutKickDisconnect constructor now requires a json string, and doesn't convert for you
• WrappedPacketOutUpdateHealth#getFoodSaturation() accidentally returned the value of WrappedPacketOutUpdateHealth#getHealth()
• WrappedPacketOutEntity has subclasses, like rel entity move, ect...
• WrappedPacketInFlying subclasses no longer extend the WrappedPacketInFlying, they are now just static classes inside it, this will mean they won't contain all functions like WrappedPacketInFlying does, this was done just to avoid confusion.

v1.6.6.1

09 Sep 18:40
Compare
Choose a tag to compare

Changelog

• PacketEvents not enabling if ProtocolLib isn't present BUG FIX!

v1.6.6

09 Sep 17:55
Compare
Choose a tag to compare

Changelog

• Event priority system added(Passed onto ProtocolLib if ProtocolLib is present)
• PacketEvents uses ProtocolLib API to listen to packets if it is available.
This update should help making your plugins compatible with other plugins using the ProtocolLib API.
It is recommended to add 'ProtocolLib' as a soft dependency to your plugin now

What to expect in the next update?
• Better wrapper creation API, to make creating wrappers easier, especially for the contributors.
• Cleanup code, PacketEvents might not be too clean at the moment
• Test if sending packets breaks with ProtocolLib
• Create WrappedPacketOutCustomPayload wrapper
• Create WrappedPacketOutEntityMetadata wrapper