Skip to content

Commit

Permalink
fix some obtuse code in events (entity-npc conversion)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 20, 2019
1 parent bd9af16 commit a49f134
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -139,7 +139,7 @@ public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) {
@Override
public ScriptEntryData getScriptEntryData() {
return new BukkitScriptEntryData(damager != null && damager.isPlayer() ? damager.getDenizenPlayer() : entity.isPlayer() ? entity.getDenizenPlayer() : null,
damager != null && damager.isCitizensNPC() ? damager.getDenizenNPC() : entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null);
damager != null && damager.isCitizensNPC() ? damager.getDenizenNPC() : entity.isCitizensNPC() ? entity.getDenizenNPC() : null);
}

@Override
Expand Down
Expand Up @@ -134,9 +134,9 @@ public ScriptEntryData getScriptEntryData() {
if (damager != null && player == null && damager.isPlayer()) {
player = EntityTag.getPlayerFrom(damager.getBukkitEntity());
}
NPCTag npc = entity.isCitizensNPC() ? EntityTag.getNPCFrom(event.getEntity()) : null;
NPCTag npc = entity.isCitizensNPC() ? entity.getDenizenNPC() : null;
if (damager != null && npc == null && damager.isCitizensNPC()) {
npc = EntityTag.getNPCFrom(damager.getBukkitEntity());
npc = damager.getDenizenNPC();
}
return new BukkitScriptEntryData(player, npc);
}
Expand Down

0 comments on commit a49f134

Please sign in to comment.