mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-13 12:48:35 +00:00
staff -> admins
* rename everything containing staff back to admin (as requested by ryan i've renamed commands like slconfig to saconfig but left "slconfig" as an alias) * format almost every file correctly * a few other improvements
This commit is contained in:
@ -5,7 +5,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -16,7 +16,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Allows staff to see potions that are thrown.", usage = "/<command> <enable | on | disable | off> | history [player] <page>", aliases = "potspy")
|
||||
@CommandParameters(description = "Allows admins to see potions that are thrown.", usage = "/<command> <enable | on | disable | off> | history [player] <page>", aliases = "potspy")
|
||||
public class Command_potionspy extends FreedomCommand
|
||||
{
|
||||
private String titleText = "&8&m------------------&r &ePotionSpy &8&m------------------&r";
|
||||
@ -28,11 +28,11 @@ public class Command_potionspy extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
StaffMember staffMember = plugin.sl.getAdmin(playerSender);
|
||||
Admin admin = plugin.al.getAdmin(playerSender);
|
||||
|
||||
if (args.length <= 0)
|
||||
{
|
||||
setPotionSpyState(staffMember, !staffMember.getPotionSpy());
|
||||
setPotionSpyState(admin, !admin.getPotionSpy());
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -41,12 +41,12 @@ public class Command_potionspy extends FreedomCommand
|
||||
{
|
||||
case "enable":
|
||||
case "on":
|
||||
setPotionSpyState(staffMember, true);
|
||||
setPotionSpyState(admin, true);
|
||||
break;
|
||||
|
||||
case "disable":
|
||||
case "off":
|
||||
setPotionSpyState(staffMember, false);
|
||||
setPotionSpyState(admin, false);
|
||||
break;
|
||||
|
||||
case "history":
|
||||
@ -115,7 +115,7 @@ public class Command_potionspy extends FreedomCommand
|
||||
|
||||
if (thrownPotions.isEmpty())
|
||||
{
|
||||
if(Bukkit.getPlayer(args[1]) != null)
|
||||
if (Bukkit.getPlayer(args[1]) != null)
|
||||
{
|
||||
msg(sender, noPlayerRecord);
|
||||
}
|
||||
@ -176,18 +176,19 @@ public class Command_potionspy extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setPotionSpyState(StaffMember staffMember, boolean state)
|
||||
private void setPotionSpyState(Admin admin, boolean state)
|
||||
{
|
||||
staffMember.setPotionSpy(state);
|
||||
plugin.sl.save(staffMember);
|
||||
plugin.sl.updateTables();
|
||||
msg("PotionSpy is now " + (staffMember.getPotionSpy() ? "enabled." : "disabled."));
|
||||
admin.setPotionSpy(state);
|
||||
plugin.al.save(admin);
|
||||
plugin.al.updateTables();
|
||||
msg("PotionSpy is now " + (admin.getPotionSpy() ? "enabled." : "disabled."));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the unix time difference in string format (1h, 30m, 15s).
|
||||
*
|
||||
* @param past The unix time at the start.
|
||||
* @param now The current unix time.
|
||||
* @param now The current unix time.
|
||||
* @return A string that displays the time difference between the two unix time values.
|
||||
*/
|
||||
private String getUnixTimeDifference(long past, long now)
|
||||
@ -219,4 +220,4 @@ public class Command_potionspy extends FreedomCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user