Fix sometimes using a world as command-parameter doesnt find the maps to use

This commit is contained in:
Blue (Lukas Rieger) 2021-07-20 16:39:57 +02:00
parent 47b0c60a7f
commit 3913878e20
No known key found for this signature in database
GPG Key ID: 904C4995F9E1F800

View File

@ -749,13 +749,18 @@ public int updateCommand(CommandContext<S> context, boolean force) {
if (worldToRender != null) {
plugin.getServerInterface().persistWorldChanges(worldToRender.getUUID());
for (BmMap map : plugin.getMapTypes()) {
if (map.getWorld().equals(worldToRender)) maps.add(map);
if (map.getWorld().getUUID().equals(worldToRender.getUUID())) maps.add(map);
}
} else {
plugin.getServerInterface().persistWorldChanges(mapToRender.getWorld().getUUID());
maps.add(mapToRender);
}
if (maps.isEmpty()) {
source.sendMessage(Text.of(TextColor.RED, "No map has been found for this world that could be updated!"));
return;
}
for (BmMap map : maps) {
MapUpdateTask updateTask = new MapUpdateTask(map, center, radius);
plugin.getRenderManager().scheduleRenderTask(updateTask);