-
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.
Merge pull request #53 from qwqtoday/chat-fix
nbt text component implemention
- Loading branch information
Showing
7 changed files
with
264 additions
and
18 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
40 changes: 40 additions & 0 deletions
40
Components/MineSharp.Protocol/Packets/Clientbound/Play/SetPassengersPacket.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,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using MineSharp.Core.Common; | ||
using MineSharp.Data; | ||
using MineSharp.Data.Protocol; | ||
|
||
namespace MineSharp.Protocol.Packets.Clientbound.Play; | ||
|
||
#pragma warning disable CS1591 | ||
public class SetPassengersPacket : IPacket | ||
{ | ||
public PacketType Type => PacketType.CB_Play_SetPassengers; | ||
|
||
public int EntityId { get; set; } | ||
|
||
public int[] PassengersId { get; set; } | ||
|
||
public SetPassengersPacket(int entityId, int[] passengersId) | ||
{ | ||
EntityId = entityId; | ||
PassengersId = passengersId; | ||
} | ||
|
||
public void Write(PacketBuffer buffer, MinecraftData version) | ||
{ | ||
buffer.WriteVarInt(this.EntityId); | ||
buffer.WriteVarIntArray(this.PassengersId, (buf, elem) => buffer.WriteVarInt(elem)); | ||
} | ||
|
||
public static IPacket Read(PacketBuffer buffer, MinecraftData version) | ||
{ | ||
return new SetPassengersPacket( | ||
buffer.ReadVarInt(), | ||
buffer.ReadVarIntArray<int>(buf => buf.ReadVarInt())); | ||
} | ||
} | ||
#pragma warning restore CS1591 |
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.