예제 #1
0
 @EventHandler
 public void onWoolPlace(ObjectiveCompleteEvent event) {
   if (event.getObjective().equals(this) && event.getObjective().showOnScoreboard()) {
     Bukkit.getServer()
         .getPluginManager()
         .callEvent(
             new SnowflakeChangeEvent(
                 event.getPlayer(),
                 Snowflakes.ChangeReason.WOOL_PLACE,
                 15,
                 MiscUtil.convertDyeColorToChatColor(color)
                     + name.toUpperCase().replaceAll("_", " ")
                     + ChatColor.GRAY));
   }
 }
예제 #2
0
 @EventHandler
 public void onMonumentDestroy(ObjectiveCompleteEvent event) {
   if (event.getObjective().equals(this)) {
     for (UUID player : playersCompleted.keySet()) {
       if (Bukkit.getOfflinePlayer(player).isOnline()) {
         Bukkit.getServer()
             .getPluginManager()
             .callEvent(
                 new SnowflakeChangeEvent(
                     Bukkit.getPlayer(player),
                     Snowflakes.ChangeReason.MONUMENT_DESTROY,
                     getPercentFromAmount(playersCompleted.get(player)) / 10,
                     ChatColor.GREEN
                         + ""
                         + getPercentFromAmount(playersCompleted.get(player))
                         + ChatColor.GRAY,
                     ChatColor.GREEN + name + ChatColor.GRAY));
       }
     }
   }
 }