mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-03 18:53:43 +01:00 
			
		
		
		
	At least have the decency of using utf8-codes 💥
This commit is contained in:
		@@ -38,7 +38,7 @@ public class Flag {
 | 
				
			|||||||
     * @throws IllegalArgumentException if you provide inadequate inputs
 | 
					     * @throws IllegalArgumentException if you provide inadequate inputs
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public Flag(final AbstractFlag key, final String value) {
 | 
					    public Flag(final AbstractFlag key, final String value) {
 | 
				
			||||||
        final char[] allowedCharacters = new char[]{'[', ']', '(', ')', ',', '_', '-', '.', ',', '?', '!', '&', ':', '<EFBFBD>'};
 | 
					        final char[] allowedCharacters = new char[]{'[', ']', '(', ')', ',', '_', '-', '.', ',', '?', '!', '&', ':', '\u00A7'};
 | 
				
			||||||
        String tempValue = value;
 | 
					        String tempValue = value;
 | 
				
			||||||
        for (final char c : allowedCharacters) {
 | 
					        for (final char c : allowedCharacters) {
 | 
				
			||||||
            tempValue = tempValue.replace(c, 'c');
 | 
					            tempValue = tempValue.replace(c, 'c');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -246,10 +246,13 @@ public class PlayerFunctions {
 | 
				
			|||||||
            String[] ss = ChatPaginator.wordWrap(msg, ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH);
 | 
					            String[] ss = ChatPaginator.wordWrap(msg, ChatPaginator.AVERAGE_CHAT_PAGE_WIDTH);
 | 
				
			||||||
            StringBuilder b = new StringBuilder();
 | 
					            StringBuilder b = new StringBuilder();
 | 
				
			||||||
            for (String p : ss) {
 | 
					            for (String p : ss) {
 | 
				
			||||||
                b.append(p).append("\n ");
 | 
					                b.append(p).append(p.equals(ss[ss.length - 1]) ? "" : "\n ");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            msg = b.toString();
 | 
					            msg = b.toString();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        if (msg.endsWith("\n")) {
 | 
				
			||||||
 | 
					            msg = msg.substring(0, msg.length() - 2);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        plr.sendMessage(msg);
 | 
					        plr.sendMessage(msg);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -146,8 +146,8 @@ public class MainCommand implements CommandExecutor, TabCompleter {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /* Let's try to get a proper usage string */
 | 
					            /* Let's try to get a proper usage string */
 | 
				
			||||||
            SubCommand command = (SubCommand) new StringComparsion(args[0], commands).getMatchObject();
 | 
					            String command = new StringComparsion(args[0], commands).getBestMatch();
 | 
				
			||||||
            return PlayerFunctions.sendMessage(player, C.DID_YOU_MEAN, command.usage.contains("plot") ? command.usage : "/plot " + command.usage);
 | 
					            return PlayerFunctions.sendMessage(player, C.DID_YOU_MEAN, "/plot " + command);
 | 
				
			||||||
            //PlayerFunctions.sendMessage(player, C.DID_YOU_MEAN, new StringComparsion(args[0], commands).getBestMatch());
 | 
					            //PlayerFunctions.sendMessage(player, C.DID_YOU_MEAN, new StringComparsion(args[0], commands).getBestMatch());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,7 +21,7 @@ public class TranslationObject {
 | 
				
			|||||||
            creationDescription = "";
 | 
					            creationDescription = "";
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        for (char c : key.toCharArray()) {
 | 
					        for (char c : key.toCharArray()) {
 | 
				
			||||||
            if (!Character.isDigit(c) && !Character.isAlphabetic(c) && c != '_' && c != '&' && c != '<EFBFBD>' && c != ':') {
 | 
					            if (!Character.isDigit(c) && !Character.isAlphabetic(c) && c != '_' && c != '&' && c != '\u00A7' && c != ':') {
 | 
				
			||||||
                throw new RuntimeException(
 | 
					                throw new RuntimeException(
 | 
				
			||||||
                        String.format("Translation: '%s' is invalid (Character: '%s') - Only alphanumeric + (\\, _, &, §, :) charcters are allowed",
 | 
					                        String.format("Translation: '%s' is invalid (Character: '%s') - Only alphanumeric + (\\, _, &, §, :) charcters are allowed",
 | 
				
			||||||
                                key, c + ""
 | 
					                                key, c + ""
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,7 +23,7 @@ public class BukkitTranslation {
 | 
				
			|||||||
    public static String convert(TranslationAsset asset) {
 | 
					    public static String convert(TranslationAsset asset) {
 | 
				
			||||||
        // In some cases newline can screw stuff up, so I added a new character thing
 | 
					        // In some cases newline can screw stuff up, so I added a new character thing
 | 
				
			||||||
        // &- = new line
 | 
					        // &- = new line
 | 
				
			||||||
        return asset.getTranslated().replace("&-", "\n").replace('&', '<EFBFBD>');
 | 
					        return asset.getTranslated().replace("&-", "\n").replace('&', '\u00A7');
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user