mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
SuperAwesomeAdmins. Because who are we kidding anyway.
This commit is contained in:
parent
e7f2ad893c
commit
2a396ca904
@ -54,8 +54,8 @@ flatlands_generation_params: 16,stone,32,dirt,1,grass
|
|||||||
# Admin-Only Mode
|
# Admin-Only Mode
|
||||||
admin_only_mode: false
|
admin_only_mode: false
|
||||||
|
|
||||||
# SuperUsers; telnet users who have the permissions for certain high-profile commands (/doom, /lockup, ect)
|
# SuperAwesomeAdmins - Because normal superadmin just isn't awesome enough. These users can do even more awesomey admin shit.
|
||||||
superuser_names:
|
super_awesome_admins:
|
||||||
- markbyron
|
- markbyron
|
||||||
- mark
|
- mark
|
||||||
- madgeek1450
|
- madgeek1450
|
||||||
|
@ -13,7 +13,7 @@ public class Command_doom extends TFM_Command
|
|||||||
@Override
|
@Override
|
||||||
public boolean run(final CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
public boolean run(final CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
{
|
{
|
||||||
if (!(senderIsConsole && TotalFreedomMod.superUsers.contains(sender.getName().toLowerCase())))
|
if (!(senderIsConsole && TotalFreedomMod.superAwesomeAdmins.contains(sender.getName().toLowerCase())))
|
||||||
{
|
{
|
||||||
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
|
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@ -24,7 +23,7 @@ public class Command_fuckoff extends TFM_Command
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Arrays.asList("madgeek1450", "markbyron", "darthsalamon").contains(sender.getName().toLowerCase()))
|
if (!TotalFreedomMod.superAwesomeAdmins.contains(sender.getName().toLowerCase()))
|
||||||
{
|
{
|
||||||
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
|
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
|
||||||
return true;
|
return true;
|
||||||
|
@ -4,7 +4,6 @@ import java.util.Random;
|
|||||||
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
|
||||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -16,7 +15,7 @@ public class Command_lockup extends TFM_Command
|
|||||||
@Override
|
@Override
|
||||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
{
|
{
|
||||||
if (!(senderIsConsole && TotalFreedomMod.superUsers.contains(sender.getName().toLowerCase())))
|
if (!(senderIsConsole && TotalFreedomMod.superAwesomeAdmins.contains(sender.getName().toLowerCase())))
|
||||||
{
|
{
|
||||||
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
|
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
|
||||||
return true;
|
return true;
|
||||||
@ -26,7 +25,7 @@ public class Command_lockup extends TFM_Command
|
|||||||
{
|
{
|
||||||
if (args[0].equalsIgnoreCase("all"))
|
if (args[0].equalsIgnoreCase("all"))
|
||||||
{
|
{
|
||||||
TFM_Util.adminAction(sender.getName(), "Locking up all players", true);
|
TFM_Util.adminAction(sender.getName(), "Locking up all players", true);
|
||||||
|
|
||||||
for (Player p : server.getOnlinePlayers())
|
for (Player p : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
@ -36,7 +35,7 @@ public class Command_lockup extends TFM_Command
|
|||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("purge"))
|
else if (args[0].equalsIgnoreCase("purge"))
|
||||||
{
|
{
|
||||||
TFM_Util.adminAction(sender.getName(), "Unlocking all players", true);
|
TFM_Util.adminAction(sender.getName(), "Unlocking all players", true);
|
||||||
for (Player p : server.getOnlinePlayers())
|
for (Player p : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
cancelLockup(p);
|
cancelLockup(p);
|
||||||
|
@ -3,15 +3,12 @@ package me.StevenLawson.TotalFreedomMod;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import me.StevenLawson.TotalFreedomMod.Commands.TFM_Command;
|
import me.StevenLawson.TotalFreedomMod.Commands.TFM_Command;
|
||||||
import me.StevenLawson.TotalFreedomMod.Listener.TFM_BlockListener;
|
import me.StevenLawson.TotalFreedomMod.Listener.TFM_BlockListener;
|
||||||
import me.StevenLawson.TotalFreedomMod.Listener.TFM_EntityListener;
|
import me.StevenLawson.TotalFreedomMod.Listener.TFM_EntityListener;
|
||||||
import me.StevenLawson.TotalFreedomMod.Listener.TFM_PlayerListener;
|
import me.StevenLawson.TotalFreedomMod.Listener.TFM_PlayerListener;
|
||||||
import me.StevenLawson.TotalFreedomMod.Listener.TFM_WeatherListener;
|
import me.StevenLawson.TotalFreedomMod.Listener.TFM_WeatherListener;
|
||||||
|
|
||||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
@ -188,24 +185,12 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
public static String flatlandsGenerationParams = "16,stone,32,dirt,1,grass";
|
public static String flatlandsGenerationParams = "16,stone,32,dirt,1,grass";
|
||||||
public static boolean allowFliudSpread = false;
|
public static boolean allowFliudSpread = false;
|
||||||
public static boolean adminOnlyMode = false;
|
public static boolean adminOnlyMode = false;
|
||||||
public static String[] tempArray =
|
public static List<String> superAwesomeAdmins = Arrays.asList("markbyron", "mark", "madgeek1450", "madgeek", "darthsalamon", "darth");
|
||||||
{
|
|
||||||
"markbyron",
|
|
||||||
"mark",
|
|
||||||
"madgeek1450",
|
|
||||||
"madgeek",
|
|
||||||
"darthsalamon",
|
|
||||||
"darth"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static List<String> superUsers = Arrays.asList(tempArray);
|
|
||||||
|
|
||||||
public void loadMainConfig()
|
public void loadMainConfig()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
tempArray = null;
|
|
||||||
|
|
||||||
TFM_Util.createDefaultConfiguration(CONFIG_FILE, getFile());
|
TFM_Util.createDefaultConfiguration(CONFIG_FILE, getFile());
|
||||||
FileConfiguration config = YamlConfiguration.loadConfiguration(new File(getDataFolder(), CONFIG_FILE));
|
FileConfiguration config = YamlConfiguration.loadConfiguration(new File(getDataFolder(), CONFIG_FILE));
|
||||||
|
|
||||||
@ -238,7 +223,7 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
flatlandsGenerationParams = config.getString("flatlands_generation_params", flatlandsGenerationParams);
|
flatlandsGenerationParams = config.getString("flatlands_generation_params", flatlandsGenerationParams);
|
||||||
allowFliudSpread = config.getBoolean("allow_fluid_spread", allowFliudSpread);
|
allowFliudSpread = config.getBoolean("allow_fluid_spread", allowFliudSpread);
|
||||||
adminOnlyMode = config.getBoolean("admin_only_mode", adminOnlyMode);
|
adminOnlyMode = config.getBoolean("admin_only_mode", adminOnlyMode);
|
||||||
superUsers = config.getStringList("superuser_names");
|
superAwesomeAdmins = config.getStringList("super_awesome_admins");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user