IntellectualSites / FastAsyncWorldEdit

Blazingly fast world manipulation for artists, builders and everyone else: https://www.spigotmc.org/resources/13932/
Other
579 stars 207 forks source link

Mask/Pattern Factory parseFromInput within RichParser broken after 2.11.0 - API #2825

Open Zeranny opened 3 days ago

Zeranny commented 3 days ago

Server Implementation

Paper

Server Version

1.20.5/6

Describe the bug

Following the updates in https://github.com/IntellectualSites/FastAsyncWorldEdit/pull/2786, usage of Mask/Pattern factory parseFromInput() within a RichParser paser does not work and causes the surrounding parser to error.

I see this in my own new plugin, and it has also been reported in Arceon @Brennian I have added a small example code snippet to show what I mean. The error is thrown on the inner Mask parse.

Note that my debugpaste is on Version 2.11.1-SNAPSHOT as I was testing adding debug statements to find the point of failure, I have replicated in on 2.11.0 and reports from those using Arceon are on 2.11.0 Also tested on MC versions 1.20.4, 1.20.5/6, and 1.21.0 and the issue persists

Issue not present on 2.9.2 or 2.10.0

To Reproduce

Using the FAWE API, call Mask/Pattern factory's parseFromInput() inside a RichParser

Expected behaviour

Prior to this update there was no issue using masks/patterns within a RichParser. Looking to restore that functionality.

Screenshots / Videos

image image

Error log (if applicable)

No response

Fawe Debugpaste

https://athion.net/ISPaster/paste/view/91bb2d0911d741f2b58c459d89e2acf1

Fawe Version

2.11.1-SNAPSHOT

Checklist

Anything else?

public class NearMaskParser extends RichParser<Mask> {

    public NearMaskParser(WorldEdit WorldEdit, String ... aliases) {
        super(WorldEdit, aliases);
    }

    @Override
    protected Mask parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
        System.out.println("NM"); // Prints
        Mask mask = worldEdit.getMaskFactory().parseFromInput(arguments[0], context);
        System.out.println("Doesn't print");
        ...

        return new NearMask(mask, ...);
    }
}
dordsor21 commented 3 days ago

How is it being registered to the Mask factory?

Zeranny commented 3 days ago

How is it being registered to the Mask factory?

worldEdit.getWorldEdit().getMaskFactory().register(new NearMaskParser(worldEdit.getWorldEdit(), "#near"));

@Brennian does Arceon do anything different?

TheMeinerLP commented 1 day ago

I can confirm that