diff --git a/src/main/java/io/github/gaming32/worldhost/protocol/WorldHostS2CMessage.java b/src/main/java/io/github/gaming32/worldhost/protocol/WorldHostS2CMessage.java index 3e1edae..8fc9958 100644 --- a/src/main/java/io/github/gaming32/worldhost/protocol/WorldHostS2CMessage.java +++ b/src/main/java/io/github/gaming32/worldhost/protocol/WorldHostS2CMessage.java @@ -276,6 +276,17 @@ public void handle(ProtocolClient client) { } } + record Warning(String message, boolean important) implements WorldHostS2CMessage { + @Override + public void handle(ProtocolClient client) { + WorldHost.LOGGER.warn("Warning from WH server (important: {}): {}", important, message); + WHToast.builder(Components.translatable("world-host.protocol_warning_occurred")) + .description(Components.literal(message)) + .important(important) + .show(); + } + } + /** * NOTE: This method is called from the RecvThread, so it should be careful to not do anything that could *