diff --git a/bukkit/src/main/java/net/william278/husksync/util/BukkitMapPersister.java b/bukkit/src/main/java/net/william278/husksync/util/BukkitMapPersister.java index d2b5a9f8..0621dbbd 100644 --- a/bukkit/src/main/java/net/william278/husksync/util/BukkitMapPersister.java +++ b/bukkit/src/main/java/net/william278/husksync/util/BukkitMapPersister.java @@ -424,19 +424,23 @@ private String getDimension() { @NotNull private MapData extractMapData() { final List banners = Lists.newArrayList(); - final String BANNER_PREFIX = "banner_"; - for (int i = 0; i < getCursors().size(); i++) { - final MapCursor cursor = getCursors().getCursor(i); - final String type = cursor.getType().name().toLowerCase(Locale.ENGLISH); - if (type.startsWith(BANNER_PREFIX)) { - banners.add(new MapBanner( - type.replaceAll(BANNER_PREFIX, ""), - cursor.getCaption() == null ? "" : cursor.getCaption(), - cursor.getX(), - mapView.getWorld() != null ? mapView.getWorld().getSeaLevel() : 128, - cursor.getY() - )); + try { + final String BANNER_PREFIX = "banner_"; + for (int i = 0; i < getCursors().size(); i++) { + final MapCursor cursor = getCursors().getCursor(i); + final String type = cursor.getType().name().toLowerCase(Locale.ENGLISH); + if (type.startsWith(BANNER_PREFIX)) { + banners.add(new MapBanner( + type.replaceAll(BANNER_PREFIX, ""), + cursor.getCaption() == null ? "" : cursor.getCaption(), + cursor.getX(), + mapView.getWorld() != null ? mapView.getWorld().getSeaLevel() : 128, + cursor.getY() + )); + } + } + } catch (Throwable ignored) { } return MapData.fromPixels(pixels, getDimension(), (byte) 2, banners, List.of()); }