|
|
@ -424,19 +424,23 @@ public interface BukkitMapPersister {
|
|
|
|
@NotNull
|
|
|
|
@NotNull
|
|
|
|
private MapData extractMapData() {
|
|
|
|
private MapData extractMapData() {
|
|
|
|
final List<MapBanner> banners = Lists.newArrayList();
|
|
|
|
final List<MapBanner> banners = Lists.newArrayList();
|
|
|
|
final String BANNER_PREFIX = "banner_";
|
|
|
|
try {
|
|
|
|
for (int i = 0; i < getCursors().size(); i++) {
|
|
|
|
final String BANNER_PREFIX = "banner_";
|
|
|
|
final MapCursor cursor = getCursors().getCursor(i);
|
|
|
|
for (int i = 0; i < getCursors().size(); i++) {
|
|
|
|
final String type = cursor.getType().name().toLowerCase(Locale.ENGLISH);
|
|
|
|
final MapCursor cursor = getCursors().getCursor(i);
|
|
|
|
if (type.startsWith(BANNER_PREFIX)) {
|
|
|
|
final String type = cursor.getType().name().toLowerCase(Locale.ENGLISH);
|
|
|
|
banners.add(new MapBanner(
|
|
|
|
if (type.startsWith(BANNER_PREFIX)) {
|
|
|
|
type.replaceAll(BANNER_PREFIX, ""),
|
|
|
|
banners.add(new MapBanner(
|
|
|
|
cursor.getCaption() == null ? "" : cursor.getCaption(),
|
|
|
|
type.replaceAll(BANNER_PREFIX, ""),
|
|
|
|
cursor.getX(),
|
|
|
|
cursor.getCaption() == null ? "" : cursor.getCaption(),
|
|
|
|
mapView.getWorld() != null ? mapView.getWorld().getSeaLevel() : 128,
|
|
|
|
cursor.getX(),
|
|
|
|
cursor.getY()
|
|
|
|
mapView.getWorld() != null ? mapView.getWorld().getSeaLevel() : 128,
|
|
|
|
));
|
|
|
|
cursor.getY()
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Throwable ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return MapData.fromPixels(pixels, getDimension(), (byte) 2, banners, List.of());
|
|
|
|
return MapData.fromPixels(pixels, getDimension(), (byte) 2, banners, List.of());
|
|
|
|
}
|
|
|
|
}
|
|
|
|