diff --git a/Config/src/main/java/com/gmail/filoghost/holographicdisplays/disk/StringConverter.java b/Config/src/main/java/com/gmail/filoghost/holographicdisplays/disk/StringConverter.java index 9ee828d3..4729a0c1 100644 --- a/Config/src/main/java/com/gmail/filoghost/holographicdisplays/disk/StringConverter.java +++ b/Config/src/main/java/com/gmail/filoghost/holographicdisplays/disk/StringConverter.java @@ -28,15 +28,4 @@ public class StringConverter { return input; } - - public static String toSaveableFormat(String input) { - if (input == null) { - return null; - } - - input = UnicodeSymbols.symbolsToPlaceholders(input); - input = input.replace("ยง", "&"); - return input; - } - } diff --git a/Config/src/main/java/com/gmail/filoghost/holographicdisplays/disk/UnicodeSymbols.java b/Config/src/main/java/com/gmail/filoghost/holographicdisplays/disk/UnicodeSymbols.java index b67f05f9..3da4c4d4 100644 --- a/Config/src/main/java/com/gmail/filoghost/holographicdisplays/disk/UnicodeSymbols.java +++ b/Config/src/main/java/com/gmail/filoghost/holographicdisplays/disk/UnicodeSymbols.java @@ -92,14 +92,6 @@ public class UnicodeSymbols { } - protected static String symbolsToPlaceholders(String input) { - for (Entry entry : placeholders.entrySet()) { - input = input.replace(entry.getValue(), entry.getKey()); - } - return input; - } - - private static String unquote(String input) { if (input.length() < 2) { // Cannot be quoted. diff --git a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/PacketUtils.java b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/PacketUtils.java index 413ea358..2cc7f0ae 100644 --- a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/PacketUtils.java +++ b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/bridge/bungeecord/serverpinger/PacketUtils.java @@ -18,64 +18,52 @@ import java.lang.RuntimeException; import java.io.Closeable; import java.io.DataInputStream; import java.io.IOException; -import java.lang.Character; import java.lang.String; import java.io.DataOutputStream; import java.nio.charset.Charset; -class PacketUtils -{ - public static final Charset UTF16BE = Charset.forName("UTF-16BE");; - public static final Charset UTF8 = Charset.forName("UTF-8"); - - public static void a(final DataOutputStream out, final String s) throws IOException { - final int len = s.length(); - final byte[] data = new byte[len / 2]; - for (int i = 0; i < len; i += 2) { - data[i / 2] = (byte)((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16)); - } - out.write(data); - } - - public static void writeString(final DataOutputStream out, final String s, final Charset charset) throws IOException { - if (charset == PacketUtils.UTF8) { - writeVarInt(out, s.length()); - } - else { - out.writeShort(s.length()); - } - out.write(s.getBytes(charset)); - } - - public static int readVarInt(final DataInputStream in) throws IOException { - int i = 0; - int j = 0; - while (true) { - final int k = in.readByte(); - i |= (k & 0x7F) << j++ * 7; - if (j > 5) { - throw new RuntimeException("VarInt too big"); - } - if ((k & 0x80) != 0x80) { - return i; - } - } - } - - public static void writeVarInt(final DataOutputStream out, int paramInt) throws IOException { - while ((paramInt & 0xFFFFFF80) != 0x0) { - out.write((paramInt & 0x7F) | 0x80); - paramInt >>>= 7; - } - out.write(paramInt); - } - - public static void closeQuietly(Closeable closeable) { - try { - if (closeable != null) { - closeable.close(); - } - } catch (IOException e) { } - } +class PacketUtils { + + public static final Charset UTF8 = Charset.forName("UTF-8"); + + public static void writeString(final DataOutputStream out, final String s, final Charset charset) throws IOException { + if (charset == PacketUtils.UTF8) { + writeVarInt(out, s.length()); + } else { + out.writeShort(s.length()); + } + out.write(s.getBytes(charset)); + } + + public static int readVarInt(final DataInputStream in) throws IOException { + int i = 0; + int j = 0; + while (true) { + final int k = in.readByte(); + i |= (k & 0x7F) << j++ * 7; + if (j > 5) { + throw new RuntimeException("VarInt too big"); + } + if ((k & 0x80) != 0x80) { + return i; + } + } + } + + public static void writeVarInt(final DataOutputStream out, int paramInt) throws IOException { + while ((paramInt & 0xFFFFFF80) != 0x0) { + out.write((paramInt & 0x7F) | 0x80); + paramInt >>>= 7; + } + out.write(paramInt); + } + + public static void closeQuietly(Closeable closeable) { + try { + if (closeable != null) { + closeable.close(); + } + } catch (IOException e) {} + } } diff --git a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/exception/InvalidCharactersException.java b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/exception/InvalidCharactersException.java deleted file mode 100644 index 4611529a..00000000 --- a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/exception/InvalidCharactersException.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holographicdisplays.exception; - -public class InvalidCharactersException extends Exception { - - private static final long serialVersionUID = 1L; - - public InvalidCharactersException(String message) { - super(message); - } -} diff --git a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/exception/InvalidMaterialException.java b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/exception/InvalidMaterialException.java deleted file mode 100644 index a04c1225..00000000 --- a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/exception/InvalidMaterialException.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holographicdisplays.exception; - -public class InvalidMaterialException extends Exception { - - private static final long serialVersionUID = 1L; - - public InvalidMaterialException(String message) { - super(message); - } - -} diff --git a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/exception/SpawnFailedException.java b/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/exception/SpawnFailedException.java deleted file mode 100644 index 85fd106b..00000000 --- a/Plugin/src/main/java/com/gmail/filoghost/holographicdisplays/exception/SpawnFailedException.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.gmail.filoghost.holographicdisplays.exception; - -public class SpawnFailedException extends Exception { - - private static final long serialVersionUID = 1L; - -}