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

Ability to use AddPackFindersEvent for optional Resource packs that are on by default #8960

Open
Soaryn opened this issue Aug 12, 2022 · 12 comments
Labels
Feature This request implements a new feature.

Comments

@Soaryn
Copy link
Contributor

Soaryn commented Aug 12, 2022

While the example of AddPackFindersEvent is highly useful, it is missing the functionality of having a resource pack added that is on by default without being forced required.

The current options are to either accept it is default off, or always on. It would be preferable to have an option of on by default with the ability to disable by the user.

@Soaryn Soaryn added the Feature This request implements a new feature. label Aug 12, 2022
@diesieben07
Copy link
Contributor

I think this could already be accomplished by using PackRepository#setSelected, could it not?

@Soaryn
Copy link
Contributor Author

Soaryn commented Aug 15, 2022

@OrionDevelopment Obligatory ping as requested

@marchermans
Copy link
Contributor

I think this could already be accomplished by using PackRepository#setSelected, could it not?

Sadly not the PackRepository does not exist yet, and as far as we can see there is no way for that to be done by default.

@diesieben07
Copy link
Contributor

diesieben07 commented Aug 16, 2022

Sadly not the PackRepository does not exist yet, and as far as we can see there is no way for that to be done by default.

Yes, it needs to be done later. And the mod also needs to keep track of whether it already "auto-enabled" the pack before, so that the user can disable it again without the mod re-enabling it. Sure, Forge could add functionality for this, but it should definitely be possible already.

@marchermans
Copy link
Contributor

Sadly not the PackRepository does not exist yet, and as far as we can see there is no way for that to be done by default.

Yes, it needs to be done later. And the mod also needs to keep track of whether it already "auto-enabled" the pack before, so that the user can disable it again without the mod re-enabling it. Sure, Forge could add functionality for this, but it should definitely be possible already.

My point is yeah that is a possible clunky solution. Would we consider adding an endpoint to the API that facilitates this properly.

@diesieben07
Copy link
Contributor

What would "properly" mean, though, if not essentially what I described?

@marchermans
Copy link
Contributor

What would "properly" mean, though, if not essentially what I described?

As far as I can see marking the pack as enabled causes a second pack reload with the performance hit of that execution.
It would be good if a modder could do this directly in the event don't you think?

So yes I don't consider the current method "properly"

@diesieben07
Copy link
Contributor

RegisterClientReloadListenersEvent could be used to do it, it fires before the first resource reload and after pack finders are added.

@marchermans
Copy link
Contributor

RegisterClientReloadListenersEvent could be used to do it, it fires before the first resource reload and after pack finders are added.

Nice idea I overlooked that option, but on the client side we are tending to make things properly possible in the correct events or directly in the registration place.

Having to hijack such an event is not a great idea in my opinion. But yeah @Soaryn You could indeed do it in that event to enable it by name. That said I will look into adding an additional endpoint in the original event to enable it by default without making it required.

@diesieben07
Copy link
Contributor

Yes, a separate event should be added.

That said I will look into adding an additional endpoint in the original event to enable it by default without making it required.

This will not be trivial, because at this point the game has not even loaded the user-selected resource packs from the options.

ApexModder added a commit to ApexStudios-Dev/FantasyFurniture-Archive that referenced this issue Aug 29, 2022
These packs are mainly used for adding additional mod support that is not dependent on java code.

These packs are disabled by default, this is to keep the functionality of allowing the end user of disabling the packs if they wanted to.

Waiting the following MinecraftForge issue to be resolved to allow these packs to be enabled by default while still allowing end user to disable them.
MinecraftForge/MinecraftForge#8960
@Soaryn
Copy link
Contributor Author

Soaryn commented Feb 6, 2023

Was curious if any traction had been done on a solution for this for forge :)

@marchermans
Copy link
Contributor

I did not have the time, no.
Feel free to make a PR yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature This request implements a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants