mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Refactor cached data away from cache
This commit is contained in:
14 files changed
+166
-373
No files matched your search
@@ -7,13 +7,24 @@ import net.william278.huskhomes.position.Warp;
|
||||
import net.william278.huskhomes.util.ValidationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class WarpsManager {
|
||||
private final HuskHomes plugin;
|
||||
private final List<Warp> warps;
|
||||
|
||||
protected WarpsManager(@NotNull HuskHomes plugin) {
|
||||
this.plugin = plugin;
|
||||
this.warps = plugin.getDatabase().getWarps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cached warp names
|
||||
*/
|
||||
@NotNull
|
||||
public List<String> getWarps() {
|
||||
return warps.stream().map(Warp::getName).toList();
|
||||
}
|
||||
|
||||
public void createWarp(@NotNull String name, @NotNull Position position, boolean overwrite) throws ValidationException {
|
||||
|
||||
Reference in new issue
Block a user