mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 06:28:49 +00:00
Private home list display, caching
This commit is contained in:
1 parent
83d5a921ee
commit
bafd3837dd
10 files changed
+237
-19
No files matched your search
@@ -30,7 +30,7 @@ public class Home extends SavedPosition {
|
||||
this.isPublic = isPublic;
|
||||
}
|
||||
|
||||
public Home(Position position, PositionMeta meta, @NotNull User owner) {
|
||||
public Home(@NotNull Position position, @NotNull PositionMeta meta, @NotNull User owner) {
|
||||
super(position, meta);
|
||||
this.owner = owner;
|
||||
this.isPublic = false;
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Represents a position - a location somewhere on the proxy network or server
|
||||
* Represents a position - a {@link Location} somewhere on the proxy network or server
|
||||
*/
|
||||
public class Position extends Location implements MessageSerializable {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.UUID;
|
||||
/**
|
||||
* Represents a persistently-saved {@link Position}
|
||||
*/
|
||||
public abstract class SavedPosition extends Position {
|
||||
public abstract class SavedPosition extends Position implements Comparable<SavedPosition> {
|
||||
|
||||
/**
|
||||
* Metadata about this position (name, description)
|
||||
@@ -42,4 +42,15 @@ public abstract class SavedPosition extends Position {
|
||||
this.uuid = UUID.randomUUID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two {@link SavedPosition}s, returns alphabetical compareTo result
|
||||
*
|
||||
* @param other the object to be compared.
|
||||
* @return the alphabetical comparison with another {@link SavedPosition}'s {@link PositionMeta#name}
|
||||
*/
|
||||
@Override
|
||||
public final int compareTo(@NotNull SavedPosition other) {
|
||||
return meta.name.compareToIgnoreCase(other.meta.name);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,8 +21,7 @@ public class Warp extends SavedPosition {
|
||||
* @param position The {@link Position} to save as a warp
|
||||
* @param meta {@link PositionMeta} information about this position
|
||||
*/
|
||||
public Warp(Position position, PositionMeta meta) {
|
||||
public Warp(@NotNull Position position, @NotNull PositionMeta meta) {
|
||||
super(position, meta);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user