Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial IDExtender API #17

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Initial IDExtender API #17

wants to merge 2 commits into from

Conversation

Cleptomania
Copy link
Member

This adds a new "dummy" mod, with the ID idextender.

It then provides a new API under the idextender package, which can be used by other mods to create hard dependencies on extended metadata. This API does seem a little bit obtuse, but the intention of the API is so that mods can create this hard dependency on extended metadata, rather than any specific ID extension mod.

The goal is that other ID extension mods can include this same API, and provide the idextender dummy mod. So instead of hard dependency on NEID, a mod can hard dependency on idextender, and just check that it's getting the metadata increase it wants.

Usage of the new API is covered in the README, and once this is merged I will be updating GT5U to use it as an example.

@FalsePattern
Copy link

The readme should also note the fact that just because the API is present, the returned values may or may not actually be higher than vanilla, and mods should always inspect the returned values to ensure that they fit their needed range.
This is due to the fact that EndlessIDs' metadata extension is toggle-able in the config, so even though it has the idextender.Metadata class, it might still return vanilla values.
See: https://github.com/GTMEGA/EndlessIDs/blob/532f8f7f17196aceee1f547bd0b4823ffe33d972/src/main/java/idextender/Metadata.java

@FalsePattern
Copy link

FalsePattern commented Sep 20, 2024

Any news on this, or can I move forward with this proposal on my side?

@Cleptomania
Copy link
Member Author

Honestly kind of forgot about this. If you want to move forward with something, I can match whatever API you've got.

@FalsePattern
Copy link

The only extra addition is the following notice paragraph in the readme for API users, due to how endlessids can have its features toggled on/off, and i feel like that should also be mentioned here so that people validate the returned values before using them, instead of assuming that it's always larger than vanilla.

Note that these values CAN be identical to the vanilla values if the ID Extension mod implementing it has a config to
toggle itself, existence of the IDExtender class does not guarantee a fixed increase, and you should check that the
returned value is large enough for your needs.

@FalsePattern
Copy link

FalsePattern commented Sep 21, 2024

Ah, I almost forgot, DataWatcher should also be added, I saw someone on the legacy modding discord complaining about the vanilla datawatcher count, so exposing that in the API could be useful.

https://github.com/GTMEGA/EndlessIDs/blob/interop/src/main/java/idextender/DataWatcher.java
Same API as the metadata, so in EIDs the values would be 65535 for the max and 16 for the bits, and in NEID it's 127 and 7.

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.

2 participants