Skip to content

Instantly share code, notes, and snippets.

@TheMode
Last active September 16, 2024 00:27
Show Gist options
  • Save TheMode/0ceedeefbb5d907ed4350fbca49d4d14 to your computer and use it in GitHub Desktop.
Save TheMode/0ceedeefbb5d907ed4350fbca49d4d14 to your computer and use it in GitHub Desktop.
Minestom 1.21.2 update

Breaking changes

  • Entity.Pose becomes EntityPose
  • Player.Hand becomes PlayerHand
  • Range has been reworked with all the number impl as subclasses (used for the command range argument)
  • RelativeVec has been made record, and package moved to coordinate
  • ChunkUtils has been broken down into CoordConversion and ChunkRange
  • Player.Settings becomes ClientSettings and immutable
  • Removed NotificationCenter in favor of Player.sendNotification
  • The chat format function has been removed in favor of PlayerChatEvent.setFormattedMessage

New utils

  • EntityStatuses listing... entity statuses. As listed there: https://wiki.vg/Entity_statuses
  • MetadataDef listing metadata access points. Differentiate itself from the current metadata API as it does not handle storage.

Networking

  • Packets are all registed in PacketRegistry with their ids and serializers
  • Packets serializer are exposed as static fields in their respective files
  • processImmediately packets are stored in PlayerSocketConnection, making packets file purely declarative
  • Use virtual threads for networking (no more Worker)
  • Remove BinaryBuffer
  • Use NetworkBuffer everywhere, removed ByteBuffer from all APIs
  • Make more use of NetworkBufferTemplate all over the codebase
  • Moved Viewable methods to PacketViewableUtils
  • Moved sendGroupedPacket/sendPacket(Audience, ServerPacket) to PacketSendingUtils
  • Separated packet reading/writing from PacketUtils into PacketReading and PacketWriting
  • Add PacketVanilla which hold some constants true for vanilla clients

Reworked NetworkBuffer with the following options:

  • Registries becomes a parameter
  • AutoResize allowing you to custom by how much a buffer should auto extend once full
  • Explicit resizable/static factory methods
  • Added write/readAt specific index
  • Removed all type reading methods (list, bitset, optional, etc...) in favor of constant NetworkBuffer.Types
  • Added NetworkBuffer.Type#sizeOf to help pre-size buffer before any allocation
  • (Internally) switch the backend from ByteBuffer to Unsafe allowing long indexes

World generation

Generator and IChunkLoader (when supporting parallel loading/saving), are now executed in a virtual thread.

JFR Monitoring

A few JFR events have been implemented. You can view the list in EventsJFR.

Dependencies

  • Removal of Caffeine which shouldn't have much of an impact, except that users are now responsible for caching MojangUtils results to avoid blocking operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment