Exemplo n.º 1
0
 public void broadcastMSG(String perm, Object... s) {
   for (Player p : Bukkit.getOnlinePlayers())
     if (p.hasPermission(permprefix + perm)) printMSG(p, s);
 }
Exemplo n.º 2
0
 public void broadcastMsg(String perm, String msg) {
   for (Player p : Bukkit.getOnlinePlayers())
     if (p.hasPermission(permprefix + perm)) printMsg(p, msg);
 }
Exemplo n.º 3
0
  public void disableRocketBoots(
      Player player,
      Boolean keepUsage,
      Boolean keepPower,
      Boolean keepFlight,
      Boolean keepVariant,
      Boolean keepEnhancement) {

    UUID playerUUID = player.getUniqueId();

    if (!keepUsage && RocketInit.rocketUsage.contains(playerUUID))
      RocketInit.rocketUsage.remove(playerUUID);

    if (RocketInit.rocketSprint.containsKey(playerUUID)) RocketInit.rocketSprint.remove(playerUUID);

    if (!keepPower && RocketInit.rocketPower.containsKey(playerUUID))
      RocketInit.rocketPower.remove(playerUUID);

    if (!RocketInit.rocketFire.isEmpty()) RocketInit.rocketFire.clear();

    if (RocketInit.rocketWater.contains(playerUUID)) RocketInit.rocketWater.remove(playerUUID);

    if (RocketInit.rocketRepair.containsKey(playerUUID)) RocketInit.rocketRepair.remove(playerUUID);

    if (!keepEnhancement && RocketInit.rocketEnhancement.containsKey(playerUUID))
      RocketInit.rocketEnhancement.remove(playerUUID);

    if (!keepVariant && RocketInit.rocketVariant.containsKey(playerUUID)) {

      switch (RocketInit.rocketVariant.get(playerUUID)) {
        case ENDER:
          player.removePotionEffect(PotionEffectType.NIGHT_VISION);
          player.removePotionEffect(PotionEffectType.HEALTH_BOOST);
          break;

        case ZERO:
          player.removePotionEffect(PotionEffectType.CONFUSION);
          player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
          player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
          break;

        case STEALTH:
          for (Player onlinePlayer : Bukkit.getOnlinePlayers()) onlinePlayer.showPlayer(player);
          break;

        case DRUNK:
          player.removePotionEffect(PotionEffectType.CONFUSION);
          player.removePotionEffect(PotionEffectType.FAST_DIGGING);
          break;

        case BOOST:
          player.removePotionEffect(PotionEffectType.HEAL);
          break;

        case RUNNER:
          player.removePotionEffect(PotionEffectType.SPEED);
          break;
      }

      RocketInit.rocketVariant.remove(playerUUID);
    }

    if (player.isOnline() && gamemodeCheck.check(player, GameMode.SURVIVAL, GameMode.ADVENTURE)) {

      for (Player onlinePlayer : Bukkit.getOnlinePlayers()) onlinePlayer.showPlayer(player);

      player.setFlySpeed(0.1f);
      player.setFlying(false);
      if (!keepFlight) player.setAllowFlight(false);

      player.setNoDamageTicks(100);
      player.setFallDistance(0);
    }
  }