mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 02:05:41 +00:00
Merge pull request #6 from marcocorriero/TFM1.12-Alpha
Adds Something that is missing
This commit is contained in:
commit
a67fe49c98
@ -110,4 +110,4 @@ public class Command_gtfo extends FreedomCommand
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,4 +57,4 @@ public class Command_rainbownick extends FreedomCommand
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -45,4 +45,4 @@ public class Command_rainbowtag extends FreedomCommand
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
|
||||
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Quickly change your own gamemode to spectator.", usage = "/<command>", aliases = "gmsp")
|
||||
public class Command_spectator extends FreedomCommand
|
||||
{
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole) {
|
||||
if (args.length == 0) {
|
||||
if (this.isConsole()) {
|
||||
sender.sendMessage("When used from the console, you must define a target player.");
|
||||
return true;
|
||||
}
|
||||
playerSender.setGameMode(GameMode.SPECTATOR);
|
||||
this.msg("Gamemode set to spectator.");
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
this.checkRank(Rank.SUPER_ADMIN);
|
||||
final Player player = this.getPlayer(args[0]);
|
||||
if (player == null) {
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
this.msg("Setting " + player.getName() + " to game mode spectator");
|
||||
this.msg((CommandSender)player, sender.getName() + " set your game mode to spectator");
|
||||
player.setGameMode(GameMode.SPECTATOR);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -18,7 +18,7 @@ public class Command_tag extends FreedomCommand
|
||||
|
||||
public static final List<String> FORBIDDEN_WORDS = Arrays.asList(new String[]
|
||||
{
|
||||
"admin", "owner", "moderator", "developer", "console"
|
||||
"admin", "owner", "moderator", "developer", "console", "SRA", "TCA", "SA"
|
||||
});
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
@ -13,6 +15,11 @@ import org.bukkit.entity.Player;
|
||||
@CommandParameters(description = "Gives you a tag with random colors", usage = "/<command> <tag>", aliases = "tn")
|
||||
public class Command_tagnyan extends FreedomCommand
|
||||
{
|
||||
|
||||
public static final List<String> FORBIDDEN_WORDS = Arrays.asList(new String[]
|
||||
{
|
||||
"admin", "owner", "moderator", "developer", "console", "SRA", "TCA", "SA"
|
||||
});
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
|
@ -48,7 +48,7 @@ public class Command_tban extends FreedomCommand
|
||||
for (int z = -1; z <= 1; z++)
|
||||
{
|
||||
final Location strike_pos = new Location(targetPos.getWorld(), targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z);
|
||||
targetPos.getWorld().strikeLightning(strike_pos);
|
||||
targetPos.getWorld().strikeLightningEffect(strike_pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class Command_tempban extends FreedomCommand
|
||||
for (int z = -1; z <= 1; z++)
|
||||
{
|
||||
final Location strike_pos = new Location(targetPos.getWorld(), targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z);
|
||||
targetPos.getWorld().strikeLightning(strike_pos);
|
||||
targetPos.getWorld().strikeLightningEffect(strike_pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.GameRuleHandler;
|
||||
import me.totalfreedom.totalfreedommod.GameRuleHandler.GameRule;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
@ -25,6 +27,8 @@ public class Command_toggle extends FreedomCommand
|
||||
msg("- fluidspread");
|
||||
msg("- lavadmg");
|
||||
msg("- firespread");
|
||||
msg("- frostwalk");
|
||||
msg("- firework");
|
||||
msg("- prelog");
|
||||
msg("- lockdown");
|
||||
msg("- petprotect");
|
||||
@ -34,133 +38,103 @@ public class Command_toggle extends FreedomCommand
|
||||
return false;
|
||||
}
|
||||
|
||||
if (args[0].equals("waterplace"))
|
||||
{
|
||||
toggle("Water placement is", ConfigEntry.ALLOW_WATER_PLACE);
|
||||
if (args[0].equals("waterplace")) {
|
||||
this.toggle("Water placement is", ConfigEntry.ALLOW_WATER_PLACE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equals("fireplace"))
|
||||
{
|
||||
toggle("Fire placement is", ConfigEntry.ALLOW_FIRE_PLACE);
|
||||
if (args[0].equals("frostwalk")) {
|
||||
this.toggle("Frost walker enchantment is ", ConfigEntry.ALLOW_FROSTWALKER);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equals("lavaplace"))
|
||||
{
|
||||
toggle("Lava placement is", ConfigEntry.ALLOW_LAVA_PLACE);
|
||||
if (args[0].equals("fireplace")) {
|
||||
this.toggle("Fire placement is", ConfigEntry.ALLOW_FIRE_PLACE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equals("fluidspread"))
|
||||
if (args[0].equals("lavaplace")) {
|
||||
this.toggle("Lava placement is", ConfigEntry.ALLOW_LAVA_PLACE);
|
||||
return true;
|
||||
}
|
||||
/*if (args[0].equals("explosivearrows"))
|
||||
{
|
||||
toggle("Fluid spread is", ConfigEntry.ALLOW_FLUID_SPREAD);
|
||||
toggle("Explosive arrows are now", ConfigEntry.MAKE_ARROW_EXPLOSIVE);
|
||||
return true;
|
||||
}*/
|
||||
if (args[0].equals("fluidspread")) {
|
||||
this.toggle("Fluid spread is", ConfigEntry.ALLOW_FLUID_SPREAD);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equals("lavadmg"))
|
||||
{
|
||||
toggle("Lava damage is", ConfigEntry.ALLOW_LAVA_DAMAGE);
|
||||
if (args[0].equals("lavadmg")) {
|
||||
this.toggle("Lava damage is", ConfigEntry.ALLOW_LAVA_DAMAGE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equals("firespread"))
|
||||
{
|
||||
toggle("Fire spread is", ConfigEntry.ALLOW_FIRE_SPREAD);
|
||||
plugin.gr.setGameRule(GameRule.DO_FIRE_TICK, ConfigEntry.ALLOW_FIRE_SPREAD.getBoolean());
|
||||
if (args[0].equals("firespread")) {
|
||||
this.toggle("Fire spread is", ConfigEntry.ALLOW_FIRE_SPREAD);
|
||||
((TotalFreedomMod)this.plugin).gr.setGameRule(GameRuleHandler.GameRule.DO_FIRE_TICK, ConfigEntry.ALLOW_FIRE_SPREAD.getBoolean());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equals("prelog"))
|
||||
{
|
||||
toggle("Command prelogging is", ConfigEntry.ENABLE_PREPROCESS_LOG);
|
||||
if (args[0].equals("prelog")) {
|
||||
this.toggle("Command prelogging is", ConfigEntry.ENABLE_PREPROCESS_LOG);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equals("lockdown"))
|
||||
{
|
||||
boolean active = !plugin.lp.isLockdownEnabled();
|
||||
plugin.lp.setLockdownEnabled(active);
|
||||
|
||||
if (args[0].equals("lockdown")) {
|
||||
final boolean active = !((TotalFreedomMod)this.plugin).lp.isLockdownEnabled();
|
||||
((TotalFreedomMod)this.plugin).lp.setLockdownEnabled(active);
|
||||
FUtil.adminAction(sender.getName(), (active ? "A" : "De-a") + "ctivating server lockdown", true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equals("petprotect"))
|
||||
{
|
||||
toggle("Tamed pet protection is", ConfigEntry.ENABLE_PET_PROTECT);
|
||||
if (args[0].equals("petprotect")) {
|
||||
this.toggle("Tamed pet protection is", ConfigEntry.ENABLE_PET_PROTECT);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equals("entitywipe"))
|
||||
{
|
||||
toggle("Automatic entity wiping is", ConfigEntry.AUTO_ENTITY_WIPE);
|
||||
if (args[0].equals("entitywipe")) {
|
||||
this.toggle("Automatic entity wiping is", ConfigEntry.AUTO_ENTITY_WIPE);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equals("nonuke"))
|
||||
{
|
||||
if (args.length >= 2)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (args[0].equals("firework")) {
|
||||
this.toggle("Firework explosion is", ConfigEntry.ALLOW_FIREWORK_EXPLOSION);
|
||||
return true;
|
||||
}
|
||||
if (args[0].equals("nonuke")) {
|
||||
if (args.length >= 2) {
|
||||
try {
|
||||
ConfigEntry.NUKE_MONITOR_RANGE.setDouble(Math.max(1.0, Math.min(500.0, Double.parseDouble(args[1]))));
|
||||
}
|
||||
catch (NumberFormatException nfex)
|
||||
{
|
||||
}
|
||||
catch (NumberFormatException ex2) {}
|
||||
}
|
||||
|
||||
if (args.length >= 3)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (args.length >= 3) {
|
||||
try {
|
||||
ConfigEntry.NUKE_MONITOR_COUNT_BREAK.setInteger(Math.max(1, Math.min(500, Integer.parseInt(args[2]))));
|
||||
}
|
||||
catch (NumberFormatException nfex)
|
||||
{
|
||||
}
|
||||
catch (NumberFormatException ex3) {}
|
||||
}
|
||||
|
||||
toggle("Nuke monitor is", ConfigEntry.NUKE_MONITOR_ENABLED);
|
||||
|
||||
if (ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean())
|
||||
{
|
||||
msg("Anti-freecam range is set to " + ConfigEntry.NUKE_MONITOR_RANGE.getDouble() + " blocks.");
|
||||
msg("Block throttle rate is set to " + ConfigEntry.NUKE_MONITOR_COUNT_BREAK.getInteger() + " blocks destroyed per 5 seconds.");
|
||||
this.toggle("Nuke monitor is", ConfigEntry.NUKE_MONITOR_ENABLED);
|
||||
if (ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean()) {
|
||||
this.msg("Anti-freecam range is set to " + ConfigEntry.NUKE_MONITOR_RANGE.getDouble() + " blocks.");
|
||||
this.msg("Block throttle rate is set to " + ConfigEntry.NUKE_MONITOR_COUNT_BREAK.getInteger() + " blocks destroyed per 5 seconds.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
if (args[0].equals("explosives"))
|
||||
{
|
||||
if (args.length == 2)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (args[0].equals("explosives")) {
|
||||
if (args.length == 2) {
|
||||
try {
|
||||
ConfigEntry.EXPLOSIVE_RADIUS.setDouble(Math.max(1.0, Math.min(30.0, Double.parseDouble(args[1]))));
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
msg(ex.getMessage());
|
||||
catch (NumberFormatException ex) {
|
||||
this.msg(ex.getMessage());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
toggle("Explosions are", ConfigEntry.ALLOW_EXPLOSIONS);
|
||||
|
||||
if (ConfigEntry.ALLOW_EXPLOSIONS.getBoolean())
|
||||
{
|
||||
msg("Radius set to " + ConfigEntry.EXPLOSIVE_RADIUS.getDouble());
|
||||
this.toggle("Explosions are", ConfigEntry.ALLOW_EXPLOSIONS);
|
||||
if (ConfigEntry.ALLOW_EXPLOSIONS.getBoolean()) {
|
||||
this.msg("Radius set to " + ConfigEntry.EXPLOSIVE_RADIUS.getDouble());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void toggle(String name, ConfigEntry entry)
|
||||
{
|
||||
msg(name + " now " + (entry.setBoolean(!entry.getBoolean()) ? "enabled." : "disabled."));
|
||||
|
||||
private void toggle(final String name, final ConfigEntry entry) {
|
||||
this.msg(name + " now " + (entry.setBoolean(!entry.getBoolean()) ? "enabled." : "disabled."));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
//import me.libraryaddict.disguise.DisallowedDisguises;
|
||||
import me.libraryaddict.disguise.DisallowedDisguises;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.command.Command;
|
||||
@ -14,7 +15,7 @@ public class Command_undisguiseall extends FreedomCommand
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{ /*
|
||||
{
|
||||
if (!plugin.ldb.isPluginEnabled())
|
||||
{
|
||||
msg("LibsDisguises is not enabled.");
|
||||
@ -32,10 +33,5 @@ public class Command_undisguiseall extends FreedomCommand
|
||||
plugin.ldb.undisguiseAll(false);
|
||||
|
||||
return true;
|
||||
|
||||
*/
|
||||
|
||||
msg("This command has been disabled for technical reasons. Contact a developer for additional information.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,10 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.command.CommandParameters;
|
||||
import me.totalfreedom.totalfreedommod.command.CommandPermissions;
|
||||
import me.totalfreedom.totalfreedommod.command.FreedomCommand;
|
||||
import me.totalfreedom.totalfreedommod.command.SourceType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.DepreciationAggregator;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
@ -0,0 +1,31 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@CommandPermissions(level = Rank.TELNET_ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Wipes the CoreProtect data for the flatlands", usage = "/<command>")
|
||||
public class Command_wipecoreprotectdata extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(final CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Wiping CoreProtect data for the flatlands", true);
|
||||
|
||||
new BukkitRunnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
plugin.cpb.clearDatabase(plugin.wm.flatlands.getWorld());
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
||||
@CommandParameters(description = "Wipe the flatlands map. Requires manual restart after command is used.", usage = "/<command>")
|
||||
@ -24,8 +25,22 @@ public class Command_wipeflatlands extends FreedomCommand
|
||||
player.kickPlayer("Server is going offline for flatlands wipe, come back in a few minutes.");
|
||||
}
|
||||
|
||||
server.shutdown();
|
||||
if (!plugin.cpb.isEnabled())
|
||||
{
|
||||
server.shutdown();
|
||||
}
|
||||
else
|
||||
{
|
||||
new BukkitRunnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
plugin.cpb.clearDatabase(plugin.wm.flatlands.getWorld(), true);
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import com.sk89q.worldguard.bukkit.RegionContainer;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import java.util.Map;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@CommandPermissions(level = Rank.TELNET_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Wipe all WorldGuard regions for a specified world.", usage = "/<command> <world>", aliases = "wiperegions")
|
||||
public class Command_wiperegions extends FreedomCommand
|
||||
{
|
||||
|
||||
public WorldGuardPlugin getWorldGuard()
|
||||
{
|
||||
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard");
|
||||
|
||||
if (plugin == null || !(plugin instanceof WorldGuardPlugin))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return (WorldGuardPlugin) plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (getWorldGuard() == null)
|
||||
{
|
||||
msg("WorldGuard is not installed.", ChatColor.GRAY);
|
||||
return true;
|
||||
}
|
||||
if (args.length != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
World world = server.getWorld(args[0]);
|
||||
if (world == null)
|
||||
{
|
||||
msg("World : \"" + args[0] + "\" not found.", ChatColor.GRAY);
|
||||
return true;
|
||||
}
|
||||
if (world.equals(plugin.wm.adminworld.getWorld()) && !plugin.rm.getRank(sender).isAtLeast(Rank.SENIOR_ADMIN))
|
||||
{
|
||||
msg("You do not have permission to wipe adminworld.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
RegionContainer container = getWorldGuard().getRegionContainer();
|
||||
RegionManager rm = container.get(world);
|
||||
if (rm != null)
|
||||
{
|
||||
Map<String, ProtectedRegion> regions = rm.getRegions();
|
||||
for (ProtectedRegion region : regions.values())
|
||||
{
|
||||
rm.removeRegion(region.getId());
|
||||
}
|
||||
FUtil.adminAction(sender.getName(), "Wiping regions for world: " + world.getName(), true);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
msg(ChatColor.RED + "No regions have been found for world: \"" + world.getName() + "\".");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,8 +1,12 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -21,11 +25,24 @@ public class Command_wipeuserdata extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Wiping Essentials playerdata", true);
|
||||
FUtil.adminAction(sender.getName(), "Wiping Essentials and Worlds playerdata", true);
|
||||
|
||||
FUtil.deleteFolder(new File(server.getPluginManager().getPlugin("Essentials").getDataFolder(), "userdata"));
|
||||
for (World w : Bukkit.getWorlds())
|
||||
{
|
||||
if (w.getName().equals(plugin.wm.adminworld.getWorld()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
msg("All playerdata deleted.");
|
||||
return true;
|
||||
FUtil.deleteFolder(new File(server.getPluginManager().getPlugin("Essentials").getDataFolder(), "userdata"));
|
||||
FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(plugin.wm.flatlands.getName()).getWorldFolder().getName() + "playerdata"));
|
||||
FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(plugin.wm.flatlands.getName()).getWorldFolder().getName() + "stats"));
|
||||
FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(w.getName()).getWorldFolder().getName() + "stats"));
|
||||
FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(w.getName()).getWorldFolder().getName() + "playerdata"));
|
||||
|
||||
msg("All playerdata deleted.");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.io.File;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
||||
@CommandParameters(description = "Removes essentials warps", usage = "/<command>")
|
||||
public class Command_wipewarps extends FreedomCommand
|
||||
{
|
||||
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (!server.getPluginManager().isPluginEnabled("Essentials"))
|
||||
{
|
||||
msg("Essentials is not enabled on this server");
|
||||
return true;
|
||||
}
|
||||
Plugin essentials = server.getPluginManager().getPlugin("Essentials");
|
||||
FUtil.adminAction(sender.getName(), "Wiping Essentials Warps", true);
|
||||
server.getPluginManager().disablePlugin(essentials);
|
||||
FUtil.deleteFolder(new File(essentials.getDataFolder(), "warps"));
|
||||
server.getPluginManager().enablePlugin(essentials);
|
||||
msg("All warps deleted.");
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
@ -134,6 +134,11 @@ public abstract class FreedomCommand extends AbstractCommandBase<TotalFreedomMod
|
||||
msg(sender, message, ChatColor.GRAY);
|
||||
}
|
||||
|
||||
public CommandParameters getParams()
|
||||
{
|
||||
return this.params;
|
||||
}
|
||||
|
||||
protected void msg(final String message)
|
||||
{
|
||||
msg(sender, message);
|
||||
@ -159,6 +164,11 @@ public abstract class FreedomCommand extends AbstractCommandBase<TotalFreedomMod
|
||||
return plugin.pl.getData(player);
|
||||
}
|
||||
|
||||
public CommandPermissions getPerms()
|
||||
{
|
||||
return this.perms;
|
||||
}
|
||||
|
||||
public static FreedomCommand getFrom(Command command)
|
||||
{
|
||||
try
|
||||
|
@ -421,4 +421,4 @@ public class FUtil
|
||||
return packageName.substring(packageName.lastIndexOf('.') + 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user