Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main extends JavaPlugin{
- private Laser laser;
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (cmd.getName().equalsIgnoreCase("Laserset")) {
- if(!(sender.hasPermission("GuardianLaser.set"))) {
- sender.sendMessage("You do not have permission to use this command (GuardianLaser.set)");
- } else {
- if(args.length != 8) {
- if(args.length < 8) sender.sendMessage("Not enough arguments. usage: /laserset x1 y1 z1 x2 y2 z2 world Duration(InTicks) ViewDistance");
- if (args.length > 9) sender.sendMessage("Too many arguments. usage: /laserset x1 y1 z1 x2 y2 z2 world Duration(InTicks) ViewDistance");
- } else {
- Location loc1 = new Location(Bukkit.getWorld(args[6]), Double.parseDouble(args[0]),Double.parseDouble(args[1]),Double.parseDouble(args[2]));
- Location loc2 = new Location(Bukkit.getWorld(args[6]), Double.parseDouble(args[3]),Double.parseDouble(args[4]),Double.parseDouble(args[5]));
- try {
- this.laser = new Laser(loc1, loc2, Integer.parseInt(args[7]), Integer.parseInt(args[8]));
- this.laser.start(Main.this);
- } catch (ReflectiveOperationException e) {
- e.printStackTrace();
- sender.sendMessage("there was a ReflectiveOperationException!");
- }
- } return false;
- }
- if (cmd.getName().equalsIgnoreCase("Laserstop")) {
- if(sender.hasPermission("GuardianLaser.stop")){
- this.laser.stop();
- }
- }
- return true;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement