From 1925eb0e95b7e044e5c6c178a9bc26d125c59f09 Mon Sep 17 00:00:00 2001 From: Pyrbu Date: Sun, 18 Jun 2023 23:14:05 +0200 Subject: [PATCH] add amount of npcs imported to import command --- .../lol/pyr/znpcsplus/commands/storage/ImportCommand.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/commands/storage/ImportCommand.java b/plugin/src/main/java/lol/pyr/znpcsplus/commands/storage/ImportCommand.java index 0a810e9..39b492c 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/commands/storage/ImportCommand.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/commands/storage/ImportCommand.java @@ -5,10 +5,12 @@ import lol.pyr.director.adventure.command.CommandHandler; import lol.pyr.director.common.command.CommandExecutionException; import lol.pyr.znpcsplus.conversion.DataImporter; import lol.pyr.znpcsplus.conversion.DataImporterRegistry; +import lol.pyr.znpcsplus.npc.NpcEntryImpl; import lol.pyr.znpcsplus.npc.NpcRegistryImpl; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.concurrent.CompletableFuture; @@ -37,8 +39,9 @@ public class ImportCommand implements CommandHandler { return; } try { - npcRegistry.registerAll(importer.importData()); - context.send(Component.text("All NPCs from " + id + " have been loaded.", NamedTextColor.GREEN)); + Collection entries = importer.importData(); + npcRegistry.registerAll(entries); + context.send(Component.text(entries.size() + " npcs have been loaded from " + id, NamedTextColor.GREEN)); } catch (Exception exception) { context.send(Component.text("Importing failed! Please check the console for more details.", NamedTextColor.RED)); exception.printStackTrace();