Merge pull request #80 from mlus-asuka/1.20.4-dev

Fix error when no player in server
This commit is contained in:
mlus 2025-06-06 13:14:58 +08:00 committed by GitHub
commit 02db84f9ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -34,7 +34,7 @@ mod_name=PlayerSync
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPL-3.0 license
# The mod version. See https://semver.org/
mod_version=2.1.2
mod_version=2.1.3
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

View File

@ -33,7 +33,9 @@ public class ChatSyncClient {
while ((serverMessage = in.readLine()) != null) {
PlayerSync.LOGGER.info("Received message from chat server: " + serverMessage);
Component textComponents = Component.nullToEmpty(serverMessage);
playerList.broadcastSystemMessage(textComponents,false);
if(playerList!=null){
playerList.broadcastSystemMessage(textComponents,false);
}
}
} catch (IOException e) {
e.printStackTrace();