Package com.sijobe.spc.wrapper

Examples of com.sijobe.spc.wrapper.Player


   /**
    * @see com.sijobe.spc.wrapper.CommandBase#execute(com.sijobe.spc.wrapper.CommandSender, java.util.List)
    */
   @Override
   public void execute(CommandSender sender, List<?> params) throws CommandException {
      Player player = getSenderAsPlayer(sender);
      if (params.size() == 0) {
         player.getWorld().createExplosion(player, player.getPosition(), DEFAULT_SIZE);
      } else if (params.size() == 1) {
         player.getWorld().createExplosion(player, player.getPosition(), (Integer)params.get(0));
      } else if (params.size() > 3) {
         Coordinate location = new Coordinate((Double)params.get(1), (Double)params.get(2), (Double)params.get(3));
         player.getWorld().createExplosion(player, location, (Integer)params.get(0));
      }
      sender.sendMessageToPlayer("Boom!");
   }
View Full Code Here


    * @see com.sijobe.spc.wrapper.CommandBase#execute(net.minecraft.src.ICommandSender, java.util.List)
    */
   @Override
   public void execute(CommandSender sender, List<?> params) {
      String action = (String)params.get(0);
      Player player = super.getSenderAsPlayer(sender);
      if (action.equalsIgnoreCase("min")) {
         player.setHealth(1);
      } else if (action.equalsIgnoreCase("max")) {
         player.setHealth(20);
      } else if (action.equalsIgnoreCase("infinite")) {
         player.setHealth(Short.MAX_VALUE);
      }
      player.sendChatMessage("Your health is " + FontColour.AQUA + player.getHealth());
   }
View Full Code Here

   /**
    * @see com.sijobe.spc.wrapper.CommandBase#execute(com.sijobe.spc.wrapper.CommandSender, java.util.List)
    */
   @Override
   public void execute(CommandSender sender, List<?> params) throws CommandException {
      Player player = getSenderAsPlayer(sender);
      player.setPosition(player.getWorld().getSpawn());
   }
View Full Code Here

    return Minecraft.isSinglePlayer();
  }

   @Override
   public void execute(CommandSender sender, List<?> params) throws CommandException {
      Player player = CommandBase.getSenderAsPlayer(sender);
      Settings config = super.loadSettings(player);
      boolean prefixSlash = config.getBoolean("prefixSlash", true);
      if (params.size() == 0) {
         prefixSlash ^= true;
      } else {
         prefixSlash = ((Boolean)params.get(0));
      }
      config.set("prefixSlash", prefixSlash);
      super.saveSettings(player);
      player.sendChatMessage("Slash prefixing is now " + FontColour.AQUA
               + (prefixSlash ? "enabled" : "disabled"));
   }
View Full Code Here

   /**
    * @see com.sijobe.spc.wrapper.CommandBase#execute(com.sijobe.spc.wrapper.CommandSender, java.util.List)
    */
   @Override
   public void execute(CommandSender sender, List<?> params) throws CommandException {
      Player player = getSenderAsPlayer(sender);
      Coordinate hit = player.trace(128);
      if (hit == null) {
         throw new CommandException("No block in sight.");
      }
      int y = hit.getBlockY() + 1;
      while (y < 260) {
         if (player.isClear(new Coordinate(hit.getBlockX(), y++, hit.getBlockZ()))) {
            player.setPosition(new Coordinate(hit.getBlockX() + 0.5F, --y, hit.getBlockZ() + 0.5F));
            break;
         }
      }
   }
View Full Code Here

   /**
    * @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);
      if (params.size() > 0) {
         player.setDamage((Boolean)params.get(0));
      } else {
         player.setDamage(!player.getDamage());
      }
      player.sendChatMessage("Player damage was " +
               FontColour.AQUA + (player.getDamage() ? "enabled" : "disabled"));
   }
View Full Code Here

    return !ForgeHelper.HAS_FORGE;
  }

   @Override
   public void execute(CommandSender sender, List<?> params) throws CommandException {
      Player player = super.getSenderAsPlayer(sender);
      if(player.getMinecraftPlayer() instanceof EntityPlayerMP) {
         Settings config = super.loadSettings(player);
         boolean instantMine = config.getBoolean("instantMine", false);
         if (params.size() == 0) {
            instantMine ^= true;
         } else {
            instantMine = ((Boolean)params.get(0));
         }
         config.set("instantMine", instantMine);
         super.saveSettings(player);
         player.sendChatMessage("Instant mining " + (instantMine?"enabled.":"disabled."));
      } else {
         throw new CommandException("Non-client command");
      }
   }
View Full Code Here

TOP

Related Classes of com.sijobe.spc.wrapper.Player

Copyright © 2018 www.massapicom. 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.