public interface IPlayerMP extends IHook {
   
   /**
    * Called when the onUpdate() method is called in Minecraft
    * 
    * @param player - the player that the event occurred on
    */
   public void onTick(Player player);
} public abstract class Parameter {

   private String label;
   private boolean optional;
   private boolean variableLength;
   
   public Parameter(String label, boolean optional) {
      this.label = label;
      this.optional = optional;
   }
   
   public Parameter(String label, boolean optional, boolean variableLength) {
      this.label = label;
      this.optional = optional;
      this.variableLength = variableLength;
   }
   
   /**
    * Returns the parameter label. The label is used to display to the user
    * 
    * @return The parameter label
    */
   public String getLabel() {
      return label;
   }
   
   /**
    * Returns whether the parameter is optional
    * 
    * @return Returns the optional value
    */
   public boolean isOptional() {
      return optional;
   }
   
   /**
    * Returns whether the parameter is variable length or not. This parameter 
    * is used while doing parameter validation but is ignored unless it is 
    * the last specified parameter
    * 
    * @return Returns the variable length flag
    */
   public boolean isVariableLength() {
      return variableLength;
   }
   
   /**
    * Validates the specified user input whether it is valid input according to
    * the implementing class. For example ParameterInteger will validate that
    * the provided input is a valid integer between the specified values
    * 
    * @param parameter - The parameter provided by the user to verify
    * @return The validated value is returned when the specified parameter is 
    * valid. The returned value is of the type it was validated as
    */
   public abstract Object validate(String parameter) throws ValidationException;
} public class ParameterInteger extends Parameter {
   private int min;
   private int max;
   
   public ParameterInteger(String label, boolean optional) {
      this(label,optional,Integer.MIN_VALUE,Integer.MAX_VALUE);
   }
   
   public ParameterInteger(String label, boolean optional, int min, int max) {
      super(label, optional);
      this.min = min;
      this.max = max;
   }

   /**
    * @see com.sijobe.spc.validation.Parameter#validate(java.lang.String)
    */
   @Override
   public Object validate(String parameter) throws ValidationException {
      try {
         int value = Integer.parseInt(parameter);
         if (value > min && value < max) {
            return value;
         } else {
            throw new ValidationException("Parameter " + parameter + 
                     " is out of the expected range (" + min + "-" + max + ")");
         }
      } catch (NumberFormatException n) {
         throw new ValidationException("Invalid text (" + parameter + 
                  ") where integer value was expected.");
      } catch (Exception e) {
         throw new ValidationException();
      }
   }
} public class ParameterString extends Parameter {
   private List<String> validValues;
   private String expected;

   public ParameterString(String label, boolean optional) {
      this(label,optional,false,null);
   }
   
   public ParameterString(String label, boolean optional, boolean variableLength) {
      this(label,optional,variableLength,null);
   }
   
   public ParameterString(String label, boolean optional, String validValues[]) {
      super(label, optional, false);
      List<String> values = new ArrayList<String>();
      for (String value : validValues) {
         values.add(value);
      }
      initialise(label, optional, false, values);
   }
   
   public ParameterString(String label, boolean optional, List<String> validValues) {
      this(label,optional,false,validValues);
   }
   
   public ParameterString(String label, boolean optional, boolean variableLength, List<String> validValues) {
      super(label, optional, variableLength);
      initialise(label, optional, variableLength, validValues);
   }
   
   private void initialise(String label, boolean optional, boolean variableLength, List<String> validValues) {
      this.validValues = validValues;
      if (validValues == null) {
         validValues = new ArrayList<String>();
      }
      for (int i = 0; i < validValues.size(); i++) {
         validValues.set(i, validValues.get(i).toLowerCase());
         if (i == 0) {
            expected = validValues.get(i);
         } else {
            expected = expected + ", " + validValues.get(i);
         }
      }
   }

   /**
    * @see com.sijobe.spc.validation.Parameter#validate(java.lang.String)
    */
   @Override
   public Object validate(String parameter) throws ValidationException {
      if (validValues == null) {
         return parameter;
      }
      if (validValues.contains(parameter.toLowerCase())) {
         return parameter;
      }
      throw new ValidationException("Parameter " + parameter + 
               " is an unexpected value (" + expected + ")");
   }

} public class Parameters {
   
   /**
    * Optional String of variable length arguments - ie: any input
    */
   public static final Parameters DEFAULT = new Parameters(
      new Parameter[] {
         new ParameterString("",true,true)
      }
   );
   /**
    * Parameters of the command
    */
   public static final Parameters DEFAULT_BOOLEAN = new Parameters (
      new Parameter[] {
         new ParameterBoolean("[enable|disable]", true, "enable", "disable")
      }
   );
   
   /**
    * Each of the parameter validators to use to validate
    */
   private Parameter params[];

   /**
    * Initialises the class using the specified validation parameters
    * 
    * @param params - The validation parameters to use
    */
   public Parameters(Parameter params[]) {
      this.params = params;
   }

   /**
    * Validates the input against the parameters for this command. The input
    * is validated by each of the validators and which results in a List of
    * type correct Object returned. 
    * 
    * If more parameters are specified than validators and the last validator
    * is not variable length then any extra parameters are ignored.
    * 
    * @param parameters - The parameters to validate
    * @return A list of validated objects that match their validation type
    * @throws ValidationException - when a validation error occurs an expection
    * is thrown detailing the problem
    */
   public List<?> validate(String parameters[]) throws ValidationException {
      List<Object> validated = new ArrayList<Object>();
      for (int i = 0; i < params.length; i++) {
         // Checks for the correct number of arguments
         if (i + 1 > parameters.length) { 
            if (params[i].isOptional()) {
               continue;
            } else {
               throw new ValidationException("Not enough arguments");
            }
         }

         try {
            if (i == params.length - 1 && parameters.length > params.length && params[i].isVariableLength()) { 
               // Last Parameter and variable length - combine parameters and validate
               String variableLength = "";
               for (int j = i; j < parameters.length; j++) {
                  if (j == i) {
                     variableLength = parameters[j];
                  } else {
                     variableLength = variableLength + " " + parameters[j];
                  }
               }
               validated.add(params[i].validate(variableLength));
            } else {
               // Validate the parameter
               validated.add(params[i].validate(parameters[i]));
            }
         } catch (ValidationException v) {
            throw v;
         } catch (Exception e) {
            throw new ValidationException("Problem with the command: " + e);
         }
      }
      return validated;
   }

   /**
    * Gets how to use the command
    * 
    * @return The String representing how to use the command
    */
   public String getUsage() {
      String usage = "";
      for (Parameter param : params) {
         usage += param.getLabel() + " ";
      }
      return usage.trim();
   }
} public class CommandException extends Exception {
   
   /**
    * GUID
    */
   private static final long serialVersionUID = -2082390336460702125L;

   public CommandException() {
      super();
   }
   
   public CommandException(String message) {
      super(message);
   }
   
   public CommandException(Throwable t) {
      super(t);
   }
} public class CommandSender {
   private final ICommandSender sender;
   
   /**
    * Standard constructor that accepts the sender to wrap
    * 
    * @param sender - The sender to wrap
    */
   public CommandSender(ICommandSender sender) {
      this.sender = sender;
   }
   
   /**
    * Creates an instance of a command sender using the player instance
    * 
    * @param player - The player to create a command sender
    */
   public CommandSender(Player player) {
      this (player.getMinecraftPlayer());
   }
   
   /**
    * Gets the senders name, commonly this is the player's username
    * 
    * @return The senders name
    */
   public String getSenderName() {
      return sender.getCommandSenderName();
   }
   
   /**
    * Returns true if the sender can use the specified command
    * 
    * @param command - The command name
    * @return True is returned if the sender can use the specified command
    */
   public boolean canUseCommand(String command) {
      return sender.canCommandSenderUseCommand(4, command);
   }
   
   /**
    * Sends the specified message to the sender. The sender should display this
    * message.
    * 
    * @param message - The message to display
    */
   public void sendMessageToPlayer(String message) {
      sender.sendChatToPlayer(ChatMessageComponent.func_111066_d(message));
   }
   
   /**
    * Translates the provided key translate with the provided parameters
    * 
    * @param translate - The string to translate
    * @param params - The parameters
    * @return The translated String
    */
   public String translateString(String translate, Object ... params) {
      return StatCollector.translateToLocalFormatted(translate, params);
   }
   
   /**
    * Gets the raw data object that this class is wrapping around
    * 
    * @return The ICommandSender class
    */
   public ICommandSender getMinecraftISender() {
      return sender;
   }
   
   /**
    * Returns true if this command sender object is a player
    * 
    * @return True if the command sender is a player, false otherwise
    */
   public boolean isPlayer() {
      return sender instanceof EntityPlayer;
   }
} public class Coordinate {
   
   private final double x;
   private final double y;
   private final double z;
   
   /**
    * Initialises the class using double values
    * 
    * @param x - The X coordinate
    * @param y - The Y coordinate
    * @param z - The Z coordinate
    */
   public Coordinate(double x, double y, double z) {
      this.x = x;
      this.y = y;
      this.z = z;
   }
   
   /**
    * Initialises the class using integer values
    * 
    * @param x - The X coordinate
    * @param y - The Y coordinate
    * @param z - The Z coordinate
    */
   public Coordinate(int x, int y, int z) {
      this.x = x;
      this.y = y;
      this.z = z;
   }
   
   /**
    * Gets the X coordinate
    * 
    * @return The X coordinate
    */
   public double getX() {
      return x;
   }
   
   /**
    * Gets the X coordinate rounded to the closest block
    * 
    * @return The X coordinate
    */
   public int getBlockX() {
      int x = (int)getX();
      return getX() < (double)x ? x - 1 : x;
   }
   
   /**
    * Gets the Y coordinate
    * 
    * @return The Y coordinate
    */
   public double getY() {
      return y;
   }
   
   /**
    * Gets the Y coordinate rounded to the closest block
    * 
    * @return The Y coordinate
    */
   public int getBlockY() {
      return (int)getY();
   }
   
   /**
    * Gets the Z coordinate
    * 
    * @return The Z coordinate
    */
   public double getZ() {
      return z;
   }
   
   /**
    * Gets the Z coordinate rounded to the closest block
    * 
    * @return The Z coordinate
    */
   public int getBlockZ() {
      int z = (int)getZ();
      return getZ() < (double)z ? z - 1 : z;
   }
   
   /**
    * Gets the distance between two coordinates
    * 
    * @param compare - The coordinate to compare
    * @return The distance between the coordinates
    */
   public double getDistanceBetweenCoordinates(Coordinate compare) {
      double diffX = getX() - compare.getX();
      double diffY = getY() - compare.getY();
      double diffZ = getZ() - compare.getZ();
      return Math.sqrt((diffX * diffX) + (diffY * diffY) + (diffZ * diffZ));
   }
   
   /**
    * Checks if this coordinate matches the provided object by comparing the 
    * double X, Y, Z fields. If they match true is returned
    * 
    * @see java.lang.Object#equals(java.lang.Object)
    */
   @Override
   public boolean equals(Object obj) {
      if (obj != null && obj instanceof Coordinate) {
         Coordinate compare = (Coordinate)obj;
         return compare.getX() == getX() && compare.getY() == getY() && compare.getZ() == getZ();
      }
      return false;
   }
   
   /**
    * Converts the Coordinate to a String value
    * 
    * @see java.lang.Object#toString()
    */
   @Override
   public String toString() {
      return x + "," + y + "," + z;
   }
} public class Item {

   /**
    * A list of item names that are loaded in the game
    */
   private static final List<String> ITEM_NAMES;
   static {
      ITEM_NAMES = new ArrayList<String>();
      for (net.minecraft.src.Item item : net.minecraft.src.Item.itemsList) {
         if (item != null) {
            ITEM_NAMES.add(StatCollector.translateToLocal(item.getUnlocalizedName()));
         } else {
            ITEM_NAMES.add(null);
         }
      }
   }

   /**
    * Translates the item code name into the item display name
    * 
    * @param toTranslate - The item name to translate
    * @return The display name of the item
    */
   /*public static String translateItemName(String toTranslate) {
      return StringTranslate.getInstance().translateNamedKey(toTranslate).toString().trim();
   }*/

   /**
    * Gets the item id of the specified item denoted by the string name
    * 
    * @param itemName - The name of the item 
    * @return the id of the item. If the item doesn't exist -1 is returned
    */
   public static int getItemId(String itemName) {
      return ITEM_NAMES.indexOf(itemName.toLowerCase());
   }

   /**
    * Returns true if the specified item id denotes a valid item
    * 
    * @param id - The id of the item to check
    * @return true is returned if the id is valid, false otherwise
    */
   public static boolean isValidItem(int id) {
      if (id < 0 || id > ITEM_NAMES.size()) {
         return false;
      }
      return ITEM_NAMES.get(id) != null;
   }

   /**
    * Gets the maximum stack size of the specified item
    * 
    * @param id - The id of the item 
    * @return The stack size of the item, or 0 if not valid
    */
   public static int getMaxStack(int id) {
      if (isValidItem(id)) {
         return net.minecraft.src.Item.itemsList[id].getItemStackLimit();
      }
      return 0;
   }

   /**
    * Gets a list containing all of the loaded enchantments
    * 
    * @return The enchantment list
    */
   public static List<String> getEnchantments() {
      List<Enchantment> enchantments = Arrays.asList(Enchantment.enchantmentsList);
      List<String> names = new ArrayList<String>();
      for (Enchantment enchantment : enchantments) {
         if (enchantment != null) {
            names.add(StatCollector.translateToLocal(enchantment.getName()).replace(' ', '_'));
         } else {
            names.add(null);
         }
      }
      return names;
   }

   /**
    * Adds the specified enchantment to the currently selected item in the 
    * players inventory
    *  
    * @param player - The player to add the enchantment to
    * @param enchantment - The enchantment to add
    * @param level - The level of the enchantment
    * @return The name of the command added, or null if there was an issue
    */
   public static String addEnchantmentToCurrentItem(Player player, int enchantment, int level) {
      try {
         if (Enchantment.enchantmentsList[enchantment] == null) {
            return null;
         }
         player.getMinecraftPlayer().inventory.mainInventory[player.getMinecraftPlayer().inventory.currentItem].addEnchantment(Enchantment.enchantmentsList[enchantment], level);
         return Enchantment.enchantmentsList[enchantment].getTranslatedName(level);
      } catch (Exception e) {
         return null;
      }
   }
   
   /**
    * Removes all of the enchantments of the currently selected item
    * 
    * @param player - The player to remove the enchantments on
    */
   public static void removeEnchantmentsOnCurrentItem(Player player) {
      player.getMinecraftPlayer().inventory.mainInventory[player.getMinecraftPlayer().inventory.currentItem].stackTagCompound = null;
   }
   
   /**
    * Resets the damage of the item stack in the specified slot of the player.
    * if there is no item in the specified slot then nothing happens.
    * 
    * @param player - The player to change the item
    * @param slot - The slot of the inventory
    */
   public static void resetDamageOnItem(Player player, int slot) {
      if (slot < 0 || slot >= player.getMinecraftPlayer().inventory.mainInventory.length) {
         return;
      }
      ItemStack item = player.getMinecraftPlayer().inventory.mainInventory[slot];
      if (item == null) {
         return;
      }
      if (item.getHasSubtypes() || !item.isItemDamaged()) {
         return;
      }
      item.setItemDamage(0);
   }
} public class Player {

   /**
    * The object that the instance is wrapped around
    */
   private final EntityPlayer player;

   public Player(EntityPlayer player) {
      this.player = player;
   }

   /**
    * Sets the player position and if on server sends the update to the client
    * 
    * @param c - The coordinate that the player is being moved to
    */
   public void setPosition(Coordinate c) {
      if (player instanceof EntityPlayerMP) {
         ((EntityPlayerMP) player).setPositionAndUpdate(c.getX(), c.getY(), c.getZ());
      } else {
         player.setPosition(c.getX(), c.getY(), c.getZ());
      }
   }

   /**
    * Gets the current position that the player is currently standing
    * 
    * @return The position that the player is standing
    */
   public Coordinate getPosition() {
      return new Coordinate(player.posX, player.posY, player.posZ);
   }

   /**
    * Gets the player rotation yaw
    * 
    * @return Rotation Yaw
    */
   public float getYaw() {
      return player.rotationYaw;
   }

   /**
    * Sets the rotation yaw of the player
    * 
    * @param yaw - The yaw value to set to the player
    */
   public void setYaw(float yaw) {
      player.rotationYaw = yaw;
   }

   /**
    * Gets the player rotation pitch
    * 
    * @return Rotation pitch
    */
   public float getPitch() {
      return player.rotationPitch;
   }

   /**
    * Sets the rotation pitch of the player
    * 
    * @param pitch - The pitch value to set to the player
    */
   public void setPitch(float pitch) {
      player.rotationPitch = pitch;
   }

   /**
    * Gets the world that the player is currently in
    * 
    * @return The world that the player is currently in
    */
   public World getWorld() {
      if (player instanceof EntityPlayerMP) {
         return new World(((EntityPlayerMP) player).theItemInWorldManager.theWorld); // why?
      } else {
         return new World(player.worldObj);
      }
   }

   /**
    * Sends a chat message to the user
    * 
    * @param message - The message to send to the user
    */
   public void sendChatMessage(String message) {
      player.addChatMessage(message);
   }

   /**
    * Gives the player a maximum stack of the specified item
    * 
    * @param id - The item id
    */
   public void givePlayerItem(int id) {
      givePlayerItem(id, Item.getMaxStack(id));
   }

   /**
    * Gives the player a maximum stack of the specified item
    * 
    * @param id - The item id
    * @param quantity - The quantity of the item
    */
   public void givePlayerItem(int id, int quantity) {
      givePlayerItem(id, quantity, 0);
   }

   /**
    * Gives the player a maximum stack of the specified item
    * 
    * @param id - The item id
    * @param quantity - The quantity of the item
    * @param damage - The "damage" (metadata) value of the item
    */
   public void givePlayerItem(int id, int quantity, int damage) {
      ItemStack itemStack = new ItemStack(id, quantity, damage);
      if (!player.inventory.addItemStackToInventory(itemStack)) {
         player.dropPlayerItem(itemStack);
      }
   }

   /**
    * Gets the players current health
    * 
    * @return The value of the players health
    */
   public float getHealth() {
      return player.func_110143_aJ();
   }

   /**
    * Sets the players health to the specified value
    * 
    * @param health - The health amount
    */
   public void setHealth(float health) {
      player.setEntityHealth(health);
   }

   /**
    * Heals the player the specified quantity. Use a negative number to remove
    * the specified amount from the player.
    * 
    * @param quantity - The ammount to heal the player
    */
   public void heal(float quantity) {
      setHealth(getHealth() + quantity);
   }

   /**
    * Gets the players current hunger level
    * 
    * @return The hunger level
    */
   public int getHunger() {
      return player.getFoodStats().getFoodLevel();
   }

   /**
    * Sets the players hunger level
    * 
    * @param food - The hunger level to set to
    */
   public void setHunger(int food) {
      player.getFoodStats().setFoodLevel(food);
   }

   /**
    * Gets the boolean value representing whether player damage is on or off.
    * 
    * @return True when damage is on, false when damage is off
    */
   public boolean getDamage() {
      return !player.capabilities.disableDamage;
   }

   /**
    * Sets whether player damage is on or off
    * 
    * @param damage - when true it turns player damage on, false turns it off
    */
   public void setDamage(boolean damage) {
      player.capabilities.disableDamage = !damage;
   }

   /**
    * Sets the item contained within the specified inventory slot
    * 
    * @param slot - The slot to set
    * @param id - The item id
    * @param quantity - The item quantity
    * @param damage - The item "damage" value
    * @return True if the slot was correctly set, false otherwise
    */
   public boolean setInventorySlot(int slot, int id, int quantity, int damage) {
      if (slot < 0 || slot >= player.inventory.mainInventory.length) {
         return false;
      } else if (!Item.isValidItem(id)) {
         if (id == 0) {
            player.inventory.mainInventory[slot] = null;
            return true;
         }
         return false;
      }
      player.inventory.mainInventory[slot] = new ItemStack(id, quantity, damage);
      return true;
   }

   /**
    * Performs a trace on the players view to the specified maximum distance.
    * The trace returns the coordinate where it hits a block or null if nothing
    * was found.
    * 
    * @param distance - The maximum distance to check
    * @return A coordinate object containing the block that was inline with
    *         the players view
    */
   public Coordinate trace(double distance) {
      MovingObjectPosition m = rayTrace(distance, 1.0F);
      if (m == null) {
         return null;
      }
      return new Coordinate(m.blockX, m.blockY, m.blockZ);
   }

   public MovingObjectPosition rayTrace(double distance, float partialTickTime) {
      Vec3 positionVec = getPositionVec(partialTickTime);
      Vec3 lookVec = player.getLook(partialTickTime);
      Vec3 hitVec = positionVec.addVector(lookVec.xCoord * distance, lookVec.yCoord * distance, lookVec.zCoord * distance);
      return player.worldObj.rayTraceBlocks_do_do(positionVec, hitVec, false, true); // TODO: Validate correct params
   }

   /**
    * interpolated position vector
    */
   public Vec3 getPositionVec(float partialTickTime) {
      double offsetY = player.posY + player.getEyeHeight();
      if (partialTickTime == 1.0F) {
         return getWorld().getMinecraftWorld().getWorldVec3Pool().getVecFromPool(player.posX, offsetY, player.posZ);
      } else {
         double var2 = player.prevPosX + (player.posX - player.prevPosX) * partialTickTime;
         double var4 = player.prevPosY + (offsetY - (player.prevPosY + player.getEyeHeight())) * partialTickTime;
         double var6 = player.prevPosZ + (player.posZ - player.prevPosZ) * partialTickTime;
         return getWorld().getMinecraftWorld().getWorldVec3Pool().getVecFromPool(var2, var4, var6);
      }
   }

   /*public String getGameType() { // TODO
   }*/

   /**
    * Sets the gametype that the player uses
    * 
    * @param gametype - The player game type
    * @return True if the specified gametype was found
    */
   public boolean setGameType(String gametype) {
      EnumGameType chosen = null;
      if ((chosen = EnumGameType.getByName(gametype)) == null) {
         return false;
      }
      player.setGameType(chosen);
      return true;
   }

   /**
    * Gets the players name
    * 
    * @return The players name
    */
   public String getPlayerName() {
      return player.getEntityName();
   }

   /**
    * Gets the item ID of the current held item
    * 
    * @return The ID of the currently held item
    */
   public int getCurrentItem() {
      try {
         return player.inventory.mainInventory[getCurrentSlot()].itemID;
      } catch (NullPointerException e) {
         return 0;
      }
   }

   /**
    * Gets the slot number of the current item
    * 
    * @return A value 0-8 based on the slot currently selected
    */
   public int getCurrentSlot() {
      return player.inventory.currentItem;
   }

   /**
    * Sets the URL that the skin is retrieved from
    * 
    * @param URL - The URL the skin is taken from
    */
   public void setSkin(String URL) {
      //TODO: Set username? AbstractClientPlayer - player.skinUrl = URL;
   }

   /**
    * Sets the player's current motion
    * 
    * @param motion - The motion to set to the player
    */
   public void setMotion(Coordinate motion) {
      player.motionX = motion.getX();
      player.motionY = motion.getY();
      player.motionZ = motion.getZ();
   }

   /**
    * Gets the player's current motion
    * 
    * @return The motion of the player
    */
   public Coordinate getMotion() {
      return new Coordinate(player.motionX, player.motionY, player.motionZ);
   }

   /**
    * Checks if the specified position is able to contain a player. This
    * involves two squares at the player's height that are empty and one block
    * beneath the player's feet.
    * 
    * @param player - The player object
    * @param x - The X coordinate
    * @param y - The Y coordinate
    * @param z - The Z coordinate
    * @return True if the player can stand in the specified location
    */
   public boolean isClear(Coordinate location) {
      return getWorld().getBlockId(location.getBlockX(), location.getBlockY(), location.getBlockZ()) == 0
      && getWorld().getBlockId(location.getBlockX(), location.getBlockY() + 1, location.getBlockZ()) == 0
      && !(getWorld().getBlockId(location.getBlockX(), location.getBlockY() - 1, location.getBlockZ()) == 0);
   }

   /**
    * Checks if the specified position is able to contain a player. This
    * involves two squares at the player's height that are empty and one block
    * below the player being empty.
    * 
    * @param player - The player object
    * @param x - The X coordinate
    * @param y - The Y coordinate
    * @param z - The Z coordinate
    * @return True if the player can fall in the specified location
    */
   public boolean isClearBelow(Coordinate location) {
      return getWorld().getBlockId(location.getBlockX(), location.getBlockY(), location.getBlockZ()) == 0
      && getWorld().getBlockId(location.getBlockX(), location.getBlockY() + 1, location.getBlockZ()) == 0
      && getWorld().getBlockId(location.getBlockX(), location.getBlockY() - 1, location.getBlockZ()) == 0;
   }
   
   /**
    * Gets the movement forward. This is a value between -1 and 1. -1 is when
    * the player is moving backward, 1 is that player moving forward. The value
    * of the float is the percentage of speed the player is moving.
    * 
    * @return The movement forward percentage
    */
   public float getMovementForward() {
      if (player instanceof EntityPlayerMP) {
         return ((EntityPlayerMP) player).getMoveForwardField();
      } else if (player instanceof EntityClientPlayerMP) {
         return ((EntityClientPlayerMP) player).getMovementForward();
      } else {
         return 0F;
      }
   }

   /**
    * Gets the movement strafe. This is a value between -1 and 1. -1 is when
    * the player is moving right, 1 is that player moving left. The value
    * of the float is the percentage of speed the player is moving.
    * 
    * @return The movement strafe percentage
    */
   public float getMovementStrafe() {
      if (player instanceof EntityPlayerMP) {
         return ((EntityPlayerMP) player).getMoveStrafingField();
      } else if (player instanceof EntityClientPlayerMP) {
         return ((EntityClientPlayerMP) player).getMovementStrafe();
      } else {
         return 0F;
      }
   }

   /**
    * Sets the player's step height.
    * 
    * @param height - The height of the player's step
    */
   public void setStepHeight(float height) {
      player.stepHeight = height;
   }

   /**
    * Gets the step height of the player
    * 
    * @return Height (in blocks) of the player step height
    */
   public float getStepHeight() {
      return player.stepHeight;
   }

   /**
    * Gets the internal Minecraft player object
    * 
    * @return The Minecraft player object
    */
   public EntityPlayer getMinecraftPlayer() {
      return player;
   }

   /**
    * Removes the specified potion from the player
    * 
    * @param potion - The potion ID to remove
    */
   public void removePotionEffect(int potion) {
      player.removePotionEffect(potion);
   }

   /**
    * Removes all potion effects
    */
   public void removeAllPotionEffects() {
      player.clearActivePotions();
   }

   /**
    * Adds a potion effect to the player
    * 
    * @param id - The ID of the potion
    * @param duration - The duration the potion should run for
    * @param strength - The strength of effect to add
    */
   public void addPotionEffect(int id, int duration, int strength) {
      player.addPotionEffect(new PotionEffect(id, duration, strength));
   }

   /**
    * Changes the dimension that the player is in
    * 
    * @param dimension - The dimension to move the player to
    */
   public void changeDimension(int dimension) {
      player.travelToDimension(dimension);
   }

   /**
    * Sets the quantity of air that the player has
    * 
    * @param air - The quantity of air that the player has
    */
   public void setAir(int air) {
      player.setAir(air);
   }

   /**
    * Gives the specified achievement to the player. Note that this will only
    * work in client mode, server cannot give achievements to the player.
    * 
    * @param name - The name of the achievement
    * @return If the achievement was able to be added to the player
    */
   public boolean addAchievement(String name) {
      if (player instanceof EntityClientPlayerMP) {
         if (Stats.doesAchievementExist(name)) {
            player.triggerAchievement(Stats.getAchievementByName(name));
            return true;
         }
      }
      return false;
   }

   /**
    * Returns true if flying is permitted for the user, false otherwise
    * 
    * @return True if flying is permitted
    */
   public boolean getAllowFlying() {
      return player.capabilities.allowFlying;
   }

   /**
    * Allows and disables Minecraft flying mode
    * 
    * @param allow - True to allow flying, false to disable it
    */
   public void setAllowFlying(boolean allow) {
      player.capabilities.allowFlying = allow;
      player.capabilities.isFlying = allow;
      player.sendPlayerAbilities();
   }

   /**
    * Returns true if the player is currently in creative mode, false if in
    * survival or adventure mode.
    * 
    * @return True is in creative mode, false otherwise.
    */
   public boolean isCreativeMode() {
      return player.capabilities.isCreativeMode;
   }
   
   /**
    * Gets the players username
    * 
    * @return The players username
    */
   public String getUsername() {
      if (player instanceof EntityClientPlayerMP) {
         return ((EntityClientPlayerMP) player).getUsername();
      } else if (player instanceof EntityPlayerMP) {
         ((EntityPlayerMP) player).getUsername();
      }
      return "";
   }
}
import com.sijobe.spc.core.IPlayerMP;
import com.sijobe.spc.validation.Parameter;
import com.sijobe.spc.validation.ParameterInteger;
import com.sijobe.spc.validation.ParameterString;
import com.sijobe.spc.validation.Parameters;
import com.sijobe.spc.wrapper.CommandException;
import com.sijobe.spc.wrapper.CommandSender;
import com.sijobe.spc.wrapper.Coordinate;
import com.sijobe.spc.wrapper.Item;
import com.sijobe.spc.wrapper.Player;
import java.util.HashMap;
import java.util.List;
import net.minecraft.src.MathHelper;
package com.sijobe.spc.command;




/**
 * Creates a path with the specified size.
 *
 * @author q3hardcore
 * @version 1.4
 */
@Command (
   name = "path",
   description = "Creates a path",
   version = "1.4"
)

public class Path extends StandardCommand implements IPlayerMP {

   /**
    * The parameters of the command
    */
   private static final Parameters PARAMETERS = new Parameters (
      new Parameter[] {
         new ParameterString("[BLOCK]",true),
         new ParameterInteger("[RADIUS]",true)