Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dragonkk.rs2rsps.net.commands;
- import dragonkk.rs2rsps.model.player.Player;
- import dragonkk.rs2rsps.net.Command;
- public class Hair implements Command {
- private byte[] style;
- private byte[] colour;
- /* (non-Javadoc)
- * @see dragonkk.rs2rsps.net.Command#execute(java.lang.String[], dragonkk.rs2rsps.model.player.Player)
- */
- @Override
- public void execute(String[] args, Player player) {
- if (args[1] == "style") {
- if (args[2] == null) {
- player.getFrames().sendChatMessage(0, "Please select a number between 1 and 25.");
- } else if (Integer.parseInt(args[2]) > 25) {
- player.getFrames().sendChatMessage(0, "Please choose a number between 1 and 25.");
- } else if (Integer.parseInt(args[2]) < 1) {
- player.getFrames().sendChatMessage(0, "Please choose a number between 1 and 25.");
- } else {
- player.getMask().setApperanceUpdate(true);
- player.getAppearence().setLook(new byte[7]);
- style[0] = (byte) Integer.parseInt(args[1]);
- //TODO make it save the file
- }
- } else if (args[1] == "color") {
- if (args[2] == null) {
- player.getFrames().sendChatMessage(0, "Please select a number between 1 and 25.");
- } else if (Integer.parseInt(args[2]) > 25) {
- player.getFrames().sendChatMessage(0, "Please choose a number between 1 and 25.");
- } else if (Integer.parseInt(args[2]) < 1) {
- player.getFrames().sendChatMessage(0, "Please choose a number between 1 and 25.");
- } else {
- player.getAppearence().setColour(new byte[5]);
- colour[0] = (byte) Integer.parseInt(args[2]);
- player.getMask().setApperanceUpdate(true);
- }
- } else {
- player.getFrames().sendChatMessage(0, "Please select \"style\" or \"color\".");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement