mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-19 14:59:21 +00:00
Fix locked map data saving (#140)
This commit is contained in:
@@ -29,6 +29,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,8 +56,14 @@ public class BukkitMapHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the map view from the map
|
// Get the map view from the map
|
||||||
final MapView mapView = mapMeta.getMapView();
|
final MapView mapView;
|
||||||
if (mapView == null || !mapView.isLocked() || mapView.isVirtual()) {
|
try {
|
||||||
|
mapView = Bukkit.getScheduler().callSyncMethod(plugin, mapMeta::getMapView).get();
|
||||||
|
if (mapView == null || !mapView.isLocked() || mapView.isVirtual()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
|
plugin.getLogger().log(Level.WARNING, "Failed to save map data for a player", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user