Skip to content

Conversation

@JulianVennen
Copy link
Contributor

As described in #15 it is currently not possible to upload bukkit plugins while specifying game versions with this plugin.

This PR fixes that by allowing users to filter which game version types they want to use.
To accomplish that, it introduces the interface VersionTypeProvider which takes a list of VersionTypes and returns a list of valid type IDs that should be considered when selecting versions. Multiple of these interfaces can be selected at the same time to make reusing them easier (e.g., if CurseForge decides to add java version selection to plugins).

Users can either implement this interface themselves for more advanced use cases or possibly different games, or use some of the predefined implementations. By default, the Java Versions, Mod loaders, Minecraft versions (for Mods) and Environments are accepted which matches the existing behavior of the plugin.

Switching to bukkit is as simple as adding the following line to your task:

setVersionTypeProviders(new net.darkhax.curseforgegradle.versionTypes.BukkitMinecraftVersionTypeProvider())

I changed the constructor of the GameVersions class. Since the doc comment on the constructor for this class mentions that it should not be called manually by users, I think that's fine.
If this is considered a breaking change, I could add a constructor compatible with the previous signature, but that would require moving the default provider list outside TaskPublishCurseForge, which would IMO make it harder to find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant