diff --git a/src/main/java/net/knarcraft/blacksmithvisuals/command/SetNPCPositionCommand.java b/src/main/java/net/knarcraft/blacksmithvisuals/command/SetNPCPositionCommand.java index 5aab070..f2625e3 100644 --- a/src/main/java/net/knarcraft/blacksmithvisuals/command/SetNPCPositionCommand.java +++ b/src/main/java/net/knarcraft/blacksmithvisuals/command/SetNPCPositionCommand.java @@ -30,7 +30,7 @@ public class SetNPCPositionCommand implements TabExecutor { @NotNull String[] arguments) { NPC npc = CitizensAPI.getDefaultNPCSelector().getSelected(commandSender); if (npc == null || (!npc.hasTrait(BlacksmithTrait.class) && !npc.hasTrait(ScrapperTrait.class))) { - commandSender.sendMessage("You must select an NPC before executing this command"); + commandSender.sendMessage("You must select a scrapper or blacksmith NPC before executing this command"); return true; } diff --git a/src/main/java/net/knarcraft/blacksmithvisuals/listener/BlacksmithListener.java b/src/main/java/net/knarcraft/blacksmithvisuals/listener/BlacksmithListener.java index e709134..5ab082e 100644 --- a/src/main/java/net/knarcraft/blacksmithvisuals/listener/BlacksmithListener.java +++ b/src/main/java/net/knarcraft/blacksmithvisuals/listener/BlacksmithListener.java @@ -99,6 +99,7 @@ public class BlacksmithListener implements Listener { BlacksmithVisuals instance = BlacksmithVisuals.getInstance(); BukkitScheduler scheduler = Bukkit.getScheduler(); NPC npc = event.getNpc(); + long delay = moveToWorkingPosition(npc, NPCPosition.getFromMaterial(event.getCraftingStation())); long finishTime = event.getActionDurationTicks() - (2 * delay); @@ -128,10 +129,10 @@ public class BlacksmithListener implements Listener { npc.getName() + " is unreachable!"); return; } - npc.getNavigator().setTarget(targetLocation); Bukkit.getScheduler().scheduleSyncDelayedTask(BlacksmithVisuals.getInstance(), () -> npc.getEntity().teleport(targetLocation), getWalkTime(npc.getEntity().getLocation(), targetLocation)); + npc.getNavigator().setTarget(targetLocation); } /**