This commit is contained in:
Super_ 2020-01-03 21:42:23 -05:00
parent 52269c2122
commit 3ea73f78e9
3 changed files with 19 additions and 0 deletions

View File

@ -69,6 +69,12 @@ public class ChatManager extends FreedomService
// Check for adminchat // Check for adminchat
final FPlayer fPlayer = plugin.pl.getPlayerSync(player); final FPlayer fPlayer = plugin.pl.getPlayerSync(player);
if (fPlayer.isLockedUp())
{
FSync.playerMsg(player, "You're locked up and cannot talk.");
event.setCancelled(true);
return;
}
if (fPlayer.inAdminChat()) if (fPlayer.inAdminChat())
{ {
FSync.adminChatMessage(player, message); FSync.adminChatMessage(player, message);

View File

@ -92,6 +92,7 @@ public class Command_lockup extends FreedomCommand
if (lockupScheduleId != null) if (lockupScheduleId != null)
{ {
lockupScheduleId.cancel(); lockupScheduleId.cancel();
playerdata.setLockedUp(false);
playerdata.setLockupScheduleId(null); playerdata.setLockupScheduleId(null);
} }
} }
@ -107,6 +108,7 @@ public class Command_lockup extends FreedomCommand
cancelLockup(playerdata); cancelLockup(playerdata);
playerdata.setLockedUp(true);
playerdata.setLockupScheduleId(new BukkitRunnable() playerdata.setLockupScheduleId(new BukkitRunnable()
{ {
@Override @Override

View File

@ -56,6 +56,7 @@ public class FPlayer
private boolean mp44Armed = false; private boolean mp44Armed = false;
private boolean mp44Firing = false; private boolean mp44Firing = false;
private BukkitTask lockupScheduleTask = null; private BukkitTask lockupScheduleTask = null;
private boolean lockedUp = false;
private String lastMessage = ""; private String lastMessage = "";
private boolean inAdminchat = false; private boolean inAdminchat = false;
private boolean allCommandsBlocked = false; private boolean allCommandsBlocked = false;
@ -328,6 +329,16 @@ public class FPlayer
this.lockupScheduleTask = id; this.lockupScheduleTask = id;
} }
public boolean isLockedUp()
{
return this.lockedUp;
}
public void setLockedUp(boolean lockedUp)
{
this.lockedUp = lockedUp;
}
public void setLastMessage(String message) public void setLastMessage(String message)
{ {
this.lastMessage = message; this.lastMessage = message;