9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2026-01-04 15:41:31 +00:00

Make protocol ResourceLocation not nullable

This commit is contained in:
Lumine1909
2025-10-15 20:23:39 -07:00
parent c3c6b0237d
commit 23c08aa30d
8 changed files with 9 additions and 9 deletions

View File

@@ -38,7 +38,7 @@ public class AppleSkinProtocol implements LeavesProtocol {
@Contract("_ -> new")
public static ResourceLocation id(String path) {
return ResourceLocation.tryBuild(PROTOCOL_ID, path);
return ResourceLocation.fromNamespaceAndPath(PROTOCOL_ID, path);
}
@ProtocolHandler.PlayerJoin

View File

@@ -45,7 +45,7 @@ public class BBORProtocol implements LeavesProtocol {
@Contract("_ -> new")
public static ResourceLocation id(String path) {
return ResourceLocation.tryBuild(PROTOCOL_ID, path);
return ResourceLocation.fromNamespaceAndPath(PROTOCOL_ID, path);
}
@ProtocolHandler.Ticker

View File

@@ -30,7 +30,7 @@ public class CarpetServerProtocol implements LeavesProtocol {
@Contract("_ -> new")
public static ResourceLocation id(String path) {
return ResourceLocation.tryBuild(PROTOCOL_ID, path);
return ResourceLocation.fromNamespaceAndPath(PROTOCOL_ID, path);
}
@ProtocolHandler.PlayerJoin

View File

@@ -60,7 +60,7 @@ public class PcaSyncProtocol implements LeavesProtocol {
@Contract("_ -> new")
public static ResourceLocation id(String path) {
return ResourceLocation.tryBuild(PROTOCOL_ID, path);
return ResourceLocation.fromNamespaceAndPath(PROTOCOL_ID, path);
}
@ProtocolHandler.PlayerJoin

View File

@@ -19,12 +19,12 @@ public class XaeroMapProtocol implements LeavesProtocol {
@Contract("_ -> new")
public static ResourceLocation idMini(String path) {
return ResourceLocation.tryBuild(PROTOCOL_ID_MINI, path);
return ResourceLocation.fromNamespaceAndPath(PROTOCOL_ID_MINI, path);
}
@Contract("_ -> new")
public static ResourceLocation idWorld(String path) {
return ResourceLocation.tryBuild(PROTOCOL_ID_WORLD, path);
return ResourceLocation.fromNamespaceAndPath(PROTOCOL_ID_WORLD, path);
}
public static void onSendWorldInfo(@NotNull ServerPlayer player) {

View File

@@ -24,7 +24,7 @@ public class ChatImageProtocol implements LeavesProtocol {
@Contract("_ -> new")
public static ResourceLocation id(String path) {
return ResourceLocation.tryBuild(PROTOCOL_ID, path);
return ResourceLocation.fromNamespaceAndPath(PROTOCOL_ID, path);
}
@ProtocolHandler.PayloadReceiver(payload = FileChannelPayload.class)

View File

@@ -81,7 +81,7 @@ public class JadeProtocol implements LeavesProtocol {
@Contract("_ -> new")
public static ResourceLocation id(String path) {
return ResourceLocation.tryBuild(PROTOCOL_ID, path);
return ResourceLocation.fromNamespaceAndPath(PROTOCOL_ID, path);
}
@Contract("_ -> new")

View File

@@ -25,6 +25,6 @@ public enum PacketType {
public final ResourceLocation identifier;
PacketType(final String id) {
identifier = ResourceLocation.tryBuild(SyncmaticaProtocol.PROTOCOL_ID, id);
identifier = ResourceLocation.fromNamespaceAndPath(SyncmaticaProtocol.PROTOCOL_ID, id);
}
}