diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/BossBar.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/BossBar.java index 137e1b4a2e..6a6977a4f1 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/BossBar.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/BossBar.java @@ -114,11 +114,20 @@ public void handle(AbstractPacketHandler handler) throws Exception public BaseComponent getTitle() { + if ( title == null ) + { + return null; + } return title.get(); } public void setTitle(BaseComponent title) { + if ( title == null ) + { + this.title = null; + return; + } this.title = new NoOrigDeserializable<>( title ); } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Kick.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Kick.java index 9076f7e40e..07294a9ab8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Kick.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Kick.java @@ -64,11 +64,20 @@ public Kick(BaseComponent message) public BaseComponent getMessage() { + if ( messageRaw == null ) + { + return null; + } return messageRaw.get(); } public void setMessage(BaseComponent message) { + if ( message == null ) + { + this.messageRaw = null; + return; + } this.messageRaw = new NoOrigDeserializable<>( message ); } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListHeaderFooter.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListHeaderFooter.java index a8b4136f8e..4457092795 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListHeaderFooter.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListHeaderFooter.java @@ -52,21 +52,39 @@ public PlayerListHeaderFooter(BaseComponent header, BaseComponent footer) public BaseComponent getHeader() { + if ( headerRaw == null ) + { + return null; + } return headerRaw.get(); } public void setHeader(BaseComponent header) { + if ( header == null ) + { + this.headerRaw = null; + return; + } this.headerRaw = new NoOrigDeserializable<>( header ); } public BaseComponent getFooter() { + if ( footerRaw == null ) + { + return null; + } return footerRaw.get(); } public void setFooter(BaseComponent footer) { + if ( footer == null ) + { + this.footerRaw = null; + return; + } this.footerRaw = new NoOrigDeserializable<>( footer ); } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java index f60f10305f..cc07056f1b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java @@ -151,11 +151,20 @@ public static class Item public BaseComponent getDisplayName() { + if ( displayNameRaw == null ) + { + return null; + } return displayNameRaw.get(); } public void setDisplayName(BaseComponent displayName) { + if ( displayName == null ) + { + this.displayNameRaw = null; + return; + } this.displayNameRaw = new NoOrigDeserializable<>( displayName ); } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ServerData.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ServerData.java index 18d4121765..7bece78d5b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/ServerData.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/ServerData.java @@ -117,11 +117,20 @@ public ServerData(BaseComponent motd, Object icon, boolean preview, boolean enfo public BaseComponent getMotd() { + if ( motdRaw == null ) + { + return null; + } return motdRaw.get(); } public void setMotd(BaseComponent motd) { + if ( motd == null ) + { + this.motdRaw = null; + return; + } this.motdRaw = new NoOrigDeserializable<>( motd ); } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Subtitle.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Subtitle.java index 7b4f620d46..1c15703a6b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Subtitle.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Subtitle.java @@ -46,11 +46,20 @@ public Subtitle(BaseComponent text) public BaseComponent getText() { + if ( textRaw == null ) + { + return null; + } return textRaw.get(); } public void setText(BaseComponent text) { + if ( text == null ) + { + this.textRaw = null; + return; + } this.textRaw = new NoOrigDeserializable<>( text ); } } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/SystemChat.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/SystemChat.java index e9a4394f8e..caf2aafa1a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/SystemChat.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/SystemChat.java @@ -59,11 +59,20 @@ public SystemChat(BaseComponent message, int position) public BaseComponent getMessage() { + if ( messageRaw == null ) + { + return null; + } return messageRaw.get(); } public void setMessage(BaseComponent message) { + if ( message == null ) + { + this.messageRaw = null; + return; + } this.messageRaw = new NoOrigDeserializable<>( message ); } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteResponse.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteResponse.java index fab9569970..66bbef3416 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteResponse.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/TabCompleteResponse.java @@ -106,6 +106,10 @@ private static class ComponentMessage implements Message public BaseComponent getComponent() { + if ( componentRaw == null ) + { + return null; + } return componentRaw.get(); } diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java index a2a35bcf56..0cbc489874 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Team.java @@ -129,6 +129,10 @@ public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protoc @SuppressWarnings("unchecked") public Either getDisplayName() { + if ( displayNameRaw == null ) + { + return null; + } if ( displayNameRaw.isLeft() ) { return (Either) displayNameRaw; @@ -141,6 +145,11 @@ public Either getDisplayName() @SuppressWarnings("unchecked") public void setDisplayName(Either displayName) { + if ( displayName == null ) + { + displayNameRaw = null; + return; + } if ( displayName.isLeft() ) { displayNameRaw = (Either) displayName; @@ -153,6 +162,10 @@ public void setDisplayName(Either displayName) @SuppressWarnings("unchecked") public Either getPrefix() { + if ( prefixRaw == null ) + { + return null; + } if ( prefixRaw.isLeft() ) { return (Either) prefixRaw; @@ -165,6 +178,11 @@ public Either getPrefix() @SuppressWarnings("unchecked") public void setPrefix(Either prefix) { + if ( prefix == null ) + { + prefixRaw = null; + return; + } if ( prefix.isLeft() ) { prefixRaw = (Either) prefix; @@ -177,6 +195,10 @@ public void setPrefix(Either prefix) @SuppressWarnings("unchecked") public Either getSuffix() { + if ( suffixRaw == null ) + { + return null; + } if ( suffixRaw.isLeft() ) { return (Either) suffixRaw; @@ -189,6 +211,11 @@ public Either getSuffix() @SuppressWarnings("unchecked") public void setSuffix(Either suffix) { + if ( suffix == null ) + { + suffixRaw = null; + return; + } if ( suffix.isLeft() ) { suffixRaw = (Either) suffix; diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Title.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Title.java index da5aa0eafe..fad5e2b9ca 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Title.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Title.java @@ -128,11 +128,20 @@ public Title(Action action, BaseComponent text, int fadeIn, int stay, int fadeOu public BaseComponent getText() { + if ( textRaw == null ) + { + return null; + } return textRaw.get(); } public void setText(BaseComponent text) { + if ( text == null ) + { + this.textRaw = null; + return; + } this.textRaw = new NoOrigDeserializable<>( text ); } }