mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-11 21:43:54 +00:00
sIgNifICanT buG FixEs (#105)
- Ignore totalfreedom.iml (people who clone from Git get this instead of TotalFreedomMod) - Essentials check before running /denick - Revise grammar in /invis - WorldEdit check for /setl (since W/E is no longer a required dependency) - WorldEdit check for /gtfo - WorldEdit check for /unban - Refactor -> LibsDisguiseBridge: isPluginEnabled -> isEnabled - Remove unneccesary ChatColor in /wiperegions - Use BlockData in Trailer - Revise /wiewarps grammar
This commit is contained in:
@ -14,6 +14,12 @@ public class Command_denick extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (!plugin.esb.isEssentialsEnabled())
|
||||
{
|
||||
msg("Essentials is not enabled on this server.");
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Removing all nicknames", false);
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
|
@ -16,7 +16,7 @@ public class Command_disguisetoggle extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (!plugin.ldb.isPluginEnabled())
|
||||
if (!plugin.ldb.isEnabled())
|
||||
{
|
||||
msg(ChatColor.RED + "LibsDisguises is not enabled.");
|
||||
return true;
|
||||
|
@ -2,12 +2,11 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.banning.Ban;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -17,6 +16,9 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||
@CommandParameters(description = "Bans a player", usage = "/<command> <username> [reason] [-nrb]", aliases = "ban")
|
||||
public class Command_gtfo extends FreedomCommand
|
||||
@ -103,7 +105,10 @@ public class Command_gtfo extends FreedomCommand
|
||||
// Undo WorldEdits
|
||||
try
|
||||
{
|
||||
plugin.web.undo(player, 15);
|
||||
if (plugin.web.isWorldEditEnabled())
|
||||
{
|
||||
plugin.web.undo(player, 15);
|
||||
}
|
||||
}
|
||||
catch (NoClassDefFoundError | NullPointerException ex)
|
||||
{
|
||||
|
@ -1,7 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -10,11 +8,13 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Shows (optionally clears) invisisible players", usage = "/<command> (clear)")
|
||||
@CommandParameters(description = "Shows (optionally clears) invisible players", usage = "/<command> (clear)")
|
||||
public class Command_invis extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
@ -24,7 +24,7 @@ public class Command_invis extends FreedomCommand
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("clear"))
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Clearing all invis potion effect from all players", true);
|
||||
FUtil.adminAction(sender.getName(), "Clearing all invisibility potion effects from all players", true);
|
||||
clear = true;
|
||||
}
|
||||
else
|
||||
@ -51,18 +51,17 @@ public class Command_invis extends FreedomCommand
|
||||
|
||||
if (players.isEmpty())
|
||||
{
|
||||
sender.sendMessage("There are no invisible players");
|
||||
msg("There are no invisible players");
|
||||
return true;
|
||||
}
|
||||
if (clear)
|
||||
{
|
||||
sender.sendMessage("Cleared " + clears + " players");
|
||||
msg("Cleared " + clears + " players");
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage("Invisible players (" + players.size() + "): " + StringUtils.join(players, ", "));
|
||||
msg("Invisible players (" + players.size() + "): " + StringUtils.join(players, ", "));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -41,7 +41,6 @@ public class Command_nickclean extends FreedomCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +146,6 @@ public class Command_plugincontrol extends FreedomCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -8,13 +8,17 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Sets everyone's Worldedit block modification limit to the default limit or to a custom limit.", usage = "/<command> [limit]", aliases = "setl,swl")
|
||||
@CommandParameters(description = "Sets everyone's WorldEdit block modification limit to the default limit or to a custom limit.", usage = "/<command> [limit]", aliases = "setl,swl")
|
||||
public class Command_setlimit extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (!plugin.web.isWorldEditEnabled())
|
||||
{
|
||||
msg("WorldEdit is not enabled on this server.");
|
||||
return true;
|
||||
}
|
||||
int amount = 100000;
|
||||
if (args.length > 0)
|
||||
{
|
||||
@ -28,7 +32,7 @@ public class Command_setlimit extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
}
|
||||
FUtil.adminAction(sender.getName(), "Setting everyone's Worldedit block modification limit to " + amount + ".", true);
|
||||
FUtil.adminAction(sender.getName(), "Setting everyone's WorldEdit block modification limit to " + amount + ".", true);
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
{
|
||||
plugin.web.setLimit(player, amount);
|
||||
|
@ -48,7 +48,10 @@ public class Command_unban extends FreedomCommand
|
||||
// Redo WorldEdits
|
||||
try
|
||||
{
|
||||
plugin.web.redo(player, 15);
|
||||
if (plugin.web.isWorldEditEnabled())
|
||||
{
|
||||
plugin.web.redo(player, 15);
|
||||
}
|
||||
}
|
||||
catch (NoClassDefFoundError | NullPointerException ex)
|
||||
{
|
||||
|
@ -15,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())
|
||||
if (!plugin.ldb.isEnabled())
|
||||
{
|
||||
msg("LibsDisguises is not enabled.");
|
||||
return true;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -10,23 +9,27 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@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 {
|
||||
|
||||
@CommandParameters(description = "Wipe all WorldGuard regions for a specified world.", usage = "/<command> <world>")
|
||||
public class Command_wiperegions extends FreedomCommand
|
||||
{
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) {
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (!plugin.wgb.isPluginEnabled())
|
||||
{
|
||||
msg("WorldGuard is not enabled.", ChatColor.GRAY);
|
||||
msg("WorldGuard is not enabled.");
|
||||
return true;
|
||||
}
|
||||
if (args.length != 1) {
|
||||
|
||||
if (args.length != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
World world = server.getWorld(args[0]);
|
||||
if (world == null)
|
||||
{
|
||||
msg("World : \"" + args[0] + "\" not found.", ChatColor.GRAY);
|
||||
msg("World : \"" + args[0] + "\" not found.");
|
||||
return true;
|
||||
}
|
||||
if (world.equals(plugin.wm.adminworld.getWorld()))
|
||||
@ -40,7 +43,7 @@ public class Command_wiperegions extends FreedomCommand {
|
||||
}
|
||||
else
|
||||
{
|
||||
msg(ChatColor.RED + "No regions have been found for world: \"" + world.getName() + "\".");
|
||||
msg(ChatColor.RED + "No regions were found in: \"" + world.getName() + "\".");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,24 +1,25 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.io.File;
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import com.earth2me.essentials.Essentials;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
||||
@CommandParameters(description = "Removes essentials warps", usage = "/<command>")
|
||||
@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 (!plugin.esb.isEssentialsEnabled())
|
||||
{
|
||||
msg("Essentials is not enabled on this server");
|
||||
msg("Essentials is not enabled on this server.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user