13
0

FixTeamColorReplaceText #23

Manuell gemergt
Lixfel hat 2 Commits von FixTeamColorReplaceText nach master 2021-05-15 21:08:11 +02:00 zusammengeführt

Datei anzeigen

@ -56,13 +56,13 @@ public class BlockTextCreator {
private static BlockArrayClipboard[] createText(String text){
List<BlockArrayClipboard> 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){