Clarifies a message
All checks were successful
KnarCraft/BlacksmithVisuals/pipeline/head This commit looks good

This commit is contained in:
Kristian Knarvik 2024-08-03 21:36:25 +02:00
parent eb2605f89b
commit ae2ce0c7d6
2 changed files with 3 additions and 2 deletions

View File

@ -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;
}

View File

@ -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);
}
/**