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
@@ -26,7 +26,7 @@ public class SpawnCommand extends CommandBase {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
final Optional<? extends Position> position = (plugin.getSettings().crossServer && plugin.getSettings().globalSpawn
|
||||
? plugin.getDatabase().getWarp(plugin.getSettings().globalSpawnName).join()
|
||||
: plugin.getServerSpawn().flatMap(spawn -> spawn.getLocation(plugin.getServer(onlineUser))));
|
||||
: plugin.getServerSpawn().flatMap(spawn -> spawn.getLocation(plugin.getPluginServer())));
|
||||
if (position.isEmpty()) {
|
||||
plugin.getLocales().getLocale("error_spawn_not_set").ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
|
||||
@@ -173,7 +173,7 @@ public class TpCommand extends CommandBase implements TabCompletable, ConsoleExe
|
||||
Double.parseDouble(args[3]),
|
||||
0f, 0f,
|
||||
args.length >= 5 ? new World(args[4], UUID.randomUUID()) : plugin.getWorlds().get(0),
|
||||
args.length == 6 ? new Server(args[5]) : plugin.getServer(playerToTeleport)));
|
||||
args.length == 6 ? new Server(args[5]) : plugin.getPluginServer()));
|
||||
} catch (NumberFormatException e) {
|
||||
plugin.getLoggingAdapter().log(Level.WARNING, "Invalid syntax. Usage: tp <player> <x> <y> <z> [world] [server]");
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user