Closed ProfElements closed 9 months ago
Pro Tip! You can help us label your Pull Requests by using the following branch naming convention next time you create a pull request. โค๏ธ Branch naming convention | Label |
---|---|
feature/** |
๐ Feature |
fix/** |
โจ Fix |
chore/** |
๐งน Chores |
api/** |
๐ง API |
performance/** |
๐ก Performance Optimization |
compatibility/** |
๐ค Compatibility |
If your changes do not fall into any of these categories, don't worry. You can just ignore this message in that case! ๐
Can we get unit tests?
A Slimefun preview build is available for testing! Commit: a25a4e43
https://preview-builds.walshy.dev/download/Slimefun/4099/a25a4e43
Note: This is not a supported build and is only here for the purposes of testing. Do not run this on a live server and do not report bugs anywhere but this PR!
Fixed up according to suggestions
I'm not sure about the use case of this tbch, for example: if one addon waits for this event to then register its items to integrate with another addon, but then another addon waits for this event to integrate with that addon, then you would still have the same problem.
Currently if you soft depend on any addon you can utilize its items without any problem, in my experience anyways. I guess it depends on the addon but I've never experienced that not working.
The use case you have also provided encourages registering items, after load items is called, which feels wrong.
Idk this could just be me but I don't think this is the right solution.
I'm not sure about the use case of this tbch, for example: if one addon waits for this event to then register its items to integrate with another addon, but then another addon waits for this event to integrate with that addon, then you would still have the same problem.
Currently if you soft depend on any addon you can utilize its items without any problem, in my experience anyways. I guess it depends on the addon but I've never experienced that not working.
The use case you have also provided encourages registering items, after load items is called, which feels wrong.
Idk this could just be me but I don't think this is the right solution.
This probably isn't the right solution, but I'm currently in the situation when I want to integrate items into another project. Which I can't load after because its softdepend
on DynaTech. I don't thing we should add items to registry after this point, I'm using it to add all my recipes using another projects items IE my SeedPlucker adding Gastro Seeds to its recipes. If you have a circular softdepend ie DynaTech softdepend on Gastronomicon, and Gastronomicon softdepend on DynaTech, they are loaded arbitrarily.
This probably isn't the right solution, but I'm currently in the situation when I want to integrate items into another project. Which I can't load after because its
softdepend
on DynaTech. I don't thing we should add items to registry after this point, I'm using it to add all my recipes using another projects items IE my SeedPlucker adding Gastro Seeds to its recipes
Ah so you're in a circular dependency problem. Which is similar to the issue I showed with this. One solution I can think of is you PR to gastro and make gastro add it to the seed plucker but yeah I get the problem.
I think what you may be able to do is something kinda like slimefun, slimefun adds a lot of recipes to machines on post register. So if all you want to do is add machine recipes, then this event is actually a good solution. In which case I misunderstood what this was meant for. I thought you meant registering items dependent on addons items ๐
Yeah Im sorry i know my explanation was kinda confusing
Description
This Event is provided so that plugins that have integrations with each other aren't stuck in a state in which some SlimefunItems may not be available to one plugin or the other.
I will use this event to provide a cleaner integration between Dynatech and other plugins. Currently InfinityXpansion, ExoticGarden, and Gastronomicon.
Proposed changes
Make an event to be able to listen to Slimefun's Registry finalizing all static items.
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values