mirror of
https://github.com/MeowCraftMC/CrystalConnector
synced 2025-05-22 02:43:00 +00:00
✨ V2 (#1)
* 🚧 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>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user