Package com.sijobe.spc.wrapper

Examples of com.sijobe.spc.wrapper.Player


   /**
    * @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);
      World world = player.getWorld();
      if (params.size() > 0) {
         world.setHardcore((Boolean)params.get(0));
      } else {
         world.setHardcore(!world.isHardcore());
      }
      player.sendChatMessage("Hardcore mode was " +
               FontColour.AQUA + (world.isHardcore() ? "enabled" : "disabled"));
   }
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);
      player.heal((Integer)params.get(0));
   }
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);
      double radius = 128.0D;
      String entityType = "mob";
      if(params.size() > 0) {
         entityType = (String)params.get(0);
         if(Entity.getEntityClass(entityType) == null) {
            try {
               radius = Double.parseDouble((String)params.get(0));
               sender.sendMessageToPlayer("Setting radius to: " + radius);
               entityType = "mob";
            } catch (NumberFormatException nfe) {
               throw new CommandException("Unknown entity specified.");
            }
         }
         if(params.size() > 1) {
            radius = (Integer)params.get(1);
         }
      }
      if(radius <=0 || radius > 256) {
         throw new CommandException("Radius should be between 0 and 256.");
      }
      List<net.minecraft.src.Entity> removedEntities =
         Entity.killEntities(entityType, player.getPosition(), player.getWorld(), radius);
      sender.sendMessageToPlayer(removedEntities.size() + " entity(s) removed.");
   }
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 = super.getSenderAsPlayer(sender); // Why super.? Meh, Cannon has it like that
      Player clientPlayer = Minecraft.getPlayer();
     
      if(clientPlayer == null) {
         throw new CommandException("No client player!");
      }
     
      World clientWorld = clientPlayer.getWorld();
     
      if(player.getWorld().getMinecraftWorld().hashCode() != litWorld) {
         isLit = false;
      }
     
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) {
      Player player = getSenderAsPlayer(sender);
      Coordinate previous = player.getPosition();
      int y = previous.getBlockY() - 1;
      while (y > 0) {
         if (player.isClear(new Coordinate(previous.getBlockX(), y--, previous.getBlockZ()))) {
            player.setPosition(new Coordinate(previous.getBlockX() + 0.5F, ++y, previous.getBlockZ() + 0.5F));
            player.sendChatMessage("You descended " + FontColour.AQUA + (previous.getBlockY() - y) +
                     FontColour.WHITE + " blocks.");
            break;
         }
      }
   }
View Full Code Here

      return Minecraft.isSinglePlayer();
   }

   @Override
   public void execute(CommandSender sender, List<?> params) throws CommandException {
      Player player = CommandBase.getSenderAsPlayer(sender);
      if (params.size() == 0) {
         removeDrops ^= true;
      } else {
         removeDrops = ((Boolean)params.get(0));
      }
      player.sendChatMessage("Do mob and block drops? " + !removeDrops);
   }
View Full Code Here

  }

  @Override
  public void execute(CommandSender sender, List<?> params)
      throws CommandException {
    Player player = Minecraft.getPlayer();
    if (player.getStepHeight() != 0.5F) {
      player.setStepHeight(0.5F);
      sender.sendMessageToPlayer("Longer legs is "+FontColour.AQUA+"disabled");
    } else {
      player.setStepHeight(1.0F);
      sender.sendMessageToPlayer("Longer legs is "+FontColour.AQUA+"enabled");
    }
  }
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 {
      String argument = (String)params.get(0);
      Player player = super.getSenderAsPlayer(sender);
      World world = player.getWorld();
      if (argument.equalsIgnoreCase("rain")) {
         // Toggles rain on/off
         boolean rain = !world.isRaining();
         if (params.size() > 1) {
            rain = (Boolean)params.get(1);
         }
         world.setRaining(rain);
         sender.sendMessageToPlayer("Rain was " + FontColour.AQUA + (rain ? "enabled" : "disabled"));
      } else if (argument.equalsIgnoreCase("thunder")) {
         // Toggles thunder storms on/off (changes rain too)
         boolean thunder = !world.isThunder();
         if (params.size() > 1) {
            thunder = (Boolean)params.get(1);
         }
         world.setThunder(thunder);
         world.setRaining(thunder);
         sender.sendMessageToPlayer("Thunder was " + FontColour.AQUA + (thunder ? "enabled" : "disabled"));
      } else if (argument.equalsIgnoreCase("lightning")) {
         Coordinate coordinate = player.trace(128.0);
         if (coordinate == null) {
            return;
         }
         world.useLightning(coordinate);
      } else {
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 = super.getSenderAsPlayer(sender);
      String value = null;
      if (params.size() != 0) {
         value = (String)params.get(0);
         try {
            int integer = Integer.parseInt(value);
            switch (integer) {
               case 0:
                  value = "survival";
                  break;
               case 1:
                  value = "creative";
                  break;
               case 2:
                  value = "adventure";
                  break;
               default:
                  throw new CommandException("Unknown gamemode type.");
            }
         } catch (Exception e) {
         }
      } else {
         if (player.isCreativeMode()) {
            value = "survival";
         } else {
            value = "creative";
         }
      }
     
      if (!player.setGameType(value)) {
         throw new CommandException("Unknown gamemode type");
      }
     
      sender.sendMessageToPlayer("Gamemode changed to " + FontColour.AQUA + value);
   }
View Full Code Here

)
public class ClearDrops extends StandardCommand {

   @Override
   public void execute(CommandSender sender, List<?> params) throws CommandException {
      Player player = CommandBase.getSenderAsPlayer(sender);
      int removedDrops = removeItemDrops(player, 128);
      player.sendChatMessage("Cleared " + removedDrops + " item drop(s).");
   }
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.