mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +00:00
Refactor #getServer() to be pre-cached from a CachedServer yaml file, no longer require fetcher, add #fetchServer(requester)
This commit is contained in:
1 parent
800bffbbf2
commit
74cb268426
11 files changed
+105
-45
No files matched your search
@@ -65,14 +65,14 @@ public class BukkitPlayer extends OnlineUser {
|
||||
public Position getPosition() {
|
||||
return new Position(BukkitAdapter.adaptLocation(player.getLocation())
|
||||
.orElseThrow(() -> new HuskHomesException("Failed to get the position of a BukkitPlayer (null)")),
|
||||
BukkitHuskHomes.getInstance().getServer(this));
|
||||
BukkitHuskHomes.getInstance().getPluginServer());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Position> getBedSpawnPosition() {
|
||||
return Optional.ofNullable(player.getBedSpawnLocation()).flatMap(BukkitAdapter::adaptLocation)
|
||||
.map(location -> new Position(location, BukkitHuskHomes.getInstance().getServer(this)));
|
||||
.map(location -> new Position(location, BukkitHuskHomes.getInstance().getPluginServer()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user