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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user