mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-19 14:59:21 +00:00
refactor: check if read map data was null
This commit is contained in:
@@ -268,9 +268,14 @@ public interface BukkitMapHandler {
|
|||||||
|
|
||||||
// Read the pixel data and generate a map view otherwise
|
// Read the pixel data and generate a map view otherwise
|
||||||
getPlugin().debug("Deserializing map data from NBT and generating view...");
|
getPlugin().debug("Deserializing map data from NBT and generating view...");
|
||||||
final MapData canvasData = Objects.requireNonNull(readMapData(originServerName, originalMapId), "Pixel data null!").getKey();
|
final @Nullable Map.Entry<MapData, Boolean> readMapData = readMapData(originServerName, originalMapId);
|
||||||
|
if (readMapData == null) {
|
||||||
|
getPlugin().debug("Read pixel data was not found in database, skipping...");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Add a renderer to the map with the data and save to file
|
// Add a renderer to the map with the data and save to file
|
||||||
|
final MapData canvasData = Objects.requireNonNull(readMapData, "Pixel data null!").getKey();
|
||||||
final MapView view = generateRenderedMap(canvasData);
|
final MapView view = generateRenderedMap(canvasData);
|
||||||
meta.setMapView(view);
|
meta.setMapView(view);
|
||||||
map.setItemMeta(meta);
|
map.setItemMeta(meta);
|
||||||
|
|||||||
Reference in New Issue
Block a user