-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
298 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
Components/MineSharp.Protocol/Packets/Clientbound/Play/ChunkBatchFinishedPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using MineSharp.Core.Common; | ||
using MineSharp.Data; | ||
using MineSharp.Data.Protocol; | ||
|
||
namespace MineSharp.Protocol.Packets.Clientbound.Play; | ||
|
||
/// <summary> | ||
/// The ChunkBatchFinished packet, used since 1.20.2. | ||
/// https://wiki.vg/Protocol#Chunk_Batch_Finished | ||
/// </summary> | ||
public class ChunkBatchFinishedPacket : IPacket | ||
{ | ||
/// <inheritdoc /> | ||
public PacketType Type => PacketType.CB_Play_ChunkBatchFinished; | ||
|
||
/// <summary> | ||
/// The batch size | ||
/// </summary> | ||
public int BatchSize { get; set; } | ||
|
||
/// <summary> | ||
/// Create a new ChunkBatchFinishedPacket instance | ||
/// </summary> | ||
/// <param name="batchSize"></param> | ||
public ChunkBatchFinishedPacket(int batchSize) | ||
{ | ||
this.BatchSize = batchSize; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public void Write(PacketBuffer buffer, MinecraftData version) | ||
{ | ||
buffer.WriteVarInt(this.BatchSize); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public static IPacket Read(PacketBuffer buffer, MinecraftData version) | ||
{ | ||
return new ChunkBatchFinishedPacket( | ||
buffer.ReadVarInt()); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
Components/MineSharp.Protocol/Packets/Clientbound/Play/ChunkBatchStartPacket.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using MineSharp.Core.Common; | ||
using MineSharp.Data; | ||
using MineSharp.Data.Protocol; | ||
|
||
namespace MineSharp.Protocol.Packets.Clientbound.Play; | ||
|
||
/// <summary> | ||
/// The ChunkBatchStart Packet, used since 1.20.2 | ||
/// https://wiki.vg/Protocol#Chunk_Batch_Start | ||
/// </summary> | ||
public class ChunkBatchStartPacket : IPacket | ||
{ | ||
/// <inheritdoc /> | ||
public PacketType Type => PacketType.CB_Play_ChunkBatchStart; | ||
|
||
/// <inheritdoc /> | ||
public void Write(PacketBuffer buffer, MinecraftData version) | ||
{ } | ||
|
||
/// <inheritdoc /> | ||
public static IPacket Read(PacketBuffer buffer, MinecraftData version) | ||
=> new ChunkBatchStartPacket(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.