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

Causes reload during first data load (and incompatible with Anvil Crushing Recipes) #41

Closed
supersaiyansubtlety opened this issue Jul 5, 2022 · 4 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@supersaiyansubtlety
Copy link

supersaiyansubtlety commented Jul 5, 2022

This line: https://github.com/RubixDev/Rug/blob/1.19/src/main/java/de/rubixdev/rug/RugServer.java#L243

is starting a reload before the first load has finished.

This makes Rug incompatible with my mod, Anvil Crushing Recipes (issue on my side here), because of this line in ACR, which requires the assumption that one reload finishes before another begins.

I can remove the exception and instead just log an error, which I plan to do if only to prevent hard conflicts like this.

However causing an additional load really isn't a good idea. It's inefficient and can lead to strange interactions like this one with ACR.

It looks like the reload simply enables a builtin datapack. If this is the case, you could use Fabric API's registerResourcePacks, which I actually do in ACR here.

@RubixDev
Copy link
Owner

RubixDev commented Jul 5, 2022

Thanks for the hint, the ResourceManagerHelper.registerBuiltinResourcePack method should I think do what I want, but I don't have the necessary internet connection to test right now

@RubixDev
Copy link
Owner

Actually after having a closer look now, I don't think that method works. It requires the datapack to be in the mod jar file, but the whole reason why I manually copy the files into the datapack directory is that I need the pack to be dynamic, depending on what rules are set the contents of that pack vary.

As previously discussed in #17 (comment), I am also pretty much unable to create the datapack files before the default first load starts, because carpet only parses the rule config after that.

If you have another suggestion for a potential solution or I simply misunderstood the registerBuiltinResourcePack method, please tell me. You seem a lot more experienced with fabric mod development than I am. Otherwise I sadly might have to close this as wontfix...

@supersaiyansubtlety
Copy link
Author

My recommendation would be: for each carpet rule that controls a datapack, remove it, and replace it with a builtin datapack.

The only difference for users would be that they enable/disable them with /datapack enable/disable <data pack name> instead of /carpet <carpet rule name> true/false.

@RubixDev
Copy link
Owner

RubixDev commented Aug 1, 2022

That won't work with rules like unpackableIce however, as they can be customized with a user specified integer value. Also I like the way these rules are integrated with the others, so users don't have to think about them being any different.

So, as the hard conflict between our mods seems to have been resolved on your side, I will close this now.

@RubixDev RubixDev closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2022
@RubixDev RubixDev added enhancement New feature or request wontfix This will not be worked on labels Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants