Skip to content

Commit

Permalink
Log boss and dragon deaths.
Browse files Browse the repository at this point in the history
  • Loading branch information
totemo committed May 8, 2020
1 parent 38ce072 commit 0eb255b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/nu/nerd/df/FightState.java
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,8 @@ protected void onEntityDeath(EntityDeathEvent event) {
boolean bossDied = DragonUtil.hasTagOrGroup(entity, BOSS_TAG);
if (bossDied) {
_bosses.remove(entity);
MobType bossMobType = BeastMaster.getMobType(entity);
log("Boss died: " + bossMobType.getId());
}

if (_stageNumber != 0 && bossDied && _bosses.isEmpty()) {
Expand Down Expand Up @@ -1115,6 +1117,8 @@ protected void onDragonSpawn(EnderDragon dragon) {
* @param playerUuid the UUID of the player to be awarded the drops.
*/
protected void onDragonDeath(UUID playerUuid) {
log("The dragon died.");

// Bukkit.getOfflinePlayer() NEVER returns null, even for non-existent.
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(playerUuid);
getNearbyPlayers().forEach(p -> p.sendMessage(ChatColor.LIGHT_PURPLE + offlinePlayer.getName() +
Expand Down

0 comments on commit 0eb255b

Please sign in to comment.