hypixel uses colons for its payload channel names, such as hypixel:hello, which fail for different reasons:
NamespacedIdentifier#toString does not work properly when there is no namespace
toString always prepends the namespace and separator :, even when the namespace is empty.
this results in identifier names like :REGISTER or :hypixel:hello
here is a proposed fix, tested with mixin:
public String toString() {
if (namespace.isEmpty()) {
return identifier;
}
else {
return namespace + SEPARATOR + identifier;
}
}
StringChannelIdentifierParser#fromString does not support colons
fromString only creates a NamespacedIdentifierImpl with a separate namespace and identifier if there is a |, it does not do this for colons.
here is a proposed fix, tested with mixin:
public static NamespacedIdentifier fromString(String s) {
int i = s.indexOf('|');
if (i < 1) {
i = s.indexOf(":");
if (i < 1) {
// allow null namespaces to support channel ids that do not conform
// to OSL spec - MC did not enforce a strict spec before 1.13
return new NamespacedIdentifierImpl("", s);
}
}
return new NamespacedIdentifierImpl(s.substring(0, i), s.substring(i + 1));
}
hypixel uses colons for its payload channel names, such as
hypixel:hello, which fail for different reasons:NamespacedIdentifier#toStringdoes not work properly when there is no namespacetoStringalways prepends the namespace and separator:, even when the namespace is empty.this results in identifier names like
:REGISTERor:hypixel:hellohere is a proposed fix, tested with mixin:
StringChannelIdentifierParser#fromStringdoes not support colonsfromStringonly creates aNamespacedIdentifierImplwith a separate namespace and identifier if there is a|, it does not do this for colons.here is a proposed fix, tested with mixin: