Skip to content

Conversation

@Novampr
Copy link
Contributor

@Novampr Novampr commented Sep 23, 2025

Adds a dependency system to Geyser extensions, might be a little rough since I haven't touched graphs much, but it works.

Example extension.yml:

id: exampleextension
name: Example Extension
main: org.geysermc.extension.example.ExampleExtension
api: 2.8.3
version: 1.0.0
authors: [Me]
dependencies:
  myotherextension:
    # Defaults to true
    required: false
    # Defaults to BEFORE
    load: AFTER

That example would ensure myotherextension is loaded BEFORE exampleextension (The wording does say AFTER in the extension, this simply defines how the current extension will load, so in this case, AFTER myotherextension, this behaviour matches the paper-plugin.yml spec)

@onebeastchris
Copy link
Member

Can you show an example extension.yml how those would be specified? That should be documented on the wiki; and would ideally require an extension to specify an API version

@Novampr
Copy link
Contributor Author

Novampr commented Sep 26, 2025

Provided an example extension yaml file in the description of the PR, would we want to just show a warning for extensions that depend on different API versions? Since they could still work regardless (See ThirdPartyCosmetics, uses API version 2.4.1 but works with modern Geyser)

@dima-dencep
Copy link

dima-dencep commented Sep 26, 2025

I would also like to suggest the option to add a link for downloading any of the dependencies, since extensions for Geyser are quite hard to find
Like:

dependencies:
  myotherextension:
    download-url: https://github.com/PlayerAnimationLibrary/GeyserPAL/releases # here
    load: AFTER

@Novampr
Copy link
Contributor Author

Novampr commented Sep 26, 2025

I'm not sure this is something we'd wanna implement, seems like a bit of a niche.

@onebeastchris
Copy link
Member

Adding links to the dependency is IMO not a good idea, the extension author should link the dependency instead

@eclipseisoffline
Copy link
Member

We might want translation strings for the new log messages.

@Novampr
Copy link
Contributor Author

Novampr commented Sep 29, 2025

I've added some translation strings to this, #143 would need to be merged first

@onebeastchris
Copy link
Member

@Novampr merged in languages; just needs bumping & documentation on https://geysermc.org/wiki/geyser/extensions#creating-geyser-extensions
Just to make sure - did you test whether "old" extensions that don't have any dependencies load fine?

@onebeastchris onebeastchris added PR: Feature When a PR implements a new feature Extensions API The issue/feature request relates to the Geyser API labels Sep 30, 2025
@Novampr
Copy link
Contributor Author

Novampr commented Sep 30, 2025

Old extensions load just fine, the dependency block is entirely optional and extensions still work without it

@Novampr
Copy link
Contributor Author

Novampr commented Sep 30, 2025

#98 is ready for merge!

@Novampr Novampr force-pushed the feat/extension_dependencies branch from e820d1b to 7a504b3 Compare October 8, 2025 12:38
@Novampr Novampr changed the base branch from master to feature/1.21.9 October 8, 2025 12:39
@onebeastchris onebeastchris merged commit 4549a95 into GeyserMC:feature/1.21.9 Oct 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API The issue/feature request relates to the Geyser API Extensions PR: Feature When a PR implements a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants