Advertisement
Guest User

Untitled

a guest
Sep 11th, 2011
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.71 KB | None | 0 0
  1. package dragonkk.rs2rsps.net.commands;
  2.  
  3. import dragonkk.rs2rsps.model.player.Player;
  4. import dragonkk.rs2rsps.net.Command;
  5.  
  6. public class Hair implements Command {
  7.    
  8.     private byte[] style;
  9.     private byte[] colour;
  10.    
  11.     /* (non-Javadoc)
  12.      * @see dragonkk.rs2rsps.net.Command#execute(java.lang.String[], dragonkk.rs2rsps.model.player.Player)
  13.      */
  14.     @Override
  15.     public void execute(String[] args, Player player) {
  16.         if (args[1] == "style") {
  17.             if (args[2] == null) {
  18.                 player.getFrames().sendChatMessage(0, "Please select a number between 1 and 25.");
  19.             } else if (Integer.parseInt(args[2]) > 25) {
  20.                 player.getFrames().sendChatMessage(0, "Please choose a number between 1 and 25.");
  21.             } else if (Integer.parseInt(args[2]) < 1) {
  22.                 player.getFrames().sendChatMessage(0, "Please choose a number between 1 and 25.");
  23.             } else {
  24.                 player.getMask().setApperanceUpdate(true);
  25.                 player.getAppearence().setLook(new byte[7]);
  26.                 style[0] = (byte) Integer.parseInt(args[1]);
  27.                 //TODO make it save the file
  28.             }
  29.         } else if (args[1] == "color") {
  30.             if (args[2] == null) {
  31.                 player.getFrames().sendChatMessage(0, "Please select a number between 1 and 25.");
  32.             } else if (Integer.parseInt(args[2]) > 25) {
  33.                 player.getFrames().sendChatMessage(0, "Please choose a number between 1 and 25.");
  34.             } else if (Integer.parseInt(args[2]) < 1) {
  35.                 player.getFrames().sendChatMessage(0, "Please choose a number between 1 and 25.");
  36.             } else {
  37.                 player.getAppearence().setColour(new byte[5]);
  38.                 colour[0] = (byte) Integer.parseInt(args[2]);
  39.                 player.getMask().setApperanceUpdate(true);
  40.             }
  41.         } else {
  42.             player.getFrames().sendChatMessage(0, "Please select \"style\" or \"color\".");
  43.         }
  44.     }
  45.    
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement