SHARE
TWEET

Untitled

a guest Jun 12th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NE_PACHYAT_RUKI(Level.MEDIUM, true, AchievementData.Achievement.BW_NE_PACHYAT_RUKI) {
  2.         @Override
  3.         public Listener getListener(Achievement achievement) {
  4.             return new Listener() {
  5.  
  6.                 @EventHandler
  7.                 public void event(EntityExplodeEvent e) {
  8.  
  9.                     Bukkit.broadcastMessage("EntityExplodeEvent");
  10.  
  11.                     if (e.getEntityType() != EntityType.PRIMED_TNT) return;
  12.  
  13.                     Player player = Bukkit.getPlayer(e.getEntity().getMetadata(Config.EXPLODE_PLACER_METADATA).get(0).asString());
  14.  
  15.                     if (player == null) return;
  16.  
  17.                     boolean isBed = false;
  18.  
  19.                     for (Block block : e.blockList()) {
  20.                         if (block.getType() != Material.BED_BLOCK) continue;
  21.                         isBed = true;
  22.                         break;
  23.                     }
  24.  
  25.                     if (!isBed) return;
  26.  
  27.                     AchievementData achievementData = PlayerClass.playersMap.get(player.getName()).getAchievementsMap().get(achievement.getStorageAchievement());
  28.  
  29.                     if (achievementData.isCompleted()) return;
  30.  
  31.                     Bukkit.getPluginManager().callEvent(new AchievementCompletedEvent(player, achievement, achievementData));
  32.                 }
  33.             };
  34.         }
  35.  
  36.         @Override
  37.         public ItemStack getIcon(AchievementData achievementData, Achievement achievement) {
  38.             return AchievementConfig.getConfig(achievement).getIcon(achievementData).getStack();
  39.         }
  40.     },
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