mirror of
https://github.com/Jacobwasbeast/LegacyWeaveLoader.git
synced 2026-07-07 19:28:45 +00:00
Rebrand LegacyForge to Weave Loader
Rename across entire codebase: - LegacyForge -> WeaveLoader (identifiers, namespaces, classes, DLLs) - LegacyForgeRuntime -> WeaveLoaderRuntime (C++ project) - LegacyForge.API/Core/Launcher -> WeaveLoader.API/Core/Launcher (C# projects) - [LegacyForge] -> [WeaveLoader] (log prefixes) - legacyforge -> weaveloader (config files, log files, backup suffixes) - Display name "Weave Loader" in README, CONTRIBUTING, LICENSE
This commit is contained in:
39
WeaveLoader.API/Identifier.cs
Normal file
39
WeaveLoader.API/Identifier.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
namespace WeaveLoader.API;
|
||||
|
||||
/// <summary>
|
||||
/// A namespaced identifier in the form "namespace:path" (e.g. "minecraft:stone", "mymod:ruby_ore").
|
||||
/// </summary>
|
||||
public readonly record struct Identifier
|
||||
{
|
||||
public string Namespace { get; }
|
||||
public string Path { get; }
|
||||
|
||||
public Identifier(string ns, string path)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(ns);
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(path);
|
||||
Namespace = ns;
|
||||
Path = path;
|
||||
}
|
||||
|
||||
public Identifier(string id)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(id);
|
||||
|
||||
var colonIndex = id.IndexOf(':');
|
||||
if (colonIndex < 0)
|
||||
{
|
||||
Namespace = "minecraft";
|
||||
Path = id;
|
||||
}
|
||||
else
|
||||
{
|
||||
Namespace = id[..colonIndex];
|
||||
Path = id[(colonIndex + 1)..];
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString() => $"{Namespace}:{Path}";
|
||||
|
||||
public static implicit operator Identifier(string id) => new(id);
|
||||
}
|
||||
Reference in New Issue
Block a user