Skip to content

Commit

Permalink
Use current hologram data for ServerNPC task types
Browse files Browse the repository at this point in the history
  • Loading branch information
Krakenied authored and LMBishop committed Feb 18, 2024
1 parent 0229544 commit 604537b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
Binary file modified bukkit/libs/ServerNPC-1.16.1-b1.jar
Binary file not shown.
Expand Up @@ -28,11 +28,17 @@ public void onNPCInteract(NPCInteractEvent event) {
}

SnakeNPC npc = event.getSnakeNPC();
SnakeHologram hologram = npc.getHologram();
List<String> hologramLines = hologram.getLines();
String name = !hologramLines.isEmpty()
? String.join("\n", hologramLines)
: null;
SnakeHologram hologram = npc.getSettings().getHologram();
String name;

if (hologram != null) {
List<String> hologramLines = hologram.getLines();
name = !hologramLines.isEmpty()
? String.join("\n", hologramLines)
: null;
} else {
name = null;
}

checkInventory(event.getPlayer(), npc.getName(), name, 1L, plugin);
}
Expand Down
Expand Up @@ -28,11 +28,17 @@ public void onNPCInteract(NPCInteractEvent event) {
}

SnakeNPC npc = event.getSnakeNPC();
SnakeHologram hologram = npc.getHologram();
List<String> hologramLines = hologram.getLines();
String name = !hologramLines.isEmpty()
? String.join("\n", hologramLines)
: null;
SnakeHologram hologram = npc.getSettings().getHologram();
String name;

if (hologram != null) {
List<String> hologramLines = hologram.getLines();
name = !hologramLines.isEmpty()
? String.join("\n", hologramLines)
: null;
} else {
name = null;
}

handle(event.getPlayer(), npc.getName(), name, plugin);
}
Expand Down

0 comments on commit 604537b

Please sign in to comment.