daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Feb 23rd, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class ClearItemsRunnable implements Runnable {
  2.     @Override
  3.     public void run() {
  4.         if (Bukkit.getOnlinePlayers().size() != 0) {
  5.             for (Player player : Bukkit.getOnlinePlayers()) {
  6.                 PlayerData playerData = PlayerDataManager.get(player.getUniqueId());
  7.                 if (playerData.isChatManage_joinMsg()) {
  8.                     player.sendMessage(ChatUtil.color("&8[&6BayHard&8] &cZa: &615s &codbedzie sie czyszczenie przedmiotow z ziemi!"));
  9.                 }
  10.             }
  11.             Bukkit.getScheduler().runTaskLater(Main.getInstance(), () -> {
  12.                 World world = Bukkit.getWorlds().get(0);
  13.                 for (Entity entity : world.getEntities()) {
  14.                     if (entity.getType() == EntityType.DROPPED_ITEM || entity.getType() == EntityType.ZOMBIE) {
  15.                         entity.remove();
  16.                     }
  17.                 }
  18.                 for (Player player : Bukkit.getOnlinePlayers()) {
  19.                     PlayerData playerData = PlayerDataManager.get(player.getUniqueId());
  20.                     if (playerData.isChatManage_joinMsg()) {
  21.                         player.sendMessage(ChatUtil.color("&8[&6BayHard&8] &cWyczyszczono: &6" + world.getEntities().size() + " &cprzedmiotow z ziemi!"));
  22.                     }
  23.                 }
  24.             }, (long) TimeUtil.SECOND.getTick(15));
  25.         }
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top