Skip to content

Commit

Permalink
add a message to the fullrender command if there's no region files to…
Browse files Browse the repository at this point in the history
… load
  • Loading branch information
granny committed Jul 22, 2024
1 parent bbd3aaf commit 2b744ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
import net.pl3x.map.core.Pl3xMap;
import net.pl3x.map.core.command.CommandHandler;
import net.pl3x.map.core.command.Pl3xMapCommand;
Expand Down Expand Up @@ -69,6 +71,12 @@ private void executeAsync(@NotNull CommandContext<@NotNull Sender> context) {

Pl3xMap.api().getRegionProcessor().addRegions(world, regions);

sender.sendMessage(Lang.COMMAND_FULLRENDER_STARTING);
if (regions.isEmpty()) {
TagResolver.Single worldPlaceholder = Placeholder.unparsed("world", world.getName());
sender.sendMessage(Lang.COMMAND_FULLRENDER_NO_REGION_FILES_FOUND, worldPlaceholder);
} else {
sender.sendMessage(Lang.COMMAND_FULLRENDER_STARTING);
}

}
}
2 changes: 2 additions & 0 deletions core/src/main/java/net/pl3x/map/core/configuration/Lang.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public final class Lang extends AbstractConfig {
public static String COMMAND_FULLRENDER_DESCRIPTION = "Fully render a world";
@Key("command.fullrender.starting")
public static String COMMAND_FULLRENDER_STARTING = "<green>Full render starting. Check <grey>/map status</grey> for more info";
@Key("command.fullrender.no-region-files-found")
public static String COMMAND_FULLRENDER_NO_REGION_FILES_FOUND = "<red>No region files found for <world>. Please either pregenerate your world using <u><click:open_url:'https://modrinth.com/plugin/chunky'>Chunky</click></u> or wait for the loaded chunks to save.";

@Key("command.help.description")
public static String COMMAND_HELP_DESCRIPTION = "Get help for Pl3xmap commands";
Expand Down

0 comments on commit 2b744ba

Please sign in to comment.