|
Hello friends! I've been trying to use the somewhat new FTB Essentials kit commands for several functions, including to provide playtime based rewards through integration with FTB Ranks. The FTB ranks portion took a huge step forward this week thanks to the work of desht in issue 1274. With that new feature on its way solving half of what I was looking for, which I'll be real with you I wasn't sure was ever going to get development priority as a feature, we need to address kits themselves and their current state. I have never had kits work properly and crawling the web and support forums I can't find anyone else who has either. Which is way too bad since I love the potential here! The problem is that kits in every pack I've made or tested drop their contents constantly. Wait an hour or three and check the kit contents? You'll get back an array of blank elements, which interestingly enough at least keeps the same number of elements as the kit had when created. Restart the server? Same issue. It won't matter if you create the kits from the hot bar, inventory, or container, even if you leave the container in the world with the kit contents. So, two questions that I think will be helpful to kick us off: 1- To even start tracking down the problem and if the issue is with the kits feature itself we need more info on where kit data is supposed to be stored. Ideally a file with this data would be created somewhere, likely in the world folder if it were to match the rest of the FTB mods. If this data were stored as its own file it would also be easy to export/import to other worlds and packs, and to bulk modify, both of which would be so nice. So yeah, do any contributors or forum goers here know where kit data is stored, or even if it is written somewhere at/after creation? 2- If the kit data is in fact saved somewhere that should be persistent, the next question would be why isn't it acting like it? I have no insight on this since I can't find where the data is written yet. Very best-case scenario for this discussion is that someone provides a link to a closed Issue here that I missed which addresses both of these questions, but at just this moment I'm not aware that FTB developers even know this is an issue. Personally, I think kits would get a lot more love from the community if they actually worked, as I imagine packs designers would simply adore showing off what they could do with it once it is working as intended. |
Replies: 2 comments 2 replies
|
Answering some of my own questions here, I must not have been very committed to digging last time or I forgot what I found, lol! Okay so the answer to question 1 is that kits are written into the data.snbt file in the world/ftbessentials directory. Its not it's own file like my best-case scenario above, but we'll work with it! The kit JSON data is a blank set of the number of items in the initial kit, so like I described in the initial post it reads in game like an array of blank values. Here's a test world's data.snbt file contents after creating two kits: { With question 1 answered I'm digging into the kit code to find why that data isn't writing anything at all in the items tags. If I can find that and any follow-up needs, I think I will close this discussion in favor of an issue with a proposed solution. |
At this point I've examined everything I have access to in the code right now. My best guess for a solution is that there is likely a missing tag.put call that takes the return of the current "stack.save(provider, tag)" line as an argument. For anyone who hasn't looked through all the comments up to this point, this call is currently on line 68 of the Kit.java class. This solution assumes that the ItemStack class has a valid save(HolderLookup.Provider provider, CompoundTag tag) method, that it operates similar to the other calls for ItemStack objects I've looked at in the related classes, and that it returns a CompoundTag object. The rest of the code looks great so I can't imagine why the…