mirror of
https://github.com/MeowCraftMC/CrystalConnector
synced 2025-05-22 02:43:00 +00:00
* 🚧 WIP v2. Signed-off-by: 秋雨落 <i@rain.cx> * 🚧 WIP v2 * 2. Signed-off-by: 秋雨落 <i@rain.cx> * ✨ It works? Signed-off-by: 秋雨落 <i@rain.cx> * ✨ Publish to nexus. Signed-off-by: 秋雨落 <i@rain.cx> --------- Signed-off-by: 秋雨落 <i@rain.cx>
25 lines
648 B
C#
25 lines
648 B
C#
using CrystalConnector.Protocol.Messages;
|
|
|
|
namespace CrystalConnector.Protocol.Utilities;
|
|
|
|
public static class PacketHelperExtensions
|
|
{
|
|
public static (string Namespace, string Name) ToTuple(this NamespacedName name)
|
|
{
|
|
return (name.Namespace, name.Name);
|
|
}
|
|
|
|
public static NamespacedName ToName(this (string Namespace, string Name) name)
|
|
{
|
|
return new NamespacedName
|
|
{
|
|
Namespace = name.Namespace,
|
|
Name = name.Name
|
|
};
|
|
}
|
|
|
|
public static string ToIdString(this (string Namespace, string Name) name)
|
|
{
|
|
return $"{name.Namespace}:{name.Name}";
|
|
}
|
|
} |