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.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
@@ -55,10 +56,16 @@ public class BukkitMapHandler {
|
||||
}
|
||||
|
||||
// Get the map view from the map
|
||||
final MapView mapView = mapMeta.getMapView();
|
||||
final MapView mapView;
|
||||
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;
|
||||
}
|
||||
|
||||
// Get the map data
|
||||
plugin.debug("Rendering map view onto canvas for locked map");
|
||||
|
||||
Reference in New Issue
Block a user