mirror of https://github.com/kami-blue/client
Fixed stash list command regex, added IDs to CoordinateInfo (#844)
This commit is contained in:
parent
6f0212e1cd
commit
3eec16e4ae
|
@ -89,7 +89,7 @@ public class CoordsCommand extends Command {
|
|||
} else {
|
||||
sendChatMessage("List of logged stashes:");
|
||||
}
|
||||
String stashRegex = "(\\(.*chests, .* shulkers\\))";
|
||||
String stashRegex = "(\\(.* chests, .* shulkers, .* droppers, .* dispensers\\))";
|
||||
Objects.requireNonNull(coords).forEach(coord -> {
|
||||
if (stashes) {
|
||||
if (coord.name.matches(stashRegex)) {
|
||||
|
@ -122,7 +122,7 @@ public class CoordsCommand extends Command {
|
|||
}
|
||||
}
|
||||
private String format(CoordinateInfo coord, String searchterm) {
|
||||
String message = " " + coord.name + " (" + coord.xyz.x + " " + coord.xyz.y + " " + coord.xyz.z + ")";
|
||||
String message = " [" + coord.id + "] " + coord.name + " (" + coord.xyz.x + " " + coord.xyz.y + " " + coord.xyz.z + ")";
|
||||
return message.replaceAll(searchterm, "&7" + searchterm + "&f");
|
||||
}
|
||||
private void confirm(String name, Coordinate xyz) {
|
||||
|
|
|
@ -16,17 +16,21 @@ public class CoordinateInfo {
|
|||
public String time;
|
||||
@SerializedName("date")
|
||||
public String date;
|
||||
@SerializedName("id")
|
||||
public int id;
|
||||
|
||||
public CoordinateInfo(int x, int y, int z, String nameSet, String timeSet) {
|
||||
xyz = new Coordinate(x, y, z);
|
||||
name = nameSet;
|
||||
time = timeSet;
|
||||
id = CoordUtil.readCoords(CoordUtil.coordsLogFilename).size();
|
||||
}
|
||||
|
||||
public CoordinateInfo(Coordinate pos, String nameSet, String timeSet) {
|
||||
xyz = pos;
|
||||
name = nameSet;
|
||||
time = timeSet;
|
||||
id = CoordUtil.readCoords(CoordUtil.coordsLogFilename).size();
|
||||
}
|
||||
|
||||
public Coordinate getPos() {
|
||||
|
|
Loading…
Reference in New Issue