Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 1.38 KB

File metadata and controls

20 lines (14 loc) · 1.38 KB

Packet Constructor

Welcome to the CakeMC Packet Constructor! This project provides a flexible and efficient system for handling packet encoding and decoding with custom packet formats, making it easy to build and manage network packets for your applications.

📦 Features

  • Dynamic Packet Handling: Supports multiple packet types with dynamically defined fields.
  • Custom Format: Easy-to-use, compact custom format for defining packet structures.
  • Builder Pattern: Construct packets with a simple and fluent builder API.
  • Automatic Response Handling: Every packet automatically includes a responseId.
  • Type Safety: Ensures proper type validation when constructing packets.
  • Supports Multiple Data Types: Works with various primitive types (int, short, byte, long, float, double, boolean, char, String).

⚙️ How It Works

The CakeMC Packet Constructor uses a custom packet format defined by a compact and flexible text-based structure. The system enables easy packet creation, encoding, and decoding. Here's how it works:

  1. Define Packet Structure: Packet types and their fields are defined in a custom format.
  2. Build Packet: Use the PacketBuilder API to create packets by specifying field values.
  3. Encode and Decode: The packet is then encoded into a byte array for transmission and decoded back to its original structure.