Using SpongeVanilla version of WorldEdit as dependency

I’ve searched around the forums about the releases and version of WorldEdit for sponge and found that @Minecrell has ported WorldEdit to support SpongeVanilla. I’ve also looked around @sk89q’s wiki about how to use the API inside plugins but only found it to describe how to use within Bukkit plugins. Now I know minecrell’s version is temporary and will be implemented into sponge later, but for now I’m looking to figure out how to use the SpongeVanilla version of world edit as a dependency inside my gradle project. Right now im wondering if i should use jitpack and put that my build.gradle or use some other way and after I get worldedit inside my project which way to get a players selection because as I saw inside sk89q’s wiki you had to declare a WorldEditPlugin instance but that was only supported by bukkit and I’m wondering what the new way is.

Add maven { url "http://maven.sk89q.com/repo/" } to repositories section, and compile 'com.sk89q.worldedit:worldedit-core:6.1' to dependencies section.

[quote=“intronate67, post:1, topic:12150, full:false”]after I get worldedit inside my project which way to get a players
selection because as I saw inside sk89q’s wiki you had to declare a
WorldEditPlugin instance but that was only supported by bukkit[/quote]
I’m just using WorldEdit WEinst = WorldEdit.getInstance();. (if you’re going with optional dependency, you’ll have to check if WE is present with Sponge’s PluginManager outside of class you’re using WE directly)

P.S. Well, I have sample of getting selection, but it’s full of very, very ugly workarounds. Read it at your own risk: [link]. It’s working with both SpongeVanilla, Forge and any other WorldEdit implementations.

SpongeVanilla’s version is basically a modified version of the Forge version.
This code works with both Forge WorldEdit and vanilla WorldEdit:

try {
    ForgeWorldEdit worldEdit = ForgeWorldEdit.inst;
} catch (NoClassDefFoundError e) {
    // WorldEdit is not installed
}

Just be careful not to use code from one version that is not in the other.

Thanks to both of you for this, I now have this working.