diff --git a/.gitignore b/.gitignore index 5f81d0c3..961baaa6 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,9 @@ manifest.mf *.iws /.idea +# Ignore this file for people who clone from Git +totalfreedom.iml + # Maven excludes /target diff --git a/TotalFreedomMod.iml b/TotalFreedomMod.iml index d3eef878..e5296c17 100644 --- a/TotalFreedomMod.iml +++ b/TotalFreedomMod.iml @@ -10,7 +10,6 @@ - @@ -26,6 +25,7 @@ + diff --git a/src/main/java/me/totalfreedom/totalfreedommod/AntiSpam.java b/src/main/java/me/totalfreedom/totalfreedommod/AntiSpam.java index b82fde99..799dc314 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/AntiSpam.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/AntiSpam.java @@ -124,5 +124,4 @@ public class AntiSpam extends FreedomService event.setCancelled(true); } } - } \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/AutoKick.java b/src/main/java/me/totalfreedom/totalfreedommod/AutoKick.java index 8441de9a..63d5538c 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/AutoKick.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/AutoKick.java @@ -51,7 +51,6 @@ public class AutoKick extends FreedomService private void autoKickCheck() { - final boolean doAwayKickCheck = plugin.esb.isEssentialsEnabled() && ((server.getOnlinePlayers().size() / server.getMaxPlayers()) > autoKickThreshold); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/Monitors.java b/src/main/java/me/totalfreedom/totalfreedommod/Monitors.java index 3ea2ec66..28c2f5d3 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/Monitors.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/Monitors.java @@ -1,17 +1,18 @@ package me.totalfreedom.totalfreedommod; -import java.text.DecimalFormat; import me.totalfreedom.totalfreedommod.util.FUtil; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; -import org.bukkit.event.entity.LingeringPotionSplashEvent; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.LingeringPotionSplashEvent; import org.bukkit.event.entity.PotionSplashEvent; import org.bukkit.projectiles.ProjectileSource; +import java.text.DecimalFormat; + public class Monitors extends FreedomService { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java index 9bd1c71b..432d066e 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java @@ -14,6 +14,7 @@ import me.totalfreedom.totalfreedommod.discord.Discord; import me.totalfreedom.totalfreedommod.freeze.Freezer; import me.totalfreedom.totalfreedommod.fun.*; import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon; +import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilder; import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilderList; import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilderWorldRestrictions; import me.totalfreedom.totalfreedommod.player.PlayerList; @@ -153,6 +154,8 @@ public class TotalFreedomMod extends AeroPlugin backups.createBackups(TotalFreedomMod.CONFIG_FILENAME, true); backups.createBackups(AdminList.CONFIG_FILENAME); backups.createBackups(PermbanList.CONFIG_FILENAME); + backups.createBackups(MasterBuilder.CONFIG_FILENAME); + backups.createBackups(PunishmentList.CONFIG_FILENAME); config = new MainConfig(this); config.load(); @@ -340,5 +343,4 @@ public class TotalFreedomMod extends AeroPlugin { return new CleanroomChunkGenerator(id); } - } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java index aed63f89..34cef48d 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/bridge/CoreProtectBridge.java @@ -98,7 +98,7 @@ public class CoreProtectBridge extends FreedomService return coreProtect != null && coreProtect.isEnabled(); } - // Rollback the specifed player's edits that were in the last 24 hours. + // Rollback the specified player's edits that were in the last 24 hours. public void rollback(final String name) { final CoreProtectAPI coreProtect = getCoreProtectAPI(); @@ -118,7 +118,7 @@ public class CoreProtectBridge extends FreedomService }.runTaskAsynchronously(plugin); } - // Reverts a rollback for the specifed player's edits that were in the last 24 hours. + // Reverts a rollback for the specified player's edits that were in the last 24 hours. public void restore(final String name) { final CoreProtectAPI coreProtect = getCoreProtectAPI(); @@ -207,8 +207,8 @@ public class CoreProtectBridge extends FreedomService return; } - /* As CoreProtect doesn't have an api method for deleting all of the data for a specific world - we have to do this manually via sql */ + /* As CoreProtect doesn't have an API method for deleting all of the data for a specific world + we have to do this manually via SQL */ File databaseFile = getDatabase(); Connection connection = null; try diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java index e474afd8..9d760089 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/bridge/LibsDisguisesBridge.java @@ -7,6 +7,7 @@ import me.totalfreedom.libsdisguise.TF_DisguiseAPI; import me.totalfreedom.totalfreedommod.FreedomService; import me.totalfreedom.totalfreedommod.TotalFreedomMod; import me.totalfreedom.totalfreedommod.util.FLog; +import net.coreprotect.CoreProtect; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -124,15 +125,10 @@ public class LibsDisguisesBridge extends FreedomService return !DisallowedDisguises.disabled; } - public boolean isPluginEnabled() + public boolean isEnabled() { - Plugin ld = getLibsDisguisesPlugin(); + final LibsDisguises libsDisguises = getLibsDisguisesPlugin(); - if (ld == null) - { - return false; - } - - return ld.isEnabled(); + return libsDisguises != null && libsDisguises.isEnabled(); } } \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/WorldEditBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/WorldEditBridge.java index 2bc8bbff..8091b72c 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/WorldEditBridge.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/bridge/WorldEditBridge.java @@ -1,6 +1,7 @@ package me.totalfreedom.totalfreedommod.bridge; import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.bukkit.BukkitPlayer; import com.sk89q.worldedit.bukkit.WorldEditPlugin; import me.totalfreedom.totalfreedommod.FreedomService; @@ -14,7 +15,7 @@ public class WorldEditBridge extends FreedomService private final WorldEditListener listener; // - private WorldEditPlugin worldedit = null; + private WorldEditPlugin worldeditPlugin = null; public WorldEditBridge(TotalFreedomMod plugin) { @@ -34,6 +35,30 @@ public class WorldEditBridge extends FreedomService listener.unregister(); } + private WorldEditPlugin getWorldEditPlugin() + { + if (worldeditPlugin == null) + { + try + { + Plugin we = server.getPluginManager().getPlugin("WorldEdit"); + if (we != null) + { + if (we instanceof WorldEditPlugin) + { + worldeditPlugin = (WorldEditPlugin) we; + } + } + } + catch (Exception ex) + { + FLog.severe(ex); + } + } + + return worldeditPlugin; + } + public void undo(Player player, int count) { try @@ -80,30 +105,6 @@ public class WorldEditBridge extends FreedomService } } - private WorldEditPlugin getWorldEditPlugin() - { - if (worldedit == null) - { - try - { - Plugin we = server.getPluginManager().getPlugin("WorldEdit"); - if (we != null) - { - if (we instanceof WorldEditPlugin) - { - worldedit = (WorldEditPlugin) we; - } - } - } - catch (Exception ex) - { - FLog.severe(ex); - } - } - - return worldedit; - } - public void setLimit(Player player, int limit) { try @@ -158,4 +159,21 @@ public class WorldEditBridge extends FreedomService return null; } } + + public boolean isWorldEditEnabled() + { + try + { + WorldEditPlugin worldedit = getWorldEditPlugin(); + if (worldedit != null) + { + return worldedit.isEnabled(); + } + } + catch (Exception ex) + { + FLog.severe(ex); + } + return false; + } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/bridge/WorldGuardBridge.java b/src/main/java/me/totalfreedom/totalfreedommod/bridge/WorldGuardBridge.java index a0b8d120..6a13fbcb 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/bridge/WorldGuardBridge.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/bridge/WorldGuardBridge.java @@ -39,12 +39,9 @@ public class WorldGuardBridge extends FreedomService try { final Plugin worldGuard = server.getPluginManager().getPlugin("WorldGuard"); - if (worldGuard != null) + if (worldGuard != null && worldGuard instanceof WorldGuardPlugin) { - if (worldGuard instanceof WorldGuardPlugin) - { - worldGuardPlugin = (WorldGuardPlugin) worldGuard; - } + worldGuardPlugin = (WorldGuardPlugin) worldGuard; } } catch (Exception ex) @@ -72,9 +69,20 @@ public class WorldGuardBridge extends FreedomService return false; } - public boolean isPluginEnabled() { - Plugin wr = getWorldGuardPlugin(); - - return wr != null && wr.isEnabled(); + public boolean isPluginEnabled() + { + try + { + WorldGuardPlugin wg = getWorldGuardPlugin(); + if (wg != null) + { + return wg.isEnabled(); + } + } + catch (Exception ex) + { + FLog.severe(ex); + } + return false; } } \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_denick.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_denick.java index 697a9388..fbd191c2 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_denick.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_denick.java @@ -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()) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_disguisetoggle.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_disguisetoggle.java index 8e5821dd..ebaae700 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_disguisetoggle.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_disguisetoggle.java @@ -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; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java index be6ba5a1..839ca8e9 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java @@ -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 = "/ [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) { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java index 34e8d827..e52d3870 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java @@ -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 = "/ (clear)") +@CommandParameters(description = "Shows (optionally clears) invisible players", usage = "/ (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; } -} +} \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickclean.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickclean.java index 2cda539d..d54c86b1 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickclean.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickclean.java @@ -41,7 +41,6 @@ public class Command_nickclean extends FreedomCommand } } } - return true; } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java index 3553c072..5e280560 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java @@ -146,7 +146,6 @@ public class Command_plugincontrol extends FreedomCommand } } } - return null; } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_setlimit.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_setlimit.java index 722c5183..ff2dc603 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_setlimit.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_setlimit.java @@ -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 = "/ [limit]", aliases = "setl,swl") +@CommandParameters(description = "Sets everyone's WorldEdit block modification limit to the default limit or to a custom limit.", usage = "/ [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); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_unban.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_unban.java index d32491ba..5de4f831 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_unban.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_unban.java @@ -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) { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_undisguiseall.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_undisguiseall.java index dc20cb22..32006848 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_undisguiseall.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_undisguiseall.java @@ -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; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wiperegions.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wiperegions.java index e9518ddd..fc4e1a0f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wiperegions.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wiperegions.java @@ -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 = "/ ", aliases = "wiperegions") -public class Command_wiperegions extends FreedomCommand { - +@CommandParameters(description = "Wipe all WorldGuard regions for a specified world.", usage = "/ ") +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; } } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wipewarps.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wipewarps.java index 7d7a032d..dcf4356a 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wipewarps.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_wipewarps.java @@ -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 = "/") +@CommandParameters(description = "Removes Essentials warps", usage = "/") 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; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/fun/Trailer.java b/src/main/java/me/totalfreedom/totalfreedommod/fun/Trailer.java index 0b25c654..87716e6f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/fun/Trailer.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/fun/Trailer.java @@ -7,6 +7,7 @@ import me.totalfreedom.totalfreedommod.util.DepreciationAggregator; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.block.data.BlockData; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -66,7 +67,7 @@ public class Trailer extends FreedomService } fromBlock.setType(MaterialGroup.WOOL_COLORS.get(random.nextInt(MaterialGroup.WOOL_COLORS.size()))); - byte data = DepreciationAggregator.getData_Block(fromBlock); + BlockData data = fromBlock.getBlockData(); Material material = Material.getMaterial(String.valueOf(fromBlock.getType())); for (int x = -1; x <= 1; x++) { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerData.java b/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerData.java index 78a14ce7..ad6ccb11 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerData.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/player/PlayerData.java @@ -56,6 +56,11 @@ public class PlayerData implements ConfigLoadable, ConfigSavable, Validatable cs.set("last_join", lastJoinUnix); } + public String getUsername() + { + return username; + } + public List getIps() { return Collections.unmodifiableList(ips); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/util/DepreciationAggregator.java b/src/main/java/me/totalfreedom/totalfreedommod/util/DepreciationAggregator.java index a9c1ab5f..49aadb9f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/util/DepreciationAggregator.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/util/DepreciationAggregator.java @@ -24,26 +24,6 @@ public class DepreciationAggregator return server.getOfflinePlayer(name); } - public static byte getData_MaterialData(MaterialData md) - { - return md.getData(); - } - - public static void setData_MaterialData(MaterialData md, byte data) - { - md.setData(data); - } - - public static byte getData_Block(Block block) - { - return block.getData(); - } - - public static org.bukkit.material.Lever makeLeverWithData(byte data) - { - return new org.bukkit.material.Lever(Material.LEVER, data); - } - public static String getName_EntityType(EntityType et) { return et.getName();