Exemplo n.º 1
0
 public Construct exec(Target t, Env environment, Construct... args)
     throws ConfigRuntimeException {
   int x;
   int z;
   MCWorld w;
   if (args.length == 2) {
     MCWorld defaultWorld =
         environment.GetPlayer() == null ? null : environment.GetPlayer().getWorld();
     MCLocation l = ObjectGenerator.GetGenerator().location(args[0], defaultWorld, t);
     x = l.getBlockX();
     z = l.getBlockZ();
     w = l.getWorld();
   } else {
     x = (int) Static.getInt(args[0]);
     z = (int) Static.getInt(args[1]);
     if (args.length == 3) {
       w = environment.GetPlayer().getWorld();
     } else {
       w = Static.getServer().getWorld(args[2].val());
     }
   }
   MCBiomeType bt;
   try {
     bt = MCBiomeType.valueOf(args[args.length - 1].val());
   } catch (IllegalArgumentException e) {
     throw new ConfigRuntimeException(
         "The biome type \"" + args[1].val() + "\" does not exist.",
         ExceptionType.FormatException,
         t);
   }
   w.setBiome(x, z, bt);
   return new CVoid(t);
 }
Exemplo n.º 2
0
 public Construct exec(Target t, Env environment, Construct... args)
     throws ConfigRuntimeException {
   int x;
   int z;
   MCWorld w;
   if (args.length == 1) {
     MCWorld defaultWorld =
         environment.GetPlayer() == null ? null : environment.GetPlayer().getWorld();
     MCLocation l = ObjectGenerator.GetGenerator().location(args[0], defaultWorld, t);
     x = l.getBlockX();
     z = l.getBlockZ();
     w = l.getWorld();
   } else {
     x = (int) Static.getInt(args[0]);
     z = (int) Static.getInt(args[1]);
     if (args.length == 2) {
       w = environment.GetPlayer().getWorld();
     } else {
       w = Static.getServer().getWorld(args[2].val());
     }
   }
   MCBiomeType bt = w.getBiome(x, z);
   return new CString(bt.name(), t);
 }
Exemplo n.º 3
0
 public String docs() {
   return "string {x, z, [world] | locationArray} Returns the biome type of this block column. The location array's"
       + " y value is ignored. The value returned"
       + " may be one of the following: "
       + StringUtil.joinString(MCBiomeType.values(), ", ", 0);
 }
Exemplo n.º 4
0
 public String docs() {
   return "void {x, z, [world], biome | locationArray, biome} Sets the biome of the specified block column."
       + " The location array's y value is ignored."
       + " Biome may be one of the following: "
       + StringUtil.joinString(MCBiomeType.values(), ", ", 0);
 }