You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vitalij edited this page Mar 14, 2014
·
2 revisions
Don't panic if a new version of Minecraft with new packets is released. Adding new packets is very simple.
Just mark is as IPacket and implement Id, ReadPacket and WritePacket
public struct YourPacket : IPacket
{
public *put here used objects*
public const byte PacketId = *Packet Id*;
public byte Id { get { return *Packet Id*; } }
public void ReadPacket(ref Wrapped stream)
{
*Read here your objects*
}
public void WritePacket(ref Wrapped stream)
{
stream.WriteVarInt(Id);
*Write here your objects*
stream.Purge();
}
}
Don't forget to add it in PacketResponse.cs in used section (Login, Status or Play) (position is important, put it in right place, see commented hex) for reading it from server.