mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 22:17:17 +00:00
New API methods, refactor position object to use static creators
This commit is contained in:
1 parent
42adc13425
commit
6b8c515b61
42 files changed
+587
-232
No files matched your search
@@ -45,7 +45,7 @@ public class BukkitUser extends OnlineUser {
|
||||
|
||||
@Override
|
||||
public Position getPosition() {
|
||||
return new Position(BukkitAdapter.adaptLocation(player.getLocation())
|
||||
return Position.at(BukkitAdapter.adaptLocation(player.getLocation())
|
||||
.orElseThrow(() -> new IllegalStateException("Failed to get the position of a BukkitPlayer (null)")),
|
||||
plugin.getServerName());
|
||||
|
||||
@@ -54,7 +54,7 @@ public class BukkitUser extends OnlineUser {
|
||||
@Override
|
||||
public Optional<Position> getBedSpawnPosition() {
|
||||
return Optional.ofNullable(player.getBedSpawnLocation()).flatMap(BukkitAdapter::adaptLocation)
|
||||
.map(location -> new Position(location, plugin.getServerName()));
|
||||
.map(location -> Position.at(location, plugin.getServerName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user