Skip to content

Commit

Permalink
Use getBlockData for path debug
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Feb 14, 2021
1 parent 2676e35 commit 8a7a1f4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/java/net/citizensnpcs/api/astar/pathfinder/Path.java
Expand Up @@ -54,7 +54,11 @@ private PathEntry[] cull(Iterable<VectorNode> unfiltered) {
public void debug() {
for (Player player : Bukkit.getOnlinePlayers()) {
for (PathEntry entry : path) {
player.sendBlockChange(entry.vector.toLocation(player.getWorld()), YELLOW_FLOWER, (byte) 0);
if (SpigotUtil.isUsing1_13API()) {
player.sendBlockChange(entry.vector.toLocation(player.getWorld()), YELLOW_FLOWER.createBlockData());
} else {
player.sendBlockChange(entry.vector.toLocation(player.getWorld()), YELLOW_FLOWER, (byte) 0);
}
}
}
}
Expand All @@ -63,7 +67,11 @@ public void debugEnd() {
for (Player player : Bukkit.getOnlinePlayers()) {
for (PathEntry entry : path) {
Block block = entry.vector.toLocation(player.getWorld()).getBlock();
player.sendBlockChange(block.getLocation(), block.getType(), block.getData());
if (SpigotUtil.isUsing1_13API()) {
player.sendBlockChange(block.getLocation(), block.getBlockData());
} else {
player.sendBlockChange(block.getLocation(), block.getType(), block.getData());
}
}
}
}
Expand Down

0 comments on commit 8a7a1f4

Please sign in to comment.