mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-03 22:08:28 +00:00
Add notify messages to jail command (#4576)
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
This commit is contained in:
parent
58b0fb089f
commit
add664441e
2 changed files with 12 additions and 0 deletions
|
@ -15,6 +15,7 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
|
@ -84,6 +85,10 @@ public class Commandtogglejail extends EssentialsCommand {
|
|||
player.setOnlineJailedTime(ess.getSettings().isJailOnlineTime() ? ((player.getBase().getStatistic(PLAY_ONE_TICK)) + (timeDiff / 50)) : 0);
|
||||
}
|
||||
sender.sendMessage(timeDiff > 0 ? tl("playerJailedFor", player.getName(), DateUtil.formatDateDiff(finalDisplayTime)) : tl("playerJailed", player.getName()));
|
||||
|
||||
final String notifyMessage = timeDiff > 0 ? tl("jailNotifyJailedFor", player.getName(), DateUtil.formatDateDiff(finalDisplayTime), sender.getSender().getName()) : tl("jailNotifyJailed", player.getName(), sender.getSender().getName());
|
||||
server.getLogger().log(Level.INFO, notifyMessage);
|
||||
ess.broadcastMessage("essentials.jail.notify", notifyMessage);
|
||||
}
|
||||
});
|
||||
if (player.getBase().isOnline()) {
|
||||
|
@ -107,6 +112,10 @@ public class Commandtogglejail extends EssentialsCommand {
|
|||
player.setJailTimeout(timeDiff);
|
||||
player.setOnlineJailedTime(ess.getSettings().isJailOnlineTime() ? ((player.getBase().getStatistic(PLAY_ONE_TICK)) + (timeDiff / 50)) : 0);
|
||||
sender.sendMessage(tl("jailSentenceExtended", DateUtil.formatDateDiff(displayTimeDiff)));
|
||||
|
||||
final String notifyMessage = tl("jailNotifySentenceExtended", player.getName(), DateUtil.formatDateDiff(displayTimeDiff), sender.getSender().getName());
|
||||
server.getLogger().log(Level.INFO, notifyMessage);
|
||||
ess.broadcastMessage("essentials.jail.notify", notifyMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -583,6 +583,9 @@ jailAlreadyIncarcerated=\u00a74Person is already in jail\:\u00a7c {0}
|
|||
jailList=\u00a76Jails\:\u00a7r {0}
|
||||
jailMessage=\u00a74You do the crime, you do the time.
|
||||
jailNotExist=\u00a74That jail does not exist.
|
||||
jailNotifyJailed=\u00a76Player\u00a7c {0} \u00a76jailed by \u00a7c{1}.
|
||||
jailNotifyJailedFor=\u00a76Player\u00a7c {0} \u00a76jailed for\u00a7c {1}\u00a76by \u00a7c{2}\u00a76.
|
||||
jailNotifySentenceExtended=\u00a76Player\u00a7c{0} \u00a76jail's time extended to \u00a7c{1} \u00a76by \u00a7c{2}\u00a76.
|
||||
jailReleased=\u00a76Player \u00a7c{0}\u00a76 unjailed.
|
||||
jailReleasedPlayerNotify=\u00a76You have been released\!
|
||||
jailSentenceExtended=\u00a76Jail time extended to \u00a7c{0}\u00a76.
|
||||
|
|
Loading…
Reference in a new issue