mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2025-02-25 16:31:20 +01:00
Fix StringWriter
This commit is contained in:
parent
32570b37e9
commit
3bc0d31d85
@ -95,7 +95,8 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String toJSONString() {
|
public String toJSONString() {
|
||||||
JsonWriter json = new JsonWriter(new StringWriter());
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
JsonWriter json = new JsonWriter(stringWriter);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (messageParts.size() == 1) {
|
if (messageParts.size() == 1) {
|
||||||
@ -111,7 +112,7 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("invalid message");
|
throw new RuntimeException("invalid message");
|
||||||
}
|
}
|
||||||
return json.toString();
|
return stringWriter.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void send(Player player){
|
public void send(Player player){
|
||||||
@ -123,7 +124,8 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String makeMultilineTooltip(String[] lines) {
|
private String makeMultilineTooltip(String[] lines) {
|
||||||
JsonWriter json = new JsonWriter(new StringWriter());
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
JsonWriter json = new JsonWriter(stringWriter);
|
||||||
try {
|
try {
|
||||||
json.beginObject().name("id").value(1);
|
json.beginObject().name("id").value(1);
|
||||||
json.name("tag").beginObject().name("display").beginObject();
|
json.name("tag").beginObject().name("display").beginObject();
|
||||||
@ -138,7 +140,7 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("invalid tooltip");
|
throw new RuntimeException("invalid tooltip");
|
||||||
}
|
}
|
||||||
return json.toString();
|
return stringWriter.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClick(String name, String data) {
|
private void onClick(String name, String data) {
|
||||||
|
@ -95,7 +95,8 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String toJSONString() {
|
public String toJSONString() {
|
||||||
JsonWriter json = new JsonWriter(new StringWriter());
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
JsonWriter json = new JsonWriter(stringWriter);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (messageParts.size() == 1) {
|
if (messageParts.size() == 1) {
|
||||||
@ -111,7 +112,7 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("invalid message");
|
throw new RuntimeException("invalid message");
|
||||||
}
|
}
|
||||||
return json.toString();
|
return stringWriter.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void send(Player player){
|
public void send(Player player){
|
||||||
@ -123,7 +124,8 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String makeMultilineTooltip(String[] lines) {
|
private String makeMultilineTooltip(String[] lines) {
|
||||||
JsonWriter json = new JsonWriter(new StringWriter());
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
JsonWriter json = new JsonWriter(stringWriter);
|
||||||
try {
|
try {
|
||||||
json.beginObject().name("id").value(1);
|
json.beginObject().name("id").value(1);
|
||||||
json.name("tag").beginObject().name("display").beginObject();
|
json.name("tag").beginObject().name("display").beginObject();
|
||||||
@ -138,7 +140,7 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("invalid tooltip");
|
throw new RuntimeException("invalid tooltip");
|
||||||
}
|
}
|
||||||
return json.toString();
|
return stringWriter.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClick(String name, String data) {
|
private void onClick(String name, String data) {
|
||||||
|
@ -95,7 +95,8 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String toJSONString() {
|
public String toJSONString() {
|
||||||
JsonWriter json = new JsonWriter(new StringWriter());
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
JsonWriter json = new JsonWriter(stringWriter);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (messageParts.size() == 1) {
|
if (messageParts.size() == 1) {
|
||||||
@ -111,7 +112,7 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("invalid message");
|
throw new RuntimeException("invalid message");
|
||||||
}
|
}
|
||||||
return json.toString();
|
return stringWriter.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void send(Player player){
|
public void send(Player player){
|
||||||
@ -123,7 +124,8 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String makeMultilineTooltip(String[] lines) {
|
private String makeMultilineTooltip(String[] lines) {
|
||||||
JsonWriter json = new JsonWriter(new StringWriter());
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
JsonWriter json = new JsonWriter(stringWriter);
|
||||||
try {
|
try {
|
||||||
json.beginObject().name("id").value(1);
|
json.beginObject().name("id").value(1);
|
||||||
json.name("tag").beginObject().name("display").beginObject();
|
json.name("tag").beginObject().name("display").beginObject();
|
||||||
@ -138,7 +140,7 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("invalid tooltip");
|
throw new RuntimeException("invalid tooltip");
|
||||||
}
|
}
|
||||||
return json.toString();
|
return stringWriter.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClick(String name, String data) {
|
private void onClick(String name, String data) {
|
||||||
|
@ -95,7 +95,8 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String toJSONString() {
|
public String toJSONString() {
|
||||||
JsonWriter json = new JsonWriter(new StringWriter());
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
JsonWriter json = new JsonWriter(stringWriter);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (messageParts.size() == 1) {
|
if (messageParts.size() == 1) {
|
||||||
@ -111,7 +112,7 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("invalid message");
|
throw new RuntimeException("invalid message");
|
||||||
}
|
}
|
||||||
return json.toString();
|
return stringWriter.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void send(Player player){
|
public void send(Player player){
|
||||||
@ -123,7 +124,8 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String makeMultilineTooltip(String[] lines) {
|
private String makeMultilineTooltip(String[] lines) {
|
||||||
JsonWriter json = new JsonWriter(new StringWriter());
|
StringWriter stringWriter = new StringWriter();
|
||||||
|
JsonWriter json = new JsonWriter(stringWriter);
|
||||||
try {
|
try {
|
||||||
json.beginObject().name("id").value(1);
|
json.beginObject().name("id").value(1);
|
||||||
json.name("tag").beginObject().name("display").beginObject();
|
json.name("tag").beginObject().name("display").beginObject();
|
||||||
@ -138,7 +140,7 @@ public class FancyMessageImpl implements FancyMessage {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("invalid tooltip");
|
throw new RuntimeException("invalid tooltip");
|
||||||
}
|
}
|
||||||
return json.toString();
|
return stringWriter.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClick(String name, String data) {
|
private void onClick(String name, String data) {
|
||||||
|
Loading…
Reference in New Issue
Block a user