diff --git a/src/de/steamwar/spectatesystem/util/BlockTextCreator.java b/src/de/steamwar/spectatesystem/util/BlockTextCreator.java index 4091372..7dedcc9 100644 --- a/src/de/steamwar/spectatesystem/util/BlockTextCreator.java +++ b/src/de/steamwar/spectatesystem/util/BlockTextCreator.java @@ -56,13 +56,13 @@ public class BlockTextCreator { private static BlockArrayClipboard[] createText(String text){ List result = new ArrayList<>(); - for(char c : text.toUpperCase().toCharArray()){ + for(char c : text.toCharArray()){ try { - try{ - result.add((BlockArrayClipboard) new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(new FileInputStream(new File(SpectateSystem.get().getDataFolder(), "text/" + c + ".schem"))))).read()); + try { + result.add((BlockArrayClipboard) new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(new FileInputStream(new File(SpectateSystem.get().getDataFolder(), "text/" + nameConversion(c) + ".schem"))))).read()); } catch (FileNotFoundException e) { Bukkit.getLogger().log(Level.WARNING, "Could not display character " + c + " due to missing file!"); - result.add((BlockArrayClipboard) new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(new FileInputStream(new File(SpectateSystem.get().getDataFolder(), "text/?.schem"))))).read()); + result.add((BlockArrayClipboard) new SpongeSchematicReader(new NBTInputStream(new GZIPInputStream(new FileInputStream(new File(SpectateSystem.get().getDataFolder(), "text/.schem"))))).read()); } }catch (IOException e) { throw new SecurityException("Could not load text", e); @@ -71,6 +71,15 @@ public class BlockTextCreator { return result.toArray(new BlockArrayClipboard[0]); } + private static String nameConversion(char c) { + switch (Character.toUpperCase(c)) { + case '/': + return "slash"; + default: + return c + ""; + } + } + private static int[] characterSize(BlockArrayClipboard[] characters){ int[] lengthes = new int[characters.length]; for(int i = 0; i < lengthes.length; i++) @@ -130,7 +139,7 @@ public class BlockTextCreator { }else z -= Config.SchemsizeZ / 2; DyeColor c = ColorConverter.chat2dye(ChatColor.getByChar(ChatColor.getLastColors(color).replace("ยง", ""))); - pasteText(team.getTeamKuerzel(), x, Config.upperArenaBorder, z, aT, c); + pasteText(team.getTeamKuerzel(), x, Config.upperArenaBorder + 10, z, aT, c); } public static void pasteTeamNames(int teamBlueId, int teamRedId){