Exemplo n.º 1
0
 public List<Block> getBlocks() {
   List<Block> blocks = new ArrayList<Block>();
   if (loc1 == null || loc2 == null) return blocks;
   for (int x = (int) Math.min(loc1.getX(), loc2.getX());
       x <= (int) Math.max(loc1.getX(), loc2.getX());
       x++) {
     for (int y = (int) Math.min(loc1.getY(), loc2.getY());
         y <= (int) Math.max(loc1.getY(), loc2.getY());
         y++) {
       for (int z = (int) Math.min(loc1.getZ(), loc2.getZ());
           z <= (int) Math.max(loc1.getZ(), loc2.getZ());
           z++) {
         if (loc1.getWorld().getBlockAt(x, y, z).getType() == Material.AIR) {
           blocks.add(loc1.getWorld().getBlockAt(x, y, z));
         }
       }
     }
   }
   return blocks;
 }
Exemplo n.º 2
0
 @Override
 public List<Player> matchPlayer(String string) {
   List<Player> matches = new ArrayList<Player>();
   for (Player player : players) {
     if (player
         .getName()
         .substring(0, Math.min(player.getName().length(), string.length()))
         .equalsIgnoreCase(string)) {
       matches.add(player);
     }
   }
   return matches;
 }
Exemplo n.º 3
0
 public static void addSeconds(final Player player, final int seconds) {
   if (!b******g.fdsjfhkdsjfdsjhk().getServerHandler().isEOTW()
       && DTRBitmaskType.SAFE_ZONE.appliesAt(player.getLocation())) {
     return;
   }
   if (isTagged(player)) {
     final int secondsTaggedFor =
         (int)
             ((SpawnTagHandler.spawnTags.get(player.getName()) - System.currentTimeMillis())
                 / 1000L);
     final int newSeconds = Math.min(secondsTaggedFor + seconds, 60);
     SpawnTagHandler.spawnTags.put(
         player.getName(), System.currentTimeMillis() + newSeconds * 1000L);
   } else {
     player.sendMessage(
         ChatColor.YELLOW + "You have been spawn-tagged for §c" + seconds + " §eseconds!");
     SpawnTagHandler.spawnTags.put(player.getName(), System.currentTimeMillis() + seconds * 1000L);
   }
 }
Exemplo n.º 4
0
 @Override
 public void setMaxHealth(double amount) {
   super.setMaxHealth(amount);
   this.health = Math.min(this.health, health);
   getHandle().func_71118_n();
 }