Reduce the size of json output

Nulls are not outputted (https://sites.google.com/site/gson/gson-user-guide#TOC-Null-Object-Support)
This commit is contained in:
Thinkofdeath 2013-12-02 11:56:25 +00:00 committed by md_5
parent 81e43aab98
commit 54d307da57

View File

@ -59,26 +59,26 @@ public class ChatConverter {
msg = new Message(msg); msg = new Message(msg);
switch(c) { switch(c) {
case 'k': case 'k':
msg.obfuscated = true; msg.obfuscated = Boolean.TRUE;
break; break;
case 'l': case 'l':
msg.bold = true; msg.bold = Boolean.TRUE;
break; break;
case 'm': case 'm':
msg.strikethrough = true; msg.strikethrough = Boolean.TRUE;
break; break;
case 'n': case 'n':
msg.underlined = true; msg.underlined = Boolean.TRUE;
break; break;
case 'o': case 'o':
msg.italic = true; msg.italic = Boolean.TRUE;
break; break;
default: default:
msg.obfuscated = false; msg.obfuscated = null;
msg.bold = false; msg.bold = null;
msg.strikethrough = false; msg.strikethrough = null;
msg.underlined = false; msg.underlined = null;
msg.italic = false; msg.italic = null;
if (c != 'r') { if (c != 'r') {
msg.color = Color.fromCode(Character.toString(c)); msg.color = Color.fromCode(Character.toString(c));
} else { } else {
@ -114,11 +114,11 @@ public class ChatConverter {
class Message { class Message {
public String text; public String text;
public boolean bold; public Boolean bold;
public boolean italic; public Boolean italic;
public boolean underlined; public Boolean underlined;
public boolean strikethrough; public Boolean strikethrough;
public boolean obfuscated; public Boolean obfuscated;
public Color color; public Color color;