mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-28 07:07:39 +02:00
Append waypoints in the waypoint editor
This commit is contained in:
parent
b2f841a40e
commit
1d314fba7a
@ -659,7 +659,7 @@ public class EventListen implements Listener {
|
||||
return;
|
||||
}
|
||||
if (npc.isSpawned()) {
|
||||
storeForRespawn(npc);
|
||||
toRespawn.put(new ChunkCoord(npc.getEntity().getLocation()), npc);
|
||||
Messaging.debug("Despawned", npc.getId() + "due to world unload at", event.getWorld().getName());
|
||||
}
|
||||
}
|
||||
@ -715,8 +715,4 @@ public class EventListen implements Listener {
|
||||
}
|
||||
return npc.spawn(spawn, SpawnReason.CHUNK_LOAD);
|
||||
}
|
||||
|
||||
private void storeForRespawn(NPC npc) {
|
||||
toRespawn.put(new ChunkCoord(npc.getEntity().getLocation()), npc);
|
||||
}
|
||||
}
|
||||
|
@ -983,7 +983,7 @@ public class NPCCommands {
|
||||
}
|
||||
|
||||
Paginator paginator = new Paginator().header("NPCs").console(sender instanceof ConsoleCommandSender);
|
||||
paginator.addLine("<b>Key: <e>ID <a>Name");
|
||||
paginator.addLine("<e><o>ID <a><o>Name");
|
||||
for (int i = 0; i < npcs.size(); i += 2) {
|
||||
String line = "<e>" + npcs.get(i).getId() + "<a> " + npcs.get(i).getName();
|
||||
if (npcs.size() >= i + 2)
|
||||
|
@ -324,14 +324,18 @@ public class LinearWaypointProvider implements EnumerableWaypointProvider {
|
||||
|
||||
Waypoint element = new Waypoint(at);
|
||||
normaliseEditingSlot();
|
||||
if (editingSlot == waypoints.size()) {
|
||||
waypoints.add(element);
|
||||
} else {
|
||||
waypoints.add(editingSlot, element);
|
||||
}
|
||||
if (showPath) {
|
||||
markers.createMarker(element, element.getLocation().clone().add(0, 1, 0));
|
||||
}
|
||||
editingSlot = Math.min(editingSlot + 1, waypoints.size());
|
||||
Messaging.sendTr(player, Messages.LINEAR_WAYPOINT_EDITOR_ADDED_WAYPOINT, formatLoc(at), editingSlot + 1,
|
||||
waypoints.size());
|
||||
} else if (waypoints.size() > 0) {
|
||||
} else if (waypoints.size() > 0 && !event.getPlayer().isSneaking()) {
|
||||
event.setCancelled(true);
|
||||
normaliseEditingSlot();
|
||||
Waypoint waypoint = waypoints.remove(editingSlot);
|
||||
|
Loading…
Reference in New Issue
Block a user