mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Create #getLocalPublicHomes and #getLocalWarps, use server for checks with world UID fallback, fix #215
This commit is contained in:
1 parent
1f47ec29a7
commit
a9e643d199
2 files changed
+47
-7
No files matched your search
@@ -25,15 +25,12 @@ public abstract class MapHook extends PluginHook {
|
||||
public final boolean initialize() {
|
||||
initializeMap().thenRun(() -> {
|
||||
if (plugin.getSettings().publicHomesOnMap) {
|
||||
plugin.getDatabase().getPublicHomes().thenAccept(homes -> homes.stream()
|
||||
.filter(home -> plugin.getWorlds().stream().anyMatch(world -> world.uuid.equals(home.world.uuid)))
|
||||
.forEach(this::updateHome));
|
||||
plugin.getDatabase().getLocalPublicHomes(plugin)
|
||||
.thenAcceptAsync(homes -> homes.forEach(this::updateHome));
|
||||
}
|
||||
if (plugin.getSettings().warpsOnMap) {
|
||||
plugin.getDatabase().getWarps().thenAccept(warps -> warps
|
||||
.stream()
|
||||
.filter(warp -> plugin.getWorlds().stream().anyMatch(world -> world.uuid.equals(warp.world.uuid)))
|
||||
.forEach(this::updateWarp));
|
||||
plugin.getDatabase().getLocalWarps(plugin)
|
||||
.thenAcceptAsync(warps -> warps.forEach(this::updateWarp));
|
||||
}
|
||||
});
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user