Closed MerchantPug closed 1 year ago
Accidentally had a goof while trying to change the name of the branch.
I think I will probably reject this in favour of using Fabric's own resource conditions API, unless you see reasons for sticking with a custom implementation here which I'm not seeing. https://github.com/FabricMC/fabric/tree/1.19.4/fabric-resource-conditions-api-v1
I ultimately agree to that, I'm unfortunately not really in a mood to change things right now so I'll be closing this PR.
This adds a
loading_condition
field to the power JSON. Currently it supports the 3 meta conditions andapoli:mod_loaded
with anid
field andapoli:datapack_loaded
with anamespace
field.The loading condition field is checked before attempting to load the power, with a null result being returned if a
loading_condition
is present and false. If a null result is returned for a multiple or subpower, it will ignore the extra logic attached.In the case of loading priorities, it will only delete an old power if the loading priority is higher than the currently registered one but will not update the loading priority upon doing so, mainly so any non dependent or dependency correct powers can load.
I'm unsure on if I should be showing a warning message with this system but it's probably fine to not have that as it's supposed to be a non intrusive way of having dependencies with powers.
If this is merged, I'd hope that such a thing could also be on Origins.
For testing purposes, a test datapack with a higher loading priority and a loading condition that will always return false is provided here.