Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean onCommand(Player Player, int fromid, int toid, int radius, String[] cmd)
- {
- if ((cmd[0].equalsIgnoreCase("/drain")) && (Player.canUseCommand("/worldtools"))) {
- int dist = 0;
- if (cmd.length == 2) try { dist = Integer.parseInt(cmd[1]); } catch (Throwable localThrowable) {
- } if (dist == 0) {
- Player.sendMessage("§6#######Drain Help#######");
- Player.sendMessage("§a/drain <radius> - Drain water/lava");
- Player.sendMessage("§a/drainwater <radius> - Drain water");
- Player.sendMessage("§a/drainlava <radius> - Drain lava");
- Player.sendMessage("§a/ext <radius> - Remove fire"); return true;
- }
- int dimension = Player.getLocation().dimension;
- int xmin = (int)Player.getX()-radius;
- int xmax = (int)Player.getX()+radius;
- int ymin = (int)Player.getY()-radius;
- int ymax = (int)Player.getY()+radius;
- int zmin = (int)Player.getZ()-radius;
- int zmax = (int)Player.getZ()+radius;
- for (int x = xmin; x <= xmax; x++) {
- for (int y = ymin; y <= ymax; y++) {
- for (int z = zmin; z <= zmax; z++) {
- if (Player.getWorld().getBlockAt(x, y, z).getType() == 8){Player.getWorld().setBlockAt(0, x, y, z);}
- if (Player.getWorld().getBlockAt(x, y, z).getType() == 9){Player.getWorld().setBlockAt(0, x, y, z);}
- if (Player.getWorld().getBlockAt(x, y, z).getType() == 10){Player.getWorld().setBlockAt(0, x, y, z);}
- if (Player.getWorld().getBlockAt(x, y, z).getType() == 11){Player.getWorld().setBlockAt(0, x, y, z);}
- }
- }
- }
- return true;
- }
- return false;
- }
Add Comment
Please, Sign In to add comment