Package com.sijobe.spc.command

Source Code of com.sijobe.spc.command.Heal

package com.sijobe.spc.command;

import com.sijobe.spc.validation.Parameter;
import com.sijobe.spc.validation.ParameterInteger;
import com.sijobe.spc.validation.Parameters;
import com.sijobe.spc.wrapper.CommandSender;
import com.sijobe.spc.wrapper.Player;

import java.util.List;

/**
* Command heals the player the specified number of health
*
* @author simo_415
* @version 1.0
*/
@Command (
   name = "heal",
   description = "Heals a player the specified number of points",
   example = "20",
   videoURL = "http://www.youtube.com/watch?v=h3U8K1DK2bo",
   version = "1.0"
)
public class Heal extends StandardCommand {
   /**
    * Specifies the parameters of the command
    */
   private static final Parameters PARAMETERS = new Parameters (
      new Parameter[] {
         new ParameterInteger("<QUANTITY>",false),
      }
   );

   /**
    * @see com.sijobe.spc.wrapper.CommandBase#execute(net.minecraft.src.ICommandSender, java.util.List)
    */
   @Override
   public void execute(CommandSender sender, List<?> params) {
      Player player = super.getSenderAsPlayer(sender);
      player.heal((Integer)params.get(0));
   }

   /**
    * @see com.sijobe.spc.wrapper.CommandBase#getParameters()
    */
   @Override
   public Parameters getParameters() {
      return PARAMETERS;
   }
}
TOP

Related Classes of com.sijobe.spc.command.Heal

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.