Skip to content

Commit

Permalink
fix: portal import command checking yaml files
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Nov 18, 2024
1 parent 197e90a commit 7635a13
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> portalSet = config.getKeys(false);

Expand Down Expand Up @@ -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)
Expand All @@ -130,7 +137,7 @@ public String getArg(List<DataTag> tags, String arg) {

public int importDestinations() {
ConfigAccessor destiConfig = new ConfigAccessor(
AdvancedPortalsPlugin.getInstance(), "destinations.yaml");
AdvancedPortalsPlugin.getInstance(), "destinations.yml");
var config = destiConfig.getConfig();
Set<String> destiSet = config.getKeys(false);

Expand Down

0 comments on commit 7635a13

Please sign in to comment.