mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-16 12:26:12 +00:00
Fix tempban reason issues
Tempban won't cut off reasons that take the durations argument place anymore.
This commit is contained in:
parent
f9e8a4c8ba
commit
cb108e0c13
@ -58,20 +58,17 @@ public class Command_tempban extends FreedomCommand
|
|||||||
final StringBuilder message = new StringBuilder("Temporarily banned " + player.getName());
|
final StringBuilder message = new StringBuilder("Temporarily banned " + player.getName());
|
||||||
|
|
||||||
Date expires = FUtil.parseDateOffset("30m");
|
Date expires = FUtil.parseDateOffset("30m");
|
||||||
|
message.append(" until ").append(date_format.format(expires));
|
||||||
|
|
||||||
|
String reason = null;
|
||||||
if (args.length >= 2)
|
if (args.length >= 2)
|
||||||
{
|
{
|
||||||
Date parsed_offset = FUtil.parseDateOffset(args[1]);
|
Date parsed_offset = FUtil.parseDateOffset(args[1]);
|
||||||
|
reason = StringUtils.join(ArrayUtils.subarray(args, parsed_offset == null ? 1 : 2, args.length), " ") + " (" + sender.getName() + ")";
|
||||||
if (parsed_offset != null)
|
if (parsed_offset != null)
|
||||||
{
|
{
|
||||||
expires = parsed_offset;
|
expires = parsed_offset;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
message.append(" until ").append(date_format.format(expires));
|
|
||||||
|
|
||||||
String reason = null;
|
|
||||||
if (args.length >= 3)
|
|
||||||
{
|
|
||||||
reason = StringUtils.join(ArrayUtils.subarray(args, 2, args.length), " ") + " (" + sender.getName() + ")";
|
|
||||||
message.append(", Reason: \"").append(reason).append("\"");
|
message.append(", Reason: \"").append(reason).append("\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user