mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Added commandspy
This commit is contained in:
parent
5afc550144
commit
2adb11dae2
@ -3,7 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -26,7 +26,7 @@ public class Command_blockcmd extends TFM_Command
|
||||
int counter = 0;
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
if (playerdata.allCommandsBlocked())
|
||||
{
|
||||
counter += 1;
|
||||
@ -54,7 +54,7 @@ public class Command_blockcmd extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
|
||||
playerdata.setCommandsBlocked(!playerdata.allCommandsBlocked());
|
||||
|
||||
|
@ -2,7 +2,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@ -33,7 +33,7 @@ public class Command_cage extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
|
||||
Material cage_material_outer = Material.GLASS;
|
||||
Material cage_material_inner = Material.AIR;
|
||||
@ -76,8 +76,8 @@ public class Command_cage extends TFM_Command
|
||||
playerdata.regenerateHistory();
|
||||
playerdata.clearHistory();
|
||||
TFM_Util.buildHistory(target_pos, 2, playerdata);
|
||||
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.OUTER));
|
||||
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.INNER));
|
||||
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_PlayerData.CageLayer.OUTER));
|
||||
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_PlayerData.CageLayer.INNER));
|
||||
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.ONLY_IN_GAME, ignore_permissions = false)
|
||||
public class Command_cmdspy extends TFM_Command
|
||||
{
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(sender_p);
|
||||
playerdata.setCommandSpy(!playerdata.cmdspyEnabled());
|
||||
playerMsg("CommandSpy " + (playerdata.cmdspyEnabled() ? "enabled." : "disabled."));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Log;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -64,7 +64,7 @@ public class Command_fr extends TFM_Command
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata.setFrozen(false);
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ public class Command_fr extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata.setFrozen(!playerdata.isFrozen());
|
||||
|
||||
playerMsg(p.getName() + " has been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
|
||||
|
@ -3,7 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_ServerInterface;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -95,7 +95,7 @@ public class Command_gadmin extends TFM_Command
|
||||
}
|
||||
else if (mode.equals("fr"))
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata.setFrozen(!playerdata.isFrozen());
|
||||
|
||||
playerMsg(p.getName() + " has been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
|
||||
|
@ -3,7 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
@ -44,7 +44,7 @@ public class Command_halt extends TFM_Command
|
||||
int counter = 0;
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
if (TFM_UserInfo.getPlayerData(p).isHalted())
|
||||
if (TFM_PlayerData.getPlayerData(p).isHalted())
|
||||
{
|
||||
setHalted(p, false);
|
||||
counter++;
|
||||
@ -56,11 +56,11 @@ public class Command_halt extends TFM_Command
|
||||
|
||||
if (args[0].equalsIgnoreCase("list"))
|
||||
{
|
||||
TFM_UserInfo info;
|
||||
TFM_PlayerData info;
|
||||
int count = 0;
|
||||
for (Player hp : server.getOnlinePlayers())
|
||||
{
|
||||
info = TFM_UserInfo.getPlayerData(hp);
|
||||
info = TFM_PlayerData.getPlayerData(hp);
|
||||
if (info.isHalted())
|
||||
{
|
||||
if (count == 0)
|
||||
@ -90,7 +90,7 @@ public class Command_halt extends TFM_Command
|
||||
|
||||
}
|
||||
|
||||
if (!TFM_UserInfo.getPlayerData(p).isHalted())
|
||||
if (!TFM_PlayerData.getPlayerData(p).isHalted())
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Halting " + p.getName(), true);
|
||||
setHalted(p, true);
|
||||
@ -106,7 +106,7 @@ public class Command_halt extends TFM_Command
|
||||
|
||||
private static void setHalted(Player p, boolean is_halted)
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
|
||||
if (is_halted)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
@ -31,7 +31,7 @@ public class Command_lastcmd extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
|
||||
if (playerdata != null)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
import java.util.Random;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
@ -93,7 +93,7 @@ public class Command_lockup extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
private void cancelLockup(TFM_UserInfo playerdata)
|
||||
private void cancelLockup(TFM_PlayerData playerdata)
|
||||
{
|
||||
BukkitTask lockupScheduleID = playerdata.getLockupScheduleID();
|
||||
if (lockupScheduleID != null)
|
||||
@ -105,12 +105,12 @@ public class Command_lockup extends TFM_Command
|
||||
|
||||
private void cancelLockup(final Player p)
|
||||
{
|
||||
cancelLockup(TFM_UserInfo.getPlayerData(p));
|
||||
cancelLockup(TFM_PlayerData.getPlayerData(p));
|
||||
}
|
||||
|
||||
private void startLockup(final Player p)
|
||||
{
|
||||
final TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
|
||||
cancelLockup(playerdata);
|
||||
|
||||
|
@ -2,7 +2,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -28,7 +28,7 @@ public class Command_mp44 extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(sender_p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(sender_p);
|
||||
|
||||
if (args[0].equalsIgnoreCase("draw"))
|
||||
{
|
||||
|
@ -2,7 +2,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.command.Command;
|
||||
@ -23,7 +23,7 @@ public class Command_o extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_UserInfo userinfo = TFM_UserInfo.getPlayerData(sender_p);
|
||||
TFM_PlayerData userinfo = TFM_PlayerData.getPlayerData(sender_p);
|
||||
userinfo.setAdminChat(!userinfo.inAdminChat());
|
||||
playerMsg("Toggled Admin Chat " + (userinfo.inAdminChat() ? "on" : "off") + ".");
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
@ -33,7 +33,7 @@ public class Command_orbit extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
|
||||
double strength = 10.0;
|
||||
|
||||
|
@ -4,7 +4,7 @@ import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Log;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
import org.bukkit.command.Command;
|
||||
@ -25,11 +25,11 @@ public class Command_stfu extends TFM_Command
|
||||
if (args[0].equalsIgnoreCase("list"))
|
||||
{
|
||||
playerMsg("Muted players:");
|
||||
TFM_UserInfo info;
|
||||
TFM_PlayerData info;
|
||||
int count = 0;
|
||||
for (Player mp : server.getOnlinePlayers())
|
||||
{
|
||||
info = TFM_UserInfo.getPlayerData(mp);
|
||||
info = TFM_PlayerData.getPlayerData(mp);
|
||||
if (info.isMuted())
|
||||
{
|
||||
playerMsg("- " + mp.getName());
|
||||
@ -44,11 +44,11 @@ public class Command_stfu extends TFM_Command
|
||||
else if (args[0].equalsIgnoreCase("purge"))
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Unmuting all players.", true);
|
||||
TFM_UserInfo info;
|
||||
TFM_PlayerData info;
|
||||
int count = 0;
|
||||
for (Player mp : server.getOnlinePlayers())
|
||||
{
|
||||
info = TFM_UserInfo.getPlayerData(mp);
|
||||
info = TFM_PlayerData.getPlayerData(mp);
|
||||
if (info.isMuted())
|
||||
{
|
||||
info.setMuted(false);
|
||||
@ -66,13 +66,13 @@ public class Command_stfu extends TFM_Command
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Muting all non-Superadmins", true);
|
||||
|
||||
TFM_UserInfo playerdata;
|
||||
TFM_PlayerData playerdata;
|
||||
int counter = 0;
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
{
|
||||
playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata.setMuted(true);
|
||||
counter++;
|
||||
}
|
||||
@ -92,7 +92,7 @@ public class Command_stfu extends TFM_Command
|
||||
TFM_Util.adminAction("MuteTimer", "Unmuting all players", false);
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_UserInfo.getPlayerData(p).setMuted(false);
|
||||
TFM_PlayerData.getPlayerData(p).setMuted(false);
|
||||
}
|
||||
|
||||
TotalFreedomMod.mutePurgeEventId = 0;
|
||||
@ -113,7 +113,7 @@ public class Command_stfu extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
if (playerdata.isMuted())
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Unmuting " + p.getName(), true);
|
||||
|
@ -2,7 +2,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -26,7 +26,7 @@ public class Command_tossmob extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_UserInfo playerData = TFM_UserInfo.getPlayerData(sender_p);
|
||||
TFM_PlayerData playerData = TFM_PlayerData.getPlayerData(sender_p);
|
||||
|
||||
EntityType creature = EntityType.PIG;
|
||||
if (args.length >= 1)
|
||||
|
@ -0,0 +1,6 @@
|
||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
|
||||
class PlayerData {
|
||||
|
||||
}
|
@ -5,7 +5,7 @@ import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL;
|
||||
import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Log;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -115,7 +115,7 @@ public class TFM_Command
|
||||
{
|
||||
if (is_senior)
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(sender_p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(sender_p);
|
||||
Boolean superadminIdVerified = playerdata.isSuperadminIdVerified();
|
||||
|
||||
if (superadminIdVerified != null)
|
||||
|
@ -3,7 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Listener;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Log;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_ProtectedArea;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -46,7 +46,7 @@ public class TFM_BlockListener implements Listener
|
||||
|
||||
if (TotalFreedomMod.nukeMonitor)
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
|
||||
Location player_pos = p.getLocation();
|
||||
|
||||
@ -109,7 +109,7 @@ public class TFM_BlockListener implements Listener
|
||||
|
||||
if (TotalFreedomMod.nukeMonitor)
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
|
||||
Location player_pos = p.getLocation();
|
||||
|
||||
|
@ -28,7 +28,7 @@ import org.bukkit.util.Vector;
|
||||
|
||||
public class TFM_PlayerListener implements Listener
|
||||
{
|
||||
private static final List<String> BLOCKED_MUTED_CMDS = Arrays.asList(StringUtils.split("say,me,msg,m,tell,r,reply", ","));
|
||||
private static final List<String> BLOCKED_MUTED_CMDS = Arrays.asList(StringUtils.split("say,me,msg,m,tell,r,reply,mail,email", ","));
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerInteract(PlayerInteractEvent event)
|
||||
@ -70,7 +70,7 @@ public class TFM_PlayerListener implements Listener
|
||||
{
|
||||
case STICK:
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(player);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
if (playerdata.mobThrowerEnabled())
|
||||
{
|
||||
Location player_pos = player.getLocation();
|
||||
@ -87,7 +87,7 @@ public class TFM_PlayerListener implements Listener
|
||||
}
|
||||
case SULPHUR:
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(player);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
if (playerdata.isMP44Armed())
|
||||
{
|
||||
if (playerdata.toggleMP44Firing())
|
||||
@ -132,7 +132,6 @@ public class TFM_PlayerListener implements Listener
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -193,7 +192,6 @@ public class TFM_PlayerListener implements Listener
|
||||
}, 30L);
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -208,7 +206,7 @@ public class TFM_PlayerListener implements Listener
|
||||
public void onPlayerMove(PlayerMoveEvent event)
|
||||
{
|
||||
Player p = event.getPlayer();
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
|
||||
for (Entry<Player, Double> fuckoff : TotalFreedomMod.fuckoffEnabledFor.entrySet())
|
||||
{
|
||||
@ -285,12 +283,12 @@ public class TFM_PlayerListener implements Listener
|
||||
|
||||
if (out_of_cage)
|
||||
{
|
||||
playerdata.setCaged(true, target_pos, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.OUTER), playerdata.getCageMaterial(TFM_UserInfo.CageLayer.INNER));
|
||||
playerdata.setCaged(true, target_pos, playerdata.getCageMaterial(TFM_PlayerData.CageLayer.OUTER), playerdata.getCageMaterial(TFM_PlayerData.CageLayer.INNER));
|
||||
playerdata.regenerateHistory();
|
||||
playerdata.clearHistory();
|
||||
TFM_Util.buildHistory(target_pos, 2, playerdata);
|
||||
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.OUTER));
|
||||
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.INNER));
|
||||
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_PlayerData.CageLayer.OUTER));
|
||||
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_PlayerData.CageLayer.INNER));
|
||||
}
|
||||
}
|
||||
|
||||
@ -355,7 +353,7 @@ public class TFM_PlayerListener implements Listener
|
||||
final Player p = event.getPlayer();
|
||||
String message = event.getMessage().trim();
|
||||
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata.incrementMsgCount();
|
||||
|
||||
// check for spam
|
||||
@ -444,7 +442,7 @@ public class TFM_PlayerListener implements Listener
|
||||
String command = event.getMessage();
|
||||
Player p = event.getPlayer();
|
||||
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata.incrementMsgCount();
|
||||
|
||||
if (playerdata.getMsgCount() > 10)
|
||||
@ -588,6 +586,18 @@ public class TFM_PlayerListener implements Listener
|
||||
{
|
||||
playerdata.setMuted(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
{
|
||||
for (Player pl : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (TFM_SuperadminList.isUserSuperadmin(pl) && TFM_PlayerData.getPlayerData(pl).cmdspyEnabled())
|
||||
{
|
||||
TFM_Util.playerMsg(pl, p.getName() + ": " + command);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -615,7 +625,7 @@ public class TFM_PlayerListener implements Listener
|
||||
{
|
||||
TotalFreedomMod.fuckoffEnabledFor.remove(p);
|
||||
}
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata.disarmMP44();
|
||||
if (playerdata.isCaged())
|
||||
{
|
||||
@ -632,7 +642,7 @@ public class TFM_PlayerListener implements Listener
|
||||
{
|
||||
TotalFreedomMod.fuckoffEnabledFor.remove(p);
|
||||
}
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata.disarmMP44();
|
||||
if (playerdata.isCaged())
|
||||
{
|
||||
@ -647,7 +657,7 @@ public class TFM_PlayerListener implements Listener
|
||||
try
|
||||
{
|
||||
final Player p = event.getPlayer();
|
||||
final TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata.setSuperadminIdVerified(null);
|
||||
|
||||
TFM_UserList.getInstance(TotalFreedomMod.plugin).addUser(p);
|
||||
|
@ -20,7 +20,7 @@ public class TFM_Heartbeat implements Runnable
|
||||
{
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata.resetMsgCount();
|
||||
playerdata.resetBlockDestroyCount();
|
||||
playerdata.resetBlockPlaceCount();
|
||||
|
@ -15,9 +15,9 @@ import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
public class TFM_UserInfo
|
||||
public class TFM_PlayerData
|
||||
{
|
||||
public final static Map<Player, TFM_UserInfo> userinfo = new HashMap<Player, TFM_UserInfo>();
|
||||
public final static Map<Player, TFM_PlayerData> userinfo = new HashMap<Player, TFM_PlayerData>();
|
||||
private final Player player;
|
||||
private final String ip_address;
|
||||
private final String player_name;
|
||||
@ -49,25 +49,26 @@ public class TFM_UserInfo
|
||||
private boolean all_commands_blocked = false;
|
||||
private Boolean superadmin_id_verified = null;
|
||||
private String last_command = "";
|
||||
private boolean cmdspy_enabled = false;
|
||||
|
||||
public TFM_UserInfo(Player player)
|
||||
public TFM_PlayerData(Player player)
|
||||
{
|
||||
this.player = player;
|
||||
this.ip_address = player.getAddress().getAddress().getHostAddress();
|
||||
this.player_name = player.getName();
|
||||
}
|
||||
|
||||
public static TFM_UserInfo getPlayerData(Player p)
|
||||
public static TFM_PlayerData getPlayerData(Player p)
|
||||
{
|
||||
TFM_UserInfo playerdata = TFM_UserInfo.userinfo.get(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.userinfo.get(p);
|
||||
|
||||
if (playerdata == null)
|
||||
{
|
||||
Iterator<Entry<Player, TFM_UserInfo>> it = userinfo.entrySet().iterator();
|
||||
Iterator<Entry<Player, TFM_PlayerData>> it = userinfo.entrySet().iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
Entry<Player, TFM_UserInfo> pair = it.next();
|
||||
TFM_UserInfo playerdata_test = pair.getValue();
|
||||
Entry<Player, TFM_PlayerData> pair = it.next();
|
||||
TFM_PlayerData playerdata_test = pair.getValue();
|
||||
|
||||
if (playerdata_test.player_name.equalsIgnoreCase(p.getName()))
|
||||
{
|
||||
@ -90,8 +91,8 @@ public class TFM_UserInfo
|
||||
|
||||
if (playerdata == null)
|
||||
{
|
||||
playerdata = new TFM_UserInfo(p);
|
||||
TFM_UserInfo.userinfo.put(p, playerdata);
|
||||
playerdata = new TFM_PlayerData(p);
|
||||
TFM_PlayerData.userinfo.put(p, playerdata);
|
||||
}
|
||||
|
||||
return playerdata;
|
||||
@ -109,7 +110,7 @@ public class TFM_UserInfo
|
||||
|
||||
public boolean isOrbiting()
|
||||
{
|
||||
return this.is_orbiting;
|
||||
return is_orbiting;
|
||||
}
|
||||
|
||||
public void startOrbiting(double orbit_strength)
|
||||
@ -120,12 +121,12 @@ public class TFM_UserInfo
|
||||
|
||||
public void stopOrbiting()
|
||||
{
|
||||
this.is_orbiting = false;
|
||||
is_orbiting = false;
|
||||
}
|
||||
|
||||
public double orbitStrength()
|
||||
{
|
||||
return this.orbit_strength;
|
||||
return orbit_strength;
|
||||
}
|
||||
|
||||
public void setCaged(boolean state)
|
||||
@ -143,7 +144,7 @@ public class TFM_UserInfo
|
||||
|
||||
public boolean isCaged()
|
||||
{
|
||||
return this.user_caged;
|
||||
return user_caged;
|
||||
}
|
||||
|
||||
public enum CageLayer
|
||||
@ -166,7 +167,7 @@ public class TFM_UserInfo
|
||||
|
||||
public Location getCagePos()
|
||||
{
|
||||
return this.user_cage_pos;
|
||||
return user_cage_pos;
|
||||
}
|
||||
|
||||
public void clearHistory()
|
||||
@ -221,7 +222,7 @@ public class TFM_UserInfo
|
||||
|
||||
public int getMsgCount()
|
||||
{
|
||||
return this.msg_count;
|
||||
return msg_count;
|
||||
}
|
||||
|
||||
public void incrementBlockDestroyCount()
|
||||
@ -231,7 +232,7 @@ public class TFM_UserInfo
|
||||
|
||||
public int getBlockDestroyCount()
|
||||
{
|
||||
return this.block_destroy_total;
|
||||
return block_destroy_total;
|
||||
}
|
||||
|
||||
public void resetBlockDestroyCount()
|
||||
@ -246,7 +247,7 @@ public class TFM_UserInfo
|
||||
|
||||
public int getBlockPlaceCount()
|
||||
{
|
||||
return this.block_place_total;
|
||||
return block_place_total;
|
||||
}
|
||||
|
||||
public void resetBlockPlaceCount()
|
||||
@ -261,7 +262,7 @@ public class TFM_UserInfo
|
||||
|
||||
public int getFreecamDestroyCount()
|
||||
{
|
||||
return this.freecam_destroy_count;
|
||||
return freecam_destroy_count;
|
||||
}
|
||||
|
||||
public void resetFreecamDestroyCount()
|
||||
@ -276,7 +277,7 @@ public class TFM_UserInfo
|
||||
|
||||
public int getFreecamPlaceCount()
|
||||
{
|
||||
return this.freecam_place_count;
|
||||
return freecam_place_count;
|
||||
}
|
||||
|
||||
public void resetFreecamPlaceCount()
|
||||
@ -298,17 +299,17 @@ public class TFM_UserInfo
|
||||
|
||||
public EntityType mobThrowerCreature()
|
||||
{
|
||||
return this.mob_thrower_creature;
|
||||
return mob_thrower_creature;
|
||||
}
|
||||
|
||||
public double mobThrowerSpeed()
|
||||
{
|
||||
return this.mob_thrower_speed;
|
||||
return mob_thrower_speed;
|
||||
}
|
||||
|
||||
public boolean mobThrowerEnabled()
|
||||
{
|
||||
return this.mob_thrower_enabled;
|
||||
return mob_thrower_enabled;
|
||||
}
|
||||
|
||||
public void enqueueMob(LivingEntity mob)
|
||||
@ -372,13 +373,13 @@ public class TFM_UserInfo
|
||||
|
||||
public boolean isMP44Armed()
|
||||
{
|
||||
return this.mp44_armed;
|
||||
return mp44_armed;
|
||||
}
|
||||
|
||||
public boolean toggleMP44Firing()
|
||||
{
|
||||
this.mp44_firing = !this.mp44_firing;
|
||||
return this.mp44_firing;
|
||||
return mp44_firing;
|
||||
}
|
||||
|
||||
public boolean isMuted()
|
||||
@ -418,7 +419,7 @@ public class TFM_UserInfo
|
||||
|
||||
public String getLastMessage()
|
||||
{
|
||||
return this.last_message;
|
||||
return last_message;
|
||||
}
|
||||
|
||||
public void setAdminChat(boolean in_adminchat)
|
||||
@ -428,12 +429,12 @@ public class TFM_UserInfo
|
||||
|
||||
public boolean inAdminChat()
|
||||
{
|
||||
return this.in_adminchat;
|
||||
return in_adminchat;
|
||||
}
|
||||
|
||||
public boolean allCommandsBlocked()
|
||||
{
|
||||
return this.all_commands_blocked;
|
||||
return all_commands_blocked;
|
||||
}
|
||||
|
||||
public void setCommandsBlocked(boolean commands_blocked)
|
||||
@ -464,4 +465,15 @@ public class TFM_UserInfo
|
||||
{
|
||||
this.last_command = last_command;
|
||||
}
|
||||
|
||||
public void setCommandSpy(boolean cmdspy_enabled)
|
||||
{
|
||||
this.cmdspy_enabled = cmdspy_enabled;
|
||||
}
|
||||
|
||||
public boolean cmdspyEnabled()
|
||||
{
|
||||
return cmdspy_enabled;
|
||||
}
|
||||
|
||||
}
|
@ -18,6 +18,7 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
@ -67,13 +68,13 @@ public class TFM_Util
|
||||
TFM_Util.bcastMsg(message, null);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
// Still in use by listeners
|
||||
public static void playerMsg(CommandSender sender, String message, ChatColor color)
|
||||
{
|
||||
sender.sendMessage(color + message);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
// Still in use by listeners
|
||||
public static void playerMsg(CommandSender sender, String message)
|
||||
{
|
||||
TFM_Util.playerMsg(sender, message, ChatColor.GRAY);
|
||||
@ -130,7 +131,7 @@ public class TFM_Util
|
||||
}
|
||||
}
|
||||
|
||||
public static void buildHistory(Location location, int length, TFM_UserInfo playerdata)
|
||||
public static void buildHistory(Location location, int length, TFM_PlayerData playerdata)
|
||||
{
|
||||
Block center_block = location.getBlock();
|
||||
for (int x_offset = -length; x_offset <= length; x_offset++)
|
||||
|
@ -26,6 +26,9 @@ commands:
|
||||
cmdlist:
|
||||
description: Show all commands for all server plugins.
|
||||
usage: /<command>
|
||||
cmdspy:
|
||||
description: Superadmin command - Spy on commands
|
||||
usage: /<command>
|
||||
cookie:
|
||||
description: Superadmin command - cookies :)
|
||||
usage: /<command>
|
||||
|
Loading…
Reference in New Issue
Block a user