Package com.sijobe.spc.command

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

package com.sijobe.spc.command;

import java.util.List;

import com.sijobe.spc.wrapper.CommandException;
import com.sijobe.spc.wrapper.CommandSender;
import com.sijobe.spc.wrapper.Coordinate;
import com.sijobe.spc.wrapper.Entity;
import com.sijobe.spc.wrapper.Player;

/**
* Creates an endercrystal where the player is pointing
*
* @author simo_415
* @version 1.0
*/
@Command (
   name = "endercrystal",
   description = "Creates an Ender Crystal where the player is pointing",
   example = "",
   videoURL = "", // TODO
   version = "1.4.6"
)
public class EnderCrystal extends StandardCommand {

  @Override
  public void execute(CommandSender sender, List<?> params)
      throws CommandException {
    Player player = super.getSenderAsPlayer(sender);
    Coordinate c = player.trace(128D);
    if (c == null) {
      throw new CommandException("No block within range.");
    }
   
    Entity.spawnEntity("EnderCrystal", c, player.getWorld());
  }
}
TOP

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

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.