mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-28 20:17:50 +01:00
Normalise editing slot.
This commit is contained in:
parent
c0baa1b446
commit
5c7ac6926b
@ -59,6 +59,7 @@ public class LinearWaypointProvider implements WaypointProvider, Iterable<Waypoi
|
|||||||
Messaging.send(player, String.format("<e>Added<a> a waypoint at (" + formatLoc(at)
|
Messaging.send(player, String.format("<e>Added<a> a waypoint at (" + formatLoc(at)
|
||||||
+ ") (<e>%d<a>, <e>%d<a>)", editingSlot + 1, waypoints.size()));
|
+ ") (<e>%d<a>, <e>%d<a>)", editingSlot + 1, waypoints.size()));
|
||||||
} else if (waypoints.size() > 0) {
|
} else if (waypoints.size() > 0) {
|
||||||
|
editingSlot = Math.min(0, Math.max(waypoints.size() - 1, editingSlot));
|
||||||
waypoints.remove(editingSlot);
|
waypoints.remove(editingSlot);
|
||||||
editingSlot = Math.max(0, editingSlot - 1);
|
editingSlot = Math.max(0, editingSlot - 1);
|
||||||
Messaging.send(player, String.format("<e>Removed<a> a waypoint (<e>%d<a> remaining) (<e>%d<a>)",
|
Messaging.send(player, String.format("<e>Removed<a> a waypoint (<e>%d<a> remaining) (<e>%d<a>)",
|
||||||
|
Loading…
Reference in New Issue
Block a user