From 3ea73f78e982ed1831e1ca78adb503e169f7fb69 Mon Sep 17 00:00:00 2001 From: Super_ Date: Fri, 3 Jan 2020 21:42:23 -0500 Subject: [PATCH] for luke --- .../me/totalfreedom/totalfreedommod/ChatManager.java | 6 ++++++ .../totalfreedommod/command/Command_lockup.java | 2 ++ .../totalfreedom/totalfreedommod/player/FPlayer.java | 11 +++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java b/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java index 345937b8..3b6f83fa 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java @@ -69,6 +69,12 @@ public class ChatManager extends FreedomService // Check for adminchat 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()) { FSync.adminChatMessage(player, message); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_lockup.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_lockup.java index d5c135d4..1bb76832 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_lockup.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_lockup.java @@ -92,6 +92,7 @@ public class Command_lockup extends FreedomCommand if (lockupScheduleId != null) { lockupScheduleId.cancel(); + playerdata.setLockedUp(false); playerdata.setLockupScheduleId(null); } } @@ -107,6 +108,7 @@ public class Command_lockup extends FreedomCommand cancelLockup(playerdata); + playerdata.setLockedUp(true); playerdata.setLockupScheduleId(new BukkitRunnable() { @Override diff --git a/src/main/java/me/totalfreedom/totalfreedommod/player/FPlayer.java b/src/main/java/me/totalfreedom/totalfreedommod/player/FPlayer.java index 682f4a1b..d341969c 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/player/FPlayer.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/player/FPlayer.java @@ -56,6 +56,7 @@ public class FPlayer private boolean mp44Armed = false; private boolean mp44Firing = false; private BukkitTask lockupScheduleTask = null; + private boolean lockedUp = false; private String lastMessage = ""; private boolean inAdminchat = false; private boolean allCommandsBlocked = false; @@ -328,6 +329,16 @@ public class FPlayer this.lockupScheduleTask = id; } + public boolean isLockedUp() + { + return this.lockedUp; + } + + public void setLockedUp(boolean lockedUp) + { + this.lockedUp = lockedUp; + } + public void setLastMessage(String message) { this.lastMessage = message;