Package com.sijobe.spc.wrapper

Examples of com.sijobe.spc.wrapper.World


      }
   );

   @Override
   public void execute(CommandSender sender, List<?> params) throws CommandException {
      World world = super.getSenderAsPlayer(sender).getWorld();
      if (params.size() == 0) { // Gets the current time
      } else if (((String)params.get(0)).equalsIgnoreCase("day")) {
         setCurrentTime(world,TIME_DAY);
      } else if (((String)params.get(0)).equalsIgnoreCase("night")) {
         setCurrentTime(world,TIME_NIGHT);
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 {
      World world = super.getSenderAsPlayer(sender).getWorld();
      if (params.size() > 0) {
         world.setDifficulty((Integer)params.get(0));
      } else {
         world.setDifficulty((world.getDifficulty() + 1) % 4);
      }
      String difficulty = "";
      switch (world.getDifficulty()) {
         case 0:
            difficulty = FontColour.GREEN + "peaceful";
            break;
         case 1:
            difficulty = FontColour.YELLOW + "easy";
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);
      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

     
      if(clientPlayer == null) {
         throw new CommandException("No client player!");
      }
     
      World clientWorld = clientPlayer.getWorld();
     
      if(player.getWorld().getMinecraftWorld().hashCode() != litWorld) {
         isLit = false;
      }
     
      // Note: provider is worldProvider
      if(!isLit) {
         sender.sendMessageToPlayer("Lighting world");
         float[] lightBrightnessTable = clientWorld.getMinecraftWorld().provider.lightBrightnessTable;
         for(int i = 0; i < lightBrightnessTable.length; i++) {
            lightBrightnessTable[i] = 1.0F;
         }
         litWorld = player.getWorld().getMinecraftWorld().hashCode(); // we go by the serverside hashcode
      } else {
         sender.sendMessageToPlayer("Restoring light levels");
         clientWorld.getMinecraftWorld().provider.registerWorld(clientWorld.getMinecraftWorld());
      }
      isLit = !isLit; // toggle isLit
   }
View Full Code Here

    */
   @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 {
         sender.sendMessageToPlayer("The " + argument + " command is currently unavailable.");
      }
   }
View Full Code Here

TOP

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

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.