Much needed code reformat

This commit is contained in:
fernferret 2011-10-10 09:34:04 -06:00
parent 9e14daac1f
commit e93fec45ac
24 changed files with 92 additions and 77 deletions

View File

@ -7,8 +7,6 @@
package com.onarandombox.MultiverseCore; package com.onarandombox.MultiverseCore;
import com.pneumaticraft.commandhandler.Command;
/** /**
* Dummy class to make old MV Plugins not explode. * Dummy class to make old MV Plugins not explode.
* If this loads, the user WILL get a severe telling them to update said plugin! * If this loads, the user WILL get a severe telling them to update said plugin!

View File

@ -7,17 +7,13 @@
package com.onarandombox.MultiverseCore; package com.onarandombox.MultiverseCore;
import com.pneumaticraft.commandhandler.Command;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
/** /**
* Dummy class to make old MV Plugins not explode. * Dummy class to make old MV Plugins not explode.
* If this loads, the user WILL get a severe telling them to update said plugin! * If this loads, the user WILL get a severe telling them to update said plugin!
* WILL BE DELETED ON 11/1/11 * WILL BE DELETED ON 11/1/11
*/ */
@Deprecated @Deprecated
public class MVPermissions extends com.onarandombox.MultiverseCore.utils.MVPermissions{ public class MVPermissions extends com.onarandombox.MultiverseCore.utils.MVPermissions {
public MVPermissions(MultiverseCore plugin) { public MVPermissions(MultiverseCore plugin) {
super(plugin); super(plugin);
} }

View File

@ -38,7 +38,6 @@ import org.bukkit.util.config.Configuration;
import java.io.*; import java.io.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;

View File

@ -34,7 +34,8 @@ public interface MVPlugin extends LoggablePlugin {
public void setCore(MultiverseCore core); public void setCore(MultiverseCore core);
/** /**
* Allows Multiverse or a plugin to query another Multiverse plugin to see what version its protocol is. This number * Allows Multiverse or a plugin to query another Multiverse plugin to see what version its protocol is. This
* number
* should change when something will break the code. * should change when something will break the code.
* *
* @return The Integer protocol version. * @return The Integer protocol version.

View File

@ -7,14 +7,15 @@
package com.onarandombox.MultiverseCore.commands; package com.onarandombox.MultiverseCore.commands;
import com.onarandombox.MultiverseCore.utils.SafeTTeleporter;
import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination; import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.destination.DestinationFactory; import com.onarandombox.MultiverseCore.destination.DestinationFactory;
import com.onarandombox.MultiverseCore.destination.InvalidDestination; import com.onarandombox.MultiverseCore.destination.InvalidDestination;
import com.onarandombox.MultiverseCore.destination.WorldDestination; import com.onarandombox.MultiverseCore.destination.WorldDestination;
import com.onarandombox.MultiverseCore.event.MVTeleportEvent; import com.onarandombox.MultiverseCore.event.MVTeleportEvent;
import com.onarandombox.MultiverseCore.utils.*; import com.onarandombox.MultiverseCore.utils.LocationManipulation;
import com.onarandombox.MultiverseCore.utils.MVMessaging;
import com.onarandombox.MultiverseCore.utils.SafeTTeleporter;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;

View File

@ -83,6 +83,7 @@ public class BedDestination implements MVDestination {
// Bukkit should have already checked this. // Bukkit should have already checked this.
return false; return false;
} }
@Override @Override
public String toString() { public String toString() {
return "b:playerbed"; return "b:playerbed";

View File

@ -7,16 +7,15 @@
package com.onarandombox.MultiverseCore.destination; package com.onarandombox.MultiverseCore.destination;
import java.util.Arrays; import com.onarandombox.MultiverseCore.MultiverseCore;
import java.util.List;
import com.onarandombox.MultiverseCore.api.MVDestination; import com.onarandombox.MultiverseCore.api.MVDestination;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import com.onarandombox.MultiverseCore.MultiverseCore; import java.util.Arrays;
import java.util.List;
public class CannonDestination implements MVDestination { public class CannonDestination implements MVDestination {
private final String coordRegex = "(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*)"; private final String coordRegex = "(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*)";

View File

@ -7,10 +7,6 @@
package com.onarandombox.MultiverseCore.destination; package com.onarandombox.MultiverseCore.destination;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination; import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.commands.TeleportCommand; import com.onarandombox.MultiverseCore.commands.TeleportCommand;
@ -19,6 +15,10 @@ import com.pneumaticraft.commandhandler.Command;
import org.bukkit.permissions.Permission; import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault; import org.bukkit.permissions.PermissionDefault;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DestinationFactory { public class DestinationFactory {
private MultiverseCore plugin; private MultiverseCore plugin;
private Map<String, Class<? extends MVDestination>> destList; private Map<String, Class<? extends MVDestination>> destList;
@ -28,8 +28,8 @@ public class DestinationFactory {
this.plugin = plugin; this.plugin = plugin;
this.destList = new HashMap<String, Class<? extends MVDestination>>(); this.destList = new HashMap<String, Class<? extends MVDestination>>();
List<Command> cmds = this.plugin.getCommandHandler().getAllCommands(); List<Command> cmds = this.plugin.getCommandHandler().getAllCommands();
for(Command c : cmds) { for (Command c : cmds) {
if(c instanceof TeleportCommand) { if (c instanceof TeleportCommand) {
this.teleportCommand = c; this.teleportCommand = c;
} }
} }
@ -63,21 +63,21 @@ public class DestinationFactory {
} }
this.destList.put(identifier, c); this.destList.put(identifier, c);
// Special case for world defaults: // Special case for world defaults:
if(identifier.equals("")) { if (identifier.equals("")) {
identifier = "w"; identifier = "w";
} }
Permission self = this.plugin.getServer().getPluginManager().getPermission("multiverse.teleport.self."+identifier); Permission self = this.plugin.getServer().getPluginManager().getPermission("multiverse.teleport.self." + identifier);
Permission other = this.plugin.getServer().getPluginManager().getPermission("multiverse.teleport.other."+identifier); Permission other = this.plugin.getServer().getPluginManager().getPermission("multiverse.teleport.other." + identifier);
PermissionTools pt = new PermissionTools(this.plugin); PermissionTools pt = new PermissionTools(this.plugin);
if(self == null) { if (self == null) {
self = new Permission("multiverse.teleport.self."+identifier,"Permission to teleport yourself for the " + identifier + " destination.", PermissionDefault.OP); self = new Permission("multiverse.teleport.self." + identifier, "Permission to teleport yourself for the " + identifier + " destination.", PermissionDefault.OP);
this.plugin.getServer().getPluginManager().addPermission(self); this.plugin.getServer().getPluginManager().addPermission(self);
pt.addToParentPerms("multiverse.teleport.self."+identifier); pt.addToParentPerms("multiverse.teleport.self." + identifier);
} }
if(other == null) { if (other == null) {
other = new Permission("multiverse.teleport.other."+identifier,"Permission to teleport others for the " + identifier + " destination.", PermissionDefault.OP); other = new Permission("multiverse.teleport.other." + identifier, "Permission to teleport others for the " + identifier + " destination.", PermissionDefault.OP);
this.plugin.getServer().getPluginManager().addPermission(other); this.plugin.getServer().getPluginManager().addPermission(other);
pt.addToParentPerms("multiverse.teleport.other."+identifier); pt.addToParentPerms("multiverse.teleport.other." + identifier);
} }
this.teleportCommand.addAdditonalPermission(self); this.teleportCommand.addAdditonalPermission(self);
this.teleportCommand.addAdditonalPermission(other); this.teleportCommand.addAdditonalPermission(other);

View File

@ -7,16 +7,15 @@
package com.onarandombox.MultiverseCore.destination; package com.onarandombox.MultiverseCore.destination;
import java.util.Arrays; import com.onarandombox.MultiverseCore.MultiverseCore;
import java.util.List;
import com.onarandombox.MultiverseCore.api.MVDestination; import com.onarandombox.MultiverseCore.api.MVDestination;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import com.onarandombox.MultiverseCore.MultiverseCore; import java.util.Arrays;
import java.util.List;
public class ExactDestination implements MVDestination { public class ExactDestination implements MVDestination {
private final String coordRegex = "(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*)"; private final String coordRegex = "(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*),(-?[\\d]+\\.?[\\d]*)";
@ -29,7 +28,7 @@ public class ExactDestination implements MVDestination {
} }
public Vector getVelocity() { public Vector getVelocity() {
return new Vector(0,0,0); return new Vector(0, 0, 0);
} }
@Override @Override

View File

@ -60,8 +60,9 @@ public class InvalidDestination implements MVDestination {
public String getRequiredPermission() { public String getRequiredPermission() {
return null; return null;
} }
public Vector getVelocity() { public Vector getVelocity() {
return new Vector(0,0,0); return new Vector(0, 0, 0);
} }
@Override @Override

View File

@ -90,8 +90,9 @@ public class PlayerDestination implements MVDestination {
public String getRequiredPermission() { public String getRequiredPermission() {
return ""; return "";
} }
public Vector getVelocity() { public Vector getVelocity() {
return new Vector(0,0,0); return new Vector(0, 0, 0);
} }
@Override @Override

View File

@ -7,9 +7,7 @@
package com.onarandombox.MultiverseCore.enums; package com.onarandombox.MultiverseCore.enums;
/** /** Multiverse 2 */
* Multiverse 2
*/
public enum ConfigProperty { public enum ConfigProperty {
messagecooldown, teleportcooldown, worldnameprefix, useworldaccess, disableautoheal, fakepvp, bedrespawn messagecooldown, teleportcooldown, worldnameprefix, useworldaccess, disableautoheal, fakepvp, bedrespawn
} }

View File

@ -9,7 +9,6 @@ package com.onarandombox.MultiverseCore.listeners;
import com.fernferret.allpay.AllPay; import com.fernferret.allpay.AllPay;
import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVPlugin;
import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.event.server.ServerListener; import org.bukkit.event.server.ServerListener;
@ -28,10 +27,10 @@ public class MVPluginListener extends ServerListener {
/** Keep an eye out for Plugins which we can utilize. */ /** Keep an eye out for Plugins which we can utilize. */
@Override @Override
public void onPluginEnable(PluginEnableEvent event) { public void onPluginEnable(PluginEnableEvent event) {
if(event.getPlugin() instanceof com.onarandombox.MultiverseCore.MVPlugin) { if (event.getPlugin() instanceof com.onarandombox.MultiverseCore.MVPlugin) {
this.plugin.log(Level.SEVERE, "Your version of '" + event.getPlugin() + "' is OUT OF DATE."); this.plugin.log(Level.SEVERE, "Your version of '" + event.getPlugin() + "' is OUT OF DATE.");
this.plugin.log(Level.SEVERE, "Please grab the latest version from:"); this.plugin.log(Level.SEVERE, "Please grab the latest version from:");
this.plugin.log(Level.SEVERE, "http://bukkit.onarandombox.com/?dir="+event.getPlugin().getDescription().getName().toLowerCase()); this.plugin.log(Level.SEVERE, "http://bukkit.onarandombox.com/?dir=" + event.getPlugin().getDescription().getName().toLowerCase());
this.plugin.log(Level.SEVERE, "I'm going to disable " + event.getPlugin().getDescription().getName() + " now."); this.plugin.log(Level.SEVERE, "I'm going to disable " + event.getPlugin().getDescription().getName() + " now.");
this.plugin.log(Level.SEVERE, "IF YOU DO NOT UPDATE, YOUR SERVER WILL **NOT** FUNCTION PROPERLY!!!"); this.plugin.log(Level.SEVERE, "IF YOU DO NOT UPDATE, YOUR SERVER WILL **NOT** FUNCTION PROPERLY!!!");
this.plugin.getServer().getPluginManager().disablePlugin(event.getPlugin()); this.plugin.getServer().getPluginManager().disablePlugin(event.getPlugin());

View File

@ -7,8 +7,7 @@
package com.onarandombox.MultiverseCore.utils; package com.onarandombox.MultiverseCore.utils;
import java.util.logging.Level; import com.onarandombox.MultiverseCore.MultiverseCore;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
@ -16,7 +15,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Minecart; import org.bukkit.entity.Minecart;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
import com.onarandombox.MultiverseCore.MultiverseCore; import java.util.logging.Level;
public class BlockSafety { public class BlockSafety {
@ -31,6 +30,7 @@ public class BlockSafety {
* @param x * @param x
* @param y * @param y
* @param z * @param z
*
* @return * @return
*/ */
public boolean isBlockAboveAir(Location l) { public boolean isBlockAboveAir(Location l) {
@ -50,12 +50,14 @@ public class BlockSafety {
} }
/** /**
* This function checks whether the block at the coordinates given is safe or not by checking for Laval/Fire/Air etc. This also ensures there is enough space for a player to spawn! * This function checks whether the block at the coordinates given is safe or not by checking for Laval/Fire/Air
* etc. This also ensures there is enough space for a player to spawn!
* *
* @param world * @param world
* @param x * @param x
* @param y * @param y
* @param z * @param z
*
* @return * @return
*/ */
public boolean playerCanSpawnHereSafely(Location l) { public boolean playerCanSpawnHereSafely(Location l) {
@ -94,6 +96,7 @@ public class BlockSafety {
* If someone has a better way of this... Please either tell us, or submit a pull request! * If someone has a better way of this... Please either tell us, or submit a pull request!
* *
* @param type * @param type
*
* @return * @return
*/ */
private boolean isSolidBlock(Material type) { private boolean isSolidBlock(Material type) {
@ -184,6 +187,7 @@ public class BlockSafety {
* Checks recursively below location L for 2 blocks of water * Checks recursively below location L for 2 blocks of water
* *
* @param l * @param l
*
* @return * @return
*/ */
public boolean hasTwoBlocksofWaterBelow(Location l) { public boolean hasTwoBlocksofWaterBelow(Location l) {

View File

@ -11,12 +11,7 @@ import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.StringWriter; import java.io.StringWriter;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.logging.FileHandler; import java.util.logging.*;
import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
public class DebugLog { public class DebugLog {

View File

@ -14,8 +14,10 @@ public class FancyMessage implements FancyText {
private String message; private String message;
private boolean main = true; private boolean main = true;
private FancyColorScheme colors; private FancyColorScheme colors;
/** /**
* Allows easy creation of an alternating colored list * Allows easy creation of an alternating colored list
*
* @param title * @param title
* @param message * @param message
*/ */
@ -24,19 +26,24 @@ public class FancyMessage implements FancyText {
this.message = message; this.message = message;
this.colors = scheme; this.colors = scheme;
} }
public void setColorMain() { public void setColorMain() {
this.main = true; this.main = true;
} }
public void setColorAlt() { public void setColorAlt() {
this.main = false; this.main = false;
} }
@Override @Override
public String getFancyText() { public String getFancyText() {
return this.colors.getMain(this.main) + this.title + this.colors.getDefault() + message; return this.colors.getMain(this.main) + this.title + this.colors.getDefault() + message;
} }
public void setAltColor(boolean altColor) { public void setAltColor(boolean altColor) {
this.main = !altColor; this.main = !altColor;
} }
public void setMainColor(boolean mainColor) { public void setMainColor(boolean mainColor) {
this.main = mainColor; this.main = mainColor;
} }

View File

@ -7,18 +7,19 @@
package com.onarandombox.MultiverseCore.utils; package com.onarandombox.MultiverseCore.utils;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.Map;
public class LocationManipulation { public class LocationManipulation {
private static Map<String, Integer> orientationInts = new HashMap<String, Integer>(); private static Map<String, Integer> orientationInts = new HashMap<String, Integer>();
static { static {
orientationInts.put("n", 180); orientationInts.put("n", 180);
orientationInts.put("ne", 225); orientationInts.put("ne", 225);
@ -35,6 +36,7 @@ public class LocationManipulation {
* Convert a Location into a Colon separated string to allow us to store it in text. * Convert a Location into a Colon separated string to allow us to store it in text.
* *
* @param location * @param location
*
* @return * @return
*/ */
public static String locationToString(Location location) { public static String locationToString(Location location) {
@ -56,6 +58,7 @@ public class LocationManipulation {
* @param zStr * @param zStr
* @param yawStr * @param yawStr
* @param pitchStr * @param pitchStr
*
* @return * @return
*/ */
public Location stringToLocation(World world, String xStr, String yStr, String zStr, String yawStr, String pitchStr) { public Location stringToLocation(World world, String xStr, String yStr, String zStr, String yawStr, String pitchStr) {
@ -70,7 +73,9 @@ public class LocationManipulation {
/** /**
* Returns a colored string with the coords * Returns a colored string with the coords
*
* @param l * @param l
*
* @return * @return
*/ */
public static String strCoords(Location l) { public static String strCoords(Location l) {
@ -85,9 +90,12 @@ public class LocationManipulation {
result += ChatColor.WHITE + "Y: " + ChatColor.GOLD + df.format(l.getYaw()) + " "; result += ChatColor.WHITE + "Y: " + ChatColor.GOLD + df.format(l.getYaw()) + " ";
return result; return result;
} }
/** /**
* Converts a location to a printable readable formatted string including pitch/yaw * Converts a location to a printable readable formatted string including pitch/yaw
*
* @param l * @param l
*
* @return * @return
*/ */
public static String strCoordsRaw(Location l) { public static String strCoordsRaw(Location l) {
@ -107,6 +115,7 @@ public class LocationManipulation {
* Return the NESW Direction a Location is facing. * Return the NESW Direction a Location is facing.
* *
* @param location * @param location
*
* @return * @return
*/ */
public static String getDirection(Location location) { public static String getDirection(Location location) {
@ -134,9 +143,12 @@ public class LocationManipulation {
return dir; return dir;
} }
/** /**
* Returns the float yaw position for the given cardianl direction * Returns the float yaw position for the given cardianl direction
*
* @param orientation * @param orientation
*
* @return * @return
*/ */
public static float getYaw(String orientation) { public static float getYaw(String orientation) {
@ -148,9 +160,12 @@ public class LocationManipulation {
} }
return 0; return 0;
} }
/** /**
* Returns a speed float from a given vector. * Returns a speed float from a given vector.
*
* @param v * @param v
*
* @return * @return
*/ */
public static float getSpeed(Vector v) { public static float getSpeed(Vector v) {
@ -159,10 +174,13 @@ public class LocationManipulation {
// X, Y, Z // X, Y, Z
// -W/+E,0, -N/+S // -W/+E,0, -N/+S
/** /**
* Returns a translated vector from the given direction * Returns a translated vector from the given direction
*
* @param v * @param v
* @param direction * @param direction
*
* @return * @return
*/ */
public static Vector getTranslatedVector(Vector v, String direction) { public static Vector getTranslatedVector(Vector v, String direction) {
@ -196,6 +214,7 @@ public class LocationManipulation {
* Returns the next Location that an entity is traveling at * Returns the next Location that an entity is traveling at
* *
* @param v * @param v
*
* @return * @return
*/ */
public static Location getNextBlock(Vehicle v) { public static Location getNextBlock(Vehicle v) {

View File

@ -36,22 +36,24 @@ public class MVMessaging {
/** /**
* Sends a message to the specified sender if the cooldown has passed. * Sends a message to the specified sender if the cooldown has passed.
* @param sender The person/console to send the message to. *
* @param message The message to send. * @param sender The person/console to send the message to.
* @param message The message to send.
* @param ignoreCooldown If true this message will always be sent. Useful for things like menus * @param ignoreCooldown If true this message will always be sent. Useful for things like menus
*
* @return true if the message was sent, false if not. * @return true if the message was sent, false if not.
*/ */
public boolean sendMessage(CommandSender sender, String message, boolean ignoreCooldown) { public boolean sendMessage(CommandSender sender, String message, boolean ignoreCooldown) {
if(!(sender instanceof Player) || ignoreCooldown) { if (!(sender instanceof Player) || ignoreCooldown) {
sender.sendMessage(message); sender.sendMessage(message);
return true; return true;
} }
if(!this.sentList.containsKey(sender.getName())) { if (!this.sentList.containsKey(sender.getName())) {
sender.sendMessage(message); sender.sendMessage(message);
this.sentList.put(sender.getName(), new Date()); this.sentList.put(sender.getName(), new Date());
return true; return true;
} else { } else {
if(this.sentList.get(sender.getName()).after(new Date((new Date()).getTime() + this.cooldown))){ if (this.sentList.get(sender.getName()).after(new Date((new Date()).getTime() + this.cooldown))) {
sender.sendMessage(message); sender.sendMessage(message);
this.sentList.put(sender.getName(), new Date()); this.sentList.put(sender.getName(), new Date());
return true; return true;
@ -61,17 +63,17 @@ public class MVMessaging {
} }
public boolean sendMessages(CommandSender sender, String[] messages, boolean ignoreCooldown) { public boolean sendMessages(CommandSender sender, String[] messages, boolean ignoreCooldown) {
if(!(sender instanceof Player) || ignoreCooldown) { if (!(sender instanceof Player) || ignoreCooldown) {
this.sendMessages(sender, messages); this.sendMessages(sender, messages);
return true; return true;
} }
if(!this.sentList.containsKey(sender.getName())) { if (!this.sentList.containsKey(sender.getName())) {
this.sendMessages(sender, messages); this.sendMessages(sender, messages);
this.sentList.put(sender.getName(), new Date()); this.sentList.put(sender.getName(), new Date());
return true; return true;
} else { } else {
if(this.sentList.get(sender.getName()).after(new Date((new Date()).getTime() + this.cooldown))){ if (this.sentList.get(sender.getName()).after(new Date((new Date()).getTime() + this.cooldown))) {
this.sendMessages(sender, messages); this.sendMessages(sender, messages);
this.sentList.put(sender.getName(), new Date()); this.sentList.put(sender.getName(), new Date());
return true; return true;
@ -86,7 +88,7 @@ public class MVMessaging {
public boolean sendMessages(CommandSender sender, String[] messages) { public boolean sendMessages(CommandSender sender, String[] messages) {
boolean success = true; boolean success = true;
for(String s : messages) { for (String s : messages) {
success = (!(!this.sendMessage(sender, s, true) && success)); success = (!(!this.sendMessage(sender, s, true) && success));
} }
return success; return success;

View File

@ -7,15 +7,14 @@
package com.onarandombox.MultiverseCore.utils; package com.onarandombox.MultiverseCore.utils;
import java.util.logging.Level; import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination; import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.destination.CannonDestination; import com.onarandombox.MultiverseCore.destination.CannonDestination;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.TravelAgent; import org.bukkit.TravelAgent;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.onarandombox.MultiverseCore.MultiverseCore; import java.util.logging.Level;
public class MVTravelAgent implements TravelAgent { public class MVTravelAgent implements TravelAgent {
private MVDestination destination; private MVDestination destination;

View File

@ -16,6 +16,7 @@ public class PermissionTools {
public PermissionTools(MultiverseCore plugin) { public PermissionTools(MultiverseCore plugin) {
this.plugin = plugin; this.plugin = plugin;
} }
public void addToParentPerms(String permString) { public void addToParentPerms(String permString) {
String permStringChopped = permString.replace(".*", ""); String permStringChopped = permString.replace(".*", "");
@ -62,6 +63,7 @@ public class PermissionTools {
* If the given permission was 'multiverse.core.tp.self', this would return 'multiverse.core.tp.*'. * If the given permission was 'multiverse.core.tp.self', this would return 'multiverse.core.tp.*'.
* *
* @param separatedPermissionString The array of a dot separated perm string. * @param separatedPermissionString The array of a dot separated perm string.
*
* @return The dot separated parent permission string. * @return The dot separated parent permission string.
*/ */
private String getParentPerm(String[] separatedPermissionString) { private String getParentPerm(String[] separatedPermissionString) {

View File

@ -10,8 +10,6 @@ package com.onarandombox.MultiverseCore.utils;
import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MVDestination; import com.onarandombox.MultiverseCore.api.MVDestination;
import com.onarandombox.MultiverseCore.destination.InvalidDestination; import com.onarandombox.MultiverseCore.destination.InvalidDestination;
import com.onarandombox.MultiverseCore.utils.BlockSafety;
import com.onarandombox.MultiverseCore.utils.LocationManipulation;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Minecart; import org.bukkit.entity.Minecart;

View File

@ -88,6 +88,7 @@ public class UpdateChecker {
* Convert the given Version String to a Normalised Version String so we can compare it. * Convert the given Version String to a Normalised Version String so we can compare it.
* *
* @param version * @param version
*
* @return * @return
*/ */
public static String normalisedVersion(String version) { public static String normalisedVersion(String version) {

View File

@ -14,7 +14,7 @@ package com.onarandombox.utils;
*/ */
@Deprecated @Deprecated
public class DebugLog extends com.onarandombox.MultiverseCore.utils.DebugLog{ public class DebugLog extends com.onarandombox.MultiverseCore.utils.DebugLog {
public DebugLog(String logger, String file) { public DebugLog(String logger, String file) {
super(logger, file); super(logger, file);
} }

View File

@ -8,11 +8,6 @@
package com.onarandombox.utils; package com.onarandombox.utils;
import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.utils.MVDestination;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
/** /**
* Dummy class to make old MV Plugins not explode. * Dummy class to make old MV Plugins not explode.