From 7635a134217d9673a801c08c0431eeb79a36de79 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Tue, 10 Sep 2024 04:49:59 +0100 Subject: [PATCH] fix: portal import command checking yaml files --- .../subcommands/portal/ImportPortalSubCommand.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/commands/subcommands/portal/ImportPortalSubCommand.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/commands/subcommands/portal/ImportPortalSubCommand.java index 61380cb5..851cc58e 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/commands/subcommands/portal/ImportPortalSubCommand.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/commands/subcommands/portal/ImportPortalSubCommand.java @@ -46,7 +46,7 @@ public void onCommand(CommandSenderContainer sender, String[] args) { private int importPortals() { ConfigAccessor portalConfig = new ConfigAccessor( - AdvancedPortalsPlugin.getInstance(), "portals.yaml"); + AdvancedPortalsPlugin.getInstance(), "portals.yml"); var config = portalConfig.getConfig(); Set portalSet = config.getKeys(false); @@ -110,6 +110,13 @@ private int importPortals() { .toList() .forEach(args::remove); + // Find an arg called "delayed" and add a new one called portalEvent + var delayed = getArg(args, "delayed"); + if (delayed != null) { + args.add(new DataTag("portalEvent", delayed)); + args.removeIf(dataTag -> dataTag.NAME.equals("delayed")); + } + var portal = portalServices.createPortal(pos1, pos2, args); if (portal != null) @@ -130,7 +137,7 @@ public String getArg(List tags, String arg) { public int importDestinations() { ConfigAccessor destiConfig = new ConfigAccessor( - AdvancedPortalsPlugin.getInstance(), "destinations.yaml"); + AdvancedPortalsPlugin.getInstance(), "destinations.yml"); var config = destiConfig.getConfig(); Set destiSet = config.getKeys(false);