Fix prefix not appearing before some translations and #1
This commit is contained in:
parent
f60e280bad
commit
4fd4cc81f9
2 changed files with 61 additions and 25 deletions
|
|
@ -45,10 +45,10 @@ public class Ban implements CommandExecutor {
|
|||
if(args.length>=2) scope=args[1];
|
||||
if(args.length>=3) {
|
||||
duration=args[2];
|
||||
String regex = "^\\d+:(s|m|h|d)$";
|
||||
String regex = "^(perm)|(-1)|\\d+:(s|m|h|d)$";
|
||||
String regexOnlyNum = "^\\d+$";
|
||||
if(!(duration.matches(regex) || duration.matches(regexOnlyNum))) {
|
||||
p.sendMessage(TextUtils.colorString(plugin.translations.getString("command.ban.durationFormatError")));
|
||||
p.sendMessage(TextUtils.colorString(addPrefix(plugin.translations.getString("command.ban.durationFormatError"))));
|
||||
return false;
|
||||
}
|
||||
char type = plugin.config.getString("defaultDurationType").charAt(0);
|
||||
|
|
@ -76,7 +76,7 @@ public class Ban implements CommandExecutor {
|
|||
banEndDate = new Timestamp(System.currentTimeMillis()+TimeUnit.SECONDS.toMillis(time));
|
||||
break;
|
||||
default:
|
||||
p.sendMessage(TextUtils.colorString(plugin.translations.getString("command.ban.durationFormatError")));
|
||||
p.sendMessage(TextUtils.colorString(addPrefix(plugin.translations.getString("command.ban.durationFormatError"))));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ public class Ban implements CommandExecutor {
|
|||
if(target!=null)
|
||||
if(target.isOnline())
|
||||
if(Objects.equals(plugin.config.getString("serverID"), scope) || Objects.equals(scope, "*")) target.kick(TextUtils.colorString(TextUtils.resolvePlaceholders(plugin.translations.getString("banKickMessage.playerBanPerm"), b)));
|
||||
p.sendMessage(TextUtils.colorString(resolveBanMessagePlaceholders(plugin.translations.getString("command.ban.successfulBanMessagePerm"), args[0], scope, reason, p.getName())));
|
||||
p.sendMessage(TextUtils.colorString(resolveBanMessagePlaceholders(addPrefix(plugin.translations.getString("command.ban.successfulBanMessagePerm")), args[0], scope, reason, p.getName())));
|
||||
Bukkit.broadcast(TextUtils.colorString(resolveBanMessagePlaceholders(plugin.translations.getString("command.ban.banPublicAnnouncementPerm"), args[0], scope, reason, p.getName())));
|
||||
}
|
||||
else {
|
||||
|
|
@ -113,7 +113,7 @@ public class Ban implements CommandExecutor {
|
|||
if(target!=null)
|
||||
if(target.isOnline())
|
||||
if(Objects.equals(plugin.config.getString("serverID"), scope) || Objects.equals(scope, "*")) target.kick(TextUtils.colorString(TextUtils.resolvePlaceholders(plugin.translations.getString("banKickMessage.playerBanTemp"), b)));
|
||||
p.sendMessage(TextUtils.colorString(resolveBanMessagePlaceholders(plugin.translations.getString("command.ban.successfulBanMessageTemp"), args[0], scope, reason, p.getName(), parsedBanDuration)));
|
||||
p.sendMessage(TextUtils.colorString(resolveBanMessagePlaceholders(addPrefix(plugin.translations.getString("command.ban.successfulBanMessageTemp")), args[0], scope, reason, p.getName(), parsedBanDuration)));
|
||||
Bukkit.broadcast(TextUtils.colorString(resolveBanMessagePlaceholders(plugin.translations.getString("command.ban.banPublicAnnouncementTemp"), args[0], scope, reason, p.getName(), parsedBanDuration)));
|
||||
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ public class Ban implements CommandExecutor {
|
|||
}
|
||||
else {
|
||||
plugin.getLogger().severe("BanHammer: Something went wrong while user used ban command... Maybe DB or Technician has skill issue???");
|
||||
p.sendMessage(TextUtils.colorString(plugin.translations.getString("command.ban.unexpectedError")));
|
||||
p.sendMessage(TextUtils.colorString(addPrefix(plugin.translations.getString("command.ban.unexpectedError"))));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue