<clear> within child kit clears spawn kits
Not sure if the title makes any sense so feel free to adjust it.
One of the issues we've been running into when converting maps on Stratus is that certain maps have spawn kits that look like this.
The
Is the issue that <clear-items/> clears all the items in the child and parent kit? Or that it doesn't?
The issue we were having was that <clear-items/> clears the parent, so only the child kits were received
But isn't that what it should do? <clear-items/> will clear all the items?
Yea ^ kit "parents" are simply added to the kit, and no layering is actually respected. <clear-items> does what it is intended to do, clear all items. An optional attribute could be added to only clear based on kit context, but the base issue described here is not a bug.
Mhm the behaviour makes perfect sense, however in the previous of PGM that was open sourced, it didn't happen like this.
Clear should be the first thing applied if the kit (or parents) has it, then it should give all items. At least that's what the docs say: You can also clear the player’s entire inventory before applying the kit by using one of the elements below.
So, this doesn't seem like a bug?
It seems like a bug that pgm should clear first, then apply kits. In this pgm it's first applying parent kit, then clearing parent and applying child kit
In this pgm it's first applying parent kit, then clearing parent and applying child kit
But it's that what it should do? Kits are applied in-order.
Is this really a bug? It seems to be more of a problem with the map than with PGM. The child kit is applied after the spawn kit, so any items given by the spawn kit will be cleared by the <clear-items/>.
https://github.com/Electroid/PGM/blob/bf8945b3985e98f117b17a314bbb5dada04ab4d6/src/main/java/tc/oc/pgm/kits/KitParser.java#L101
@Meeples10 i am pretty sure, it is a pgm bug. In newer pgm versions, it was made so pgm would always apply the clear kit before anything. The current behaviour is:
- Parent clear
- Parent give items
- Child clear
- Child give items
1.9 PGM behaviour was:
- Parent clear
- Child clear
- Parent give items
- Child give items
@Electroid Would like a ruling here on whether the behaviour should get updated to match 1.9 PGM.
Well IMO it just doesn't make any sense otherwise @rafibaum . With current behaviour all it does is make a certain XML configuration stupid (having a parent & a clear, makes one invalidate the other), while having it like 1.9+ PGM makes it so you can make use of parent kit with a clear for previous items