diff --git a/src/config.yml b/src/config.yml index 166424f4..b94dfd2c 100644 --- a/src/config.yml +++ b/src/config.yml @@ -64,3 +64,8 @@ auto_protect_radius: 25.0 host_sender_names: - rcon - remotebukkit + +# TwitterBot - Used to allow superadmins to verify themselves using twitter +twitterbot_enabled: false +twitterbot_url: 'http://tftwitter.darthcraft.net/' +twitterbot_secret: '' diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/PlayerData.java b/src/me/StevenLawson/TotalFreedomMod/Commands/AdminLevel.java similarity index 50% rename from src/me/StevenLawson/TotalFreedomMod/Commands/PlayerData.java rename to src/me/StevenLawson/TotalFreedomMod/Commands/AdminLevel.java index e12a3f28..48131c86 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/PlayerData.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/AdminLevel.java @@ -1,6 +1,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; - -class PlayerData { - +public enum AdminLevel +{ + ALL, OP, SUPER, SENIOR } diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/CommandPermissions.java b/src/me/StevenLawson/TotalFreedomMod/Commands/CommandPermissions.java index 4e24817b..f36fba92 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/CommandPermissions.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/CommandPermissions.java @@ -6,23 +6,12 @@ import java.lang.annotation.RetentionPolicy; @Retention(RetentionPolicy.RUNTIME) public @interface CommandPermissions { - ADMIN_LEVEL level(); + AdminLevel level(); - SOURCE_TYPE_ALLOWED source(); + SourceType source(); boolean block_host_console() default false; - boolean ignore_permissions() default true; - - public enum ADMIN_LEVEL - { - ALL, OP, SUPER, SENIOR - } - - public enum SOURCE_TYPE_ALLOWED - { - ONLY_IN_GAME, ONLY_CONSOLE, BOTH - } - + boolean ignore_permissions() default false; // O_o } diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_adminmode.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_adminmode.java index ca274c18..c79704c2 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_adminmode.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_adminmode.java @@ -1,7 +1,5 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; @@ -9,7 +7,7 @@ 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_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_adminmode extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_blockcmd.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_blockcmd.java index 128005cf..b25ac317 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_blockcmd.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_blockcmd.java @@ -1,7 +1,5 @@ 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_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_Util; @@ -9,7 +7,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_blockcmd extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_blockcommand.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_blockcommand.java new file mode 100644 index 00000000..e4826039 --- /dev/null +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_blockcommand.java @@ -0,0 +1,40 @@ +package me.StevenLawson.TotalFreedomMod.Commands; + +import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; +import me.StevenLawson.TotalFreedomMod.TFM_Util; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) +public class Command_blockcommand extends TFM_Command +{ + @Override + public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) + { + if (args.length != 1) + { + return false; + } + + Player p; + try + { + p = getPlayer(args[0]); + } + catch (CantFindPlayerException ex) + { + sender.sendMessage(ex.getMessage()); + return true; + } + + TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p); + + playerdata.setCommandsBlocked(!playerdata.allCommandsBlocked()); + + TFM_Util.adminAction(sender.getName(), (playerdata.allCommandsBlocked() ? "B" : "Unb") + "locking all commands for " + p.getName(), true); + TFM_Util.playerMsg(sender, (playerdata.allCommandsBlocked() ? "B" : "Unb") + "locked all commands."); + + return true; + } +} diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cage.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cage.java index 7003ea8b..046787d5 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cage.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cage.java @@ -1,7 +1,5 @@ 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 me.StevenLawson.TotalFreedomMod.TFM_Util; import org.bukkit.GameMode; @@ -11,7 +9,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_cage extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cake.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cake.java index 004c74e6..1a18c4a3 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cake.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cake.java @@ -1,8 +1,6 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.ChatColor; @@ -12,7 +10,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_cake extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cartsit.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cartsit.java index e0efee7b..ed69c6c9 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cartsit.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cartsit.java @@ -1,14 +1,12 @@ 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 org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Minecart; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.ALL, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = true) +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH, ignore_permissions = true) public class Command_cartsit extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_clearall.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_clearall.java index de050082..42f76740 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_clearall.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_clearall.java @@ -1,12 +1,10 @@ package me.StevenLawson.TotalFreedomMod.Commands; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_clearall extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdlist.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdlist.java index 4d87c656..c1e2113d 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdlist.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdlist.java @@ -5,8 +5,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED; import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -14,7 +12,7 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginDescriptionFile; -@CommandPermissions(level = ADMIN_LEVEL.ALL, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = true) +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH, ignore_permissions = true) public class Command_cmdlist extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdspy.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdspy.java index 0fc12fed..0a993049 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdspy.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cmdspy.java @@ -1,14 +1,12 @@ 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) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_cmdspy extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cookie.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cookie.java index c124ba09..259c9d58 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cookie.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cookie.java @@ -1,8 +1,6 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.ChatColor; @@ -12,7 +10,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_cookie extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java index ad4ee998..56866eec 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java @@ -1,14 +1,12 @@ 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 org.bukkit.GameMode; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH, ignore_permissions = false) public class Command_creative extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_csay.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_csay.java index 8b835903..a95f64c9 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_csay.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_csay.java @@ -1,14 +1,12 @@ 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_Util; import org.apache.commons.lang.StringUtils; 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_CONSOLE, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.ONLY_CONSOLE, ignore_permissions = false) public class Command_csay extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deafen.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deafen.java index 1960a70d..0ded5983 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deafen.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deafen.java @@ -1,15 +1,13 @@ 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 org.bukkit.Location; import org.bukkit.Sound; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.BOTH, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.BOTH, block_host_console = true, ignore_permissions = false) public class Command_deafen extends TFM_Command { private static final Random random = new Random(); diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deop.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deop.java index c594c8bd..b070f53f 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deop.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deop.java @@ -1,14 +1,12 @@ 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_Util; import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_deop extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deopall.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deopall.java index 539827ea..fa20623c 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deopall.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deopall.java @@ -1,14 +1,12 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_deopall extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_dispfill.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_dispfill.java index a9694327..e5a0e194 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_dispfill.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_dispfill.java @@ -2,8 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.util.ArrayList; import java.util.List; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED; import me.StevenLawson.TotalFreedomMod.TFM_Util; import org.apache.commons.lang.StringUtils; import org.bukkit.Location; @@ -16,7 +14,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.ONLY_IN_GAME, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_dispfill extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_doom.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_doom.java index ab99fecb..8ae001d8 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_doom.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_doom.java @@ -1,7 +1,5 @@ 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_SuperadminList; import me.StevenLawson.TotalFreedomMod.TFM_Util; @@ -11,7 +9,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, ignore_permissions = false) public class Command_doom extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_enchant.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_enchant.java index 2cfccf59..9a165519 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_enchant.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_enchant.java @@ -1,14 +1,12 @@ package me.StevenLawson.TotalFreedomMod.Commands; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.ONLY_IN_GAME, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_enchant extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ender.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ender.java index f9a66bc1..8bdda743 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ender.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ender.java @@ -1,13 +1,11 @@ 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_Util; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.ALL, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = true) +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH, ignore_permissions = true) public class Command_ender extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_expel.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_expel.java index 19edb101..b588b4c1 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_expel.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_expel.java @@ -1,13 +1,11 @@ package me.StevenLawson.TotalFreedomMod.Commands; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED; import org.bukkit.Location; 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) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_expel extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_explosives.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_explosives.java index 9b61c16e..0636e088 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_explosives.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_explosives.java @@ -1,14 +1,12 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_explosives extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fireplace.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fireplace.java index 53dbb1db..cd22e003 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fireplace.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fireplace.java @@ -1,13 +1,11 @@ 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.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_fireplace extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_firespread.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_firespread.java index 6831acfa..de5529c9 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_firespread.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_firespread.java @@ -1,13 +1,11 @@ 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.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_firespread extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_flatlands.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_flatlands.java index ebfe4921..18ec9875 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_flatlands.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_flatlands.java @@ -1,14 +1,12 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.ALL, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = true) +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH, ignore_permissions = true) public class Command_flatlands extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fluidspread.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fluidspread.java index ee64b651..13e125e5 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fluidspread.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fluidspread.java @@ -1,13 +1,11 @@ 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.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_fluidspread extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fr.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fr.java index 988406e2..7bf0ac31 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fr.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fr.java @@ -1,7 +1,5 @@ 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_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_Util; @@ -11,7 +9,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_fr extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fuckoff.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fuckoff.java index 33f7d9ab..acd2997b 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fuckoff.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fuckoff.java @@ -1,13 +1,11 @@ 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.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_IN_GAME, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_fuckoff extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gadmin.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gadmin.java index c07e622e..ec8c7e88 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gadmin.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gadmin.java @@ -1,7 +1,5 @@ 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_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_Util; @@ -11,7 +9,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_gadmin extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gcmd.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gcmd.java index d7f554c8..a9a5aa5c 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gcmd.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gcmd.java @@ -1,13 +1,11 @@ package me.StevenLawson.TotalFreedomMod.Commands; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_gcmd extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java index 17859498..6e676a39 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java @@ -2,8 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.util.ArrayList; import java.util.List; -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_SuperadminList; import me.StevenLawson.TotalFreedomMod.TFM_UserList; @@ -14,7 +12,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_glist extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gtfo.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gtfo.java index a0111e2b..914f6de8 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gtfo.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gtfo.java @@ -1,7 +1,5 @@ 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_Util; import org.bukkit.ChatColor; @@ -11,7 +9,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_gtfo extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_halt.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_halt.java index 6b8dbac5..d294faab 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_halt.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_halt.java @@ -1,7 +1,5 @@ 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_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_Util; @@ -11,7 +9,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_halt extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_health.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_health.java index 10d6776c..e747fb9a 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_health.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_health.java @@ -1,8 +1,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.text.DecimalFormat; -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_TickMeter; import org.apache.commons.lang.exception.ExceptionUtils; @@ -12,7 +10,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_health extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_kicknoob.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_kicknoob.java index be6fa751..2b622ee1 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_kicknoob.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_kicknoob.java @@ -1,7 +1,5 @@ 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_Util; import org.bukkit.ChatColor; @@ -9,7 +7,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.BOTH, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.BOTH, block_host_console = true, ignore_permissions = false) public class Command_kicknoob extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_landmine.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_landmine.java index eecdeac7..044437b9 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_landmine.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_landmine.java @@ -1,7 +1,5 @@ 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_LandmineData; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.ChatColor; @@ -12,7 +10,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.ONLY_IN_GAME, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_landmine extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lastcmd.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lastcmd.java index df10fe3e..ba21a62a 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lastcmd.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lastcmd.java @@ -1,7 +1,5 @@ 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 me.StevenLawson.TotalFreedomMod.TFM_Util; import org.bukkit.ChatColor; @@ -9,7 +7,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_lastcmd extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavadmg.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavadmg.java index 9fd7f570..0933745a 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavadmg.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavadmg.java @@ -1,13 +1,11 @@ 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.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_lavadmg extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavaplace.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavaplace.java index ac1e06ed..e7f03f6f 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavaplace.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavaplace.java @@ -1,13 +1,11 @@ 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.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_lavaplace extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_list.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_list.java index 4e5f7323..92a9c673 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_list.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_list.java @@ -2,8 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.util.ArrayList; import java.util.List; -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_Util; import org.apache.commons.lang.StringUtils; @@ -12,7 +10,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.ALL, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = true) +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH, ignore_permissions = true) public class Command_list extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_listsync.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_listsync.java index f0a58101..61fa31f7 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_listsync.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_listsync.java @@ -1,8 +1,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.io.File; -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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; @@ -10,7 +8,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_listsync extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lockup.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lockup.java index f90a0f70..29462d1c 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lockup.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lockup.java @@ -1,8 +1,6 @@ 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_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_Util; import org.bukkit.Location; @@ -11,7 +9,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitTask; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_lockup extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_moblimiter.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_moblimiter.java index 7030c51f..b8a5751b 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_moblimiter.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_moblimiter.java @@ -1,13 +1,11 @@ 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.TotalFreedomMod; 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_CONSOLE, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.ONLY_CONSOLE, ignore_permissions = false) public class Command_moblimiter extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_mp.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_mp.java index a69dd217..620e2650 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_mp.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_mp.java @@ -1,14 +1,12 @@ package me.StevenLawson.TotalFreedomMod.Commands; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED; import org.bukkit.ChatColor; import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.*; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH, ignore_permissions = false) public class Command_mp extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_mp44.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_mp44.java index ae961f3d..afe03bcb 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_mp44.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_mp44.java @@ -1,7 +1,5 @@ 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 me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.ChatColor; @@ -11,7 +9,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.ONLY_IN_GAME, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_mp44 extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nether.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nether.java index 347caff1..c888c8a6 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nether.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nether.java @@ -1,13 +1,11 @@ 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_Util; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.ALL, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = true) +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH, ignore_permissions = true) public class Command_nether extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nonuke.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nonuke.java index 698c9ae7..affa24c3 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nonuke.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nonuke.java @@ -1,13 +1,11 @@ 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.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_nonuke extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_o.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_o.java index b558e36b..937a9cf5 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_o.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_o.java @@ -1,7 +1,5 @@ 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 me.StevenLawson.TotalFreedomMod.TFM_Util; import org.apache.commons.lang.StringUtils; @@ -9,7 +7,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_o extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_onlinemode.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_onlinemode.java index 39feb89a..de107ba1 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_onlinemode.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_onlinemode.java @@ -1,7 +1,5 @@ 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_ServerInterface; import me.StevenLawson.TotalFreedomMod.TFM_Util; @@ -10,7 +8,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_onlinemode extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_op.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_op.java index 2847fa29..2fd23860 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_op.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_op.java @@ -1,7 +1,5 @@ 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_Util; import org.bukkit.ChatColor; @@ -10,7 +8,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH, ignore_permissions = false) public class Command_op extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opall.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opall.java index 2056822b..8aab1445 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opall.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opall.java @@ -1,7 +1,5 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.GameMode; @@ -9,7 +7,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_opall extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opme.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opme.java index f9bdb5cc..6359f3a4 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opme.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opme.java @@ -1,14 +1,12 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; 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) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_opme extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ops.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ops.java index c0a85ca8..365bee1d 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ops.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ops.java @@ -1,7 +1,5 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.OfflinePlayer; @@ -9,7 +7,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH, ignore_permissions = false) public class Command_ops extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_orbit.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_orbit.java index 4fc5fe15..9d2f8d18 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_orbit.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_orbit.java @@ -1,7 +1,5 @@ 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 me.StevenLawson.TotalFreedomMod.TFM_Util; import org.bukkit.ChatColor; @@ -11,7 +9,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.util.Vector; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_orbit extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_permban.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_permban.java index 171c2144..4b52ebb0 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_permban.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_permban.java @@ -1,7 +1,5 @@ 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.TotalFreedomMod; import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; @@ -9,7 +7,8 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, block_host_console = true, ignore_permissions = false) + +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_permban extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_potion.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_potion.java index d8d7b052..b17133ec 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_potion.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_potion.java @@ -2,8 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.util.ArrayList; import java.util.List; -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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; @@ -15,7 +13,7 @@ import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH, ignore_permissions = false) public class Command_potion extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_prelog.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_prelog.java index 4ddde5b2..03084cfe 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_prelog.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_prelog.java @@ -1,13 +1,11 @@ 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.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_prelog extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_protectarea.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_protectarea.java index 69b8105a..5e7de720 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_protectarea.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_protectarea.java @@ -1,7 +1,5 @@ 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_ProtectedArea; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.apache.commons.lang.StringUtils; @@ -9,7 +7,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_protectarea extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qdeop.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qdeop.java index 0954b464..785a1766 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qdeop.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qdeop.java @@ -1,14 +1,12 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_qdeop extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qop.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qop.java index fa02d8a4..b2dc05af 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qop.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qop.java @@ -1,14 +1,12 @@ 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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_qop extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_radar.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_radar.java index c2418a5c..056966b8 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_radar.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_radar.java @@ -3,8 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED; import me.StevenLawson.TotalFreedomMod.TFM_RadarData; import org.bukkit.ChatColor; import org.bukkit.Location; @@ -12,7 +10,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.ALL, source = SOURCE_TYPE_ALLOWED.ONLY_IN_GAME, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_radar extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rank.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rank.java index 585a94c6..7626a101 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rank.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rank.java @@ -1,14 +1,12 @@ 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_Util; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.ALL, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = true) +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH, ignore_permissions = true) public class Command_rank extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rawsay.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rawsay.java index be0832e4..bf52aa33 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rawsay.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rawsay.java @@ -1,14 +1,12 @@ 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_Util; import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_rawsay extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rd.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rd.java index 2e695c94..99448698 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rd.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_rd.java @@ -1,13 +1,11 @@ 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_Util; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_rd extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ro.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ro.java index 0fab4922..b621858c 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ro.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ro.java @@ -1,7 +1,5 @@ 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_Util; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -9,7 +7,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, block_host_console = false, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, block_host_console = false, ignore_permissions = false) public class Command_ro extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java index bf41c95a..58f84b19 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java @@ -1,7 +1,5 @@ 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_Superadmin; import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList; import me.StevenLawson.TotalFreedomMod.TFM_Util; @@ -12,7 +10,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH, ignore_permissions = false) public class Command_saconfig extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_say.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_say.java index 6bd3ed1b..a39ec115 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_say.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_say.java @@ -1,7 +1,5 @@ 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_Util; import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; @@ -9,7 +7,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_say extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setlevel.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setlevel.java index a52f8673..bb7fe7ea 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setlevel.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setlevel.java @@ -1,13 +1,11 @@ package me.StevenLawson.TotalFreedomMod.Commands; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.ONLY_IN_GAME, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_setlevel extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setspawnworld.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setspawnworld.java index dd835f1d..2c1930d0 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setspawnworld.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setspawnworld.java @@ -1,7 +1,5 @@ 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_ProtectedArea; import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; @@ -10,7 +8,7 @@ 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) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_setspawnworld extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_smite.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_smite.java index e33eb4fd..587bb2e4 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_smite.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_smite.java @@ -1,7 +1,5 @@ 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_Util; import org.bukkit.ChatColor; import org.bukkit.GameMode; @@ -11,7 +9,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_smite extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_status.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_status.java index f8a995d8..5869c274 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_status.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_status.java @@ -9,8 +9,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; -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.TotalFreedomMod; import org.apache.commons.lang.StringUtils; @@ -23,7 +21,7 @@ import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue; -@CommandPermissions(level = ADMIN_LEVEL.ALL, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = true) +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH, ignore_permissions = true) public class Command_status extends TFM_Command { public static final Map SERVICE_MAP = new HashMap(); diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stfu.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stfu.java index 1f4ba4c8..1254af3d 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stfu.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stfu.java @@ -1,7 +1,5 @@ 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_SuperadminList; import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; @@ -11,7 +9,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_stfu extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stop.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stop.java index 18212112..98557245 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stop.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stop.java @@ -1,14 +1,12 @@ 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_Util; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_stop extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java index 06819d63..a5dfb35b 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java @@ -1,7 +1,5 @@ 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 org.bukkit.ChatColor; import org.bukkit.GameMode; @@ -9,7 +7,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH, ignore_permissions = false) public class Command_survival extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tempban.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tempban.java index 090beb7c..a5043bb1 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tempban.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tempban.java @@ -2,8 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.text.SimpleDateFormat; import java.util.Date; -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_Util; import org.apache.commons.lang.ArrayUtils; @@ -13,7 +11,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_tempban extends TFM_Command { private static final SimpleDateFormat date_format = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_terminal.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_terminal.java index a1f2689a..080aedb4 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_terminal.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_terminal.java @@ -1,13 +1,11 @@ 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_RunSystemCommand; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_terminal extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfbanlist.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfbanlist.java index d2694f0f..fdffd4ca 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfbanlist.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfbanlist.java @@ -1,7 +1,5 @@ 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_ServerInterface; import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList; @@ -12,7 +10,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH, ignore_permissions = false) public class Command_tfbanlist extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfipbanlist.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfipbanlist.java index 2573bb8e..5241ff7a 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfipbanlist.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfipbanlist.java @@ -3,8 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.util.Arrays; import java.util.Collections; import java.util.List; -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_ServerInterface; import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList; @@ -13,7 +11,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH, ignore_permissions = false) public class Command_tfipbanlist extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfupdate.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfupdate.java index 2829a9a4..bd353dc0 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfupdate.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfupdate.java @@ -1,8 +1,6 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.io.File; -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_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; @@ -10,7 +8,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_tfupdate extends TFM_Command { public static final String[] FILES = diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tossmob.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tossmob.java index be96c5d4..6da8ddce 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tossmob.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tossmob.java @@ -1,7 +1,5 @@ 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 me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; @@ -14,7 +12,7 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.ONLY_IN_GAME, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) public class Command_tossmob extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_twitter.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_twitter.java new file mode 100644 index 00000000..8c1e0875 --- /dev/null +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_twitter.java @@ -0,0 +1,128 @@ +package me.StevenLawson.TotalFreedomMod.Commands; + +import me.StevenLawson.TotalFreedomMod.TFM_TwitterHandler; +import me.StevenLawson.TotalFreedomMod.TFM_Util; +import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; +import org.bukkit.ChatColor; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + + +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.ONLY_IN_GAME, ignore_permissions = false) +public class Command_twitter extends TFM_Command +{ + @Override + public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) + { + if (!TotalFreedomMod.twitterbotEnabled) + { + TFM_Util.playerMsg(sender, "TwitterBot has been disabled in config.", ChatColor.RED); + return true; + } + + if (args.length < 1) + { + return false; + } + + TFM_TwitterHandler twitterbot = TFM_TwitterHandler.getInstance(plugin); + + if ("set".equals(args[0])) + { + if (args.length != 2) { + return false; + } + + if(args[1].startsWith("@")) + { + TFM_Util.playerMsg(sender, "Please do not prefix your twitter username with '@'"); + return true; + } + + String reply = twitterbot.setTwitter(sender.getName(), args[1]); + + if ("ok".equals(reply)) + { + TFM_Util.playerMsg(sender, "Your twitter handle has been set to: " + ChatColor.AQUA + "@" + args[1] + ChatColor.GRAY + "."); + } + else if ("disabled".equals(reply)) + { + TFM_Util.playerMsg(sender, "TwitterBot has been temporarily disabled,, please wait until it get re-enabled", ChatColor.RED); + } + else if ("failed".equals(reply)) + { + TFM_Util.playerMsg(sender, "There was a problem querying the database, please let a developer know.", ChatColor.RED); + } + else if ("false".equals(reply)) + { + TFM_Util.playerMsg(sender, "There was a problem with the database, please let a developer know.", ChatColor.RED); + } + else if ("cannotauth".equals(reply)) + { + TFM_Util.playerMsg(sender, "The database password is incorrect, please let a developer know.", ChatColor.RED); + } + else + { + TFM_Util.playerMsg(sender, "An unknown error occurred, please contact a developer", ChatColor.RED); + TFM_Util.playerMsg(sender, "Response code: " + reply); + } + return true; + } + + if (args.length != 1) + { + return false; + } + + if ("info".equals(args[0])) + { + String reply = twitterbot.getTwitter(sender.getName()); + TFM_Util.playerMsg(sender, "-- Twitter Information --", ChatColor.BLUE); + TFM_Util.playerMsg(sender, "Using this feature, you can re-super yourself using twitter."); + TFM_Util.playerMsg(sender, "You can set your twitter handle using " + ChatColor.AQUA + "/twitter set [twittername]"); + TFM_Util.playerMsg (sender, "Then, you can verify yourself by tweeting " + ChatColor.AQUA + "@TFUpdates #superme"); + if ("notfound".equals(reply)) { + TFM_Util.playerMsg(sender, "You currently have " + ChatColor.RED + "no" + ChatColor.BLUE + " Twitter handle set.", ChatColor.BLUE); + } + else if ("disabled".equals(reply)) + { + TFM_Util.playerMsg(sender, "TwitterBot has been temporarily disabled, please wait until re-enabled", ChatColor.RED); + } + else if ("failed".equals(reply)) + { + TFM_Util.playerMsg(sender, "There was a problem querying the database, please let a developer know.", ChatColor.RED); + } + else if ("false".equals(reply)) + { + TFM_Util.playerMsg(sender, "There was a problem with the database, please let a developer know.", ChatColor.RED); + } + else if ("cannotauth".equals(reply)) + { + TFM_Util.playerMsg(sender, "The database password is incorrect, please let a developer know.", ChatColor.RED); + } + else + { + TFM_Util.playerMsg(sender, "Your current twitter handle: " + ChatColor.AQUA + "@" + reply + ChatColor.BLUE + ".", ChatColor.BLUE); + } + return true; + } + + if ("enable".equals(args[0]) || "disable".equals(args[0])) + { + if (!sender.getName().equalsIgnoreCase("DarthSalamon")) + { + sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); + return true; + } + + TFM_Util.adminAction(sender.getName(), ("enable".equals(args[0]) ? "Ena" : "Disa") + "bling Twitterbot", true); + String reply = twitterbot.setEnabled(args[0] + "d"); + TFM_Util.playerMsg(sender, "Reply: " + reply); + return true; + } + + // Command not recognised + return false; + } +} diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_uall.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_uall.java index 7fed807f..e1d43239 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_uall.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_uall.java @@ -1,14 +1,12 @@ 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_Util; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_uall extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_waterplace.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_waterplace.java index 129f8ad1..2cb40369 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_waterplace.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_waterplace.java @@ -1,13 +1,11 @@ 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.TotalFreedomMod; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_waterplace extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_whitelist.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_whitelist.java index 5a44ca65..ac39fd20 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_whitelist.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_whitelist.java @@ -1,7 +1,5 @@ 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_SuperadminList; import me.StevenLawson.TotalFreedomMod.TFM_Util; @@ -11,7 +9,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.OP, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH, ignore_permissions = false) public class Command_whitelist extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wildcard.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wildcard.java index 1a41ac50..69c220ae 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wildcard.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wildcard.java @@ -1,14 +1,12 @@ package me.StevenLawson.TotalFreedomMod.Commands; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.ADMIN_LEVEL; -import me.StevenLawson.TotalFreedomMod.Commands.CommandPermissions.SOURCE_TYPE_ALLOWED; import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SUPER, source = SOURCE_TYPE_ALLOWED.BOTH, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, ignore_permissions = false) public class Command_wildcard extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wipeflatlands.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wipeflatlands.java index 961bf453..9202949b 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wipeflatlands.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wipeflatlands.java @@ -1,14 +1,12 @@ 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_Util; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_wipeflatlands extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ziptool.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ziptool.java index 551e5855..6904b5bd 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ziptool.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ziptool.java @@ -2,15 +2,13 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.io.File; import java.io.IOException; -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_Util; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) +@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true, ignore_permissions = false) public class Command_ziptool extends TFM_Command { @Override diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/SourceType.java b/src/me/StevenLawson/TotalFreedomMod/Commands/SourceType.java new file mode 100644 index 00000000..63096dd9 --- /dev/null +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/SourceType.java @@ -0,0 +1,6 @@ +package me.StevenLawson.TotalFreedomMod.Commands; + +public enum SourceType +{ + ONLY_IN_GAME, ONLY_CONSOLE, BOTH; +} diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/TFM_Command.java b/src/me/StevenLawson/TotalFreedomMod/Commands/TFM_Command.java index bc189933..1cb6283a 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/TFM_Command.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/TFM_Command.java @@ -1,11 +1,9 @@ package me.StevenLawson.TotalFreedomMod.Commands; import java.util.List; -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_PlayerData; +import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList; import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.ChatColor; @@ -80,8 +78,8 @@ public class TFM_Command is_senior = TFM_SuperadminList.isSeniorAdmin(sender); } - ADMIN_LEVEL level = permissions.level(); - SOURCE_TYPE_ALLOWED source = permissions.source(); + AdminLevel level = permissions.level(); + SourceType source = permissions.source(); boolean block_host_console = permissions.block_host_console(); Player sender_p = null; @@ -92,11 +90,11 @@ public class TFM_Command if (sender_p == null) { - if (source == SOURCE_TYPE_ALLOWED.ONLY_IN_GAME) + if (source == SourceType.ONLY_IN_GAME) { return false; } - else if (level == ADMIN_LEVEL.SENIOR && !is_senior) + else if (level == AdminLevel.SENIOR && !is_senior) { return false; } @@ -107,11 +105,11 @@ public class TFM_Command } else { - if (source == SOURCE_TYPE_ALLOWED.ONLY_CONSOLE) + if (source == SourceType.ONLY_CONSOLE) { return false; } - else if (level == ADMIN_LEVEL.SENIOR) + else if (level == AdminLevel.SENIOR) { if (is_senior) { @@ -131,11 +129,11 @@ public class TFM_Command return false; } } - else if (level == ADMIN_LEVEL.SUPER && !is_super) + else if (level == AdminLevel.SUPER && !is_super) { return false; } - else if (level == ADMIN_LEVEL.OP && !sender_p.isOp()) + else if (level == AdminLevel.OP && !sender_p.isOp()) { return false; } diff --git a/src/me/StevenLawson/TotalFreedomMod/TFM_TwitterHandler.java b/src/me/StevenLawson/TotalFreedomMod/TFM_TwitterHandler.java new file mode 100644 index 00000000..b5f5f26f --- /dev/null +++ b/src/me/StevenLawson/TotalFreedomMod/TFM_TwitterHandler.java @@ -0,0 +1,67 @@ +package me.StevenLawson.TotalFreedomMod; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import org.apache.commons.lang.exception.ExceptionUtils; + + +public class TFM_TwitterHandler { + + private TotalFreedomMod plugin; + + private TFM_TwitterHandler(TotalFreedomMod plugin) + { + this.plugin = plugin; + } + + public String getTwitter(String player) + { + return request("action=gettwitter&player=" + player); + } + + public String setTwitter(String player, String twitter) + { + if (twitter.startsWith("@")) + { + twitter = twitter.replaceAll("@", ""); + } + return request("action=settwitter&player=" + player + "&twitter=" + twitter); + } + + public String delTwitter(String player) { + return request("action=deltwitter&player=" + player); + } + + public String isEnabled() { + return request("action=getstatus"); + } + + public String setEnabled(String status) { + return request("action=setstatus&status=" + status); + } + + private String request(String queryString) { + String line = "failed"; + try + { + URL getUrl = new URL(TotalFreedomMod.twitterbotUrl + "?auth=" + TotalFreedomMod.twitterbotSecret + "&" + queryString); + URLConnection urlConnection = getUrl.openConnection(); + // Read the response + BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); + line = in.readLine(); + in.close(); + } + catch (Exception ex) + { + TFM_Log.severe(ExceptionUtils.getFullStackTrace(ex)); + } + return line; + } + + public static TFM_TwitterHandler getInstance(TotalFreedomMod plugin) { + return new TFM_TwitterHandler(plugin); + } + +} diff --git a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java index 8736d771..50946725 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java +++ b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java @@ -224,6 +224,9 @@ public class TotalFreedomMod extends JavaPlugin public static boolean autoProtectSpawnpoints = true; public static double autoProtectRadius = 25.0D; public static List host_sender_names = Arrays.asList("rcon", "remotebukkit"); + public static boolean twitterbotEnabled = false; + public static String twitterbotUrl = "http://tftwitter.darthcraft.net/"; + public static String twitterbotSecret = ""; public static void loadMainConfig() { @@ -265,6 +268,9 @@ public class TotalFreedomMod extends JavaPlugin autoProtectSpawnpoints = config.getBoolean("auto_protect_spawnpoints", autoProtectSpawnpoints); autoProtectRadius = config.getDouble("auto_protect_radius", autoProtectRadius); host_sender_names = config.getStringList("host_sender_names"); + twitterbotEnabled = config.getBoolean("twitterbot_enabled"); + twitterbotUrl = config.getString("twitterbot_url"); + twitterbotSecret = config.getString("twitterbot_secret"); } catch (Exception ex) { diff --git a/src/plugin.yml b/src/plugin.yml index e0c34415..a0d87fdb 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -238,10 +238,13 @@ commands: usage: / [purge] tfupdate: description: Madgeek command - Update server files. - usave: / + usage: / tossmob: - description: Throw a mob in the direction you are facing when you left click with a stick. + description: SuperAdmin command - Throw a mob in the direction you are facing when you left click with a stick. usage: / + twitter: + description: Manage your twitter + usage: / uall: description: Superadmin command - Undisguises all players usage: /