Flanks255 / simplybackpacks

Simply Backpacks
MIT License
12 stars 5 forks source link

Item deletion on upgrade #46

Closed Keaft closed 2 years ago

Keaft commented 2 years ago

Items in backpacks are deleted when upgrading.

Latest Forge version of 1.12.2. Simply Backpacks 1.4.9.

I recognize you've expressed disinterest in continuing support for 1.12.2 and I've actually made an attempt at resolving this through a crafttweaker script to copy and edit the nbt for the resultant upgraded backpack: https://pastebin.com/wD2KWyvw

I'm fully out of my depth at this point and thought I'd try here. :) No pressure one way or another.

Flanks255 commented 2 years ago

so the normal upgrade recipe for the backpacks does NBT copying as well, this kind of problem usually resulted from another mods crafting ignoring the custom recipe, and just giving you the result item without processing it, i know for awhile AE2 did this.

Keaft commented 2 years ago

Huh interesting. I do have AE2 in my pack among many others.

Flanks255 commented 2 years ago

what crafting interface were you using when it got wiped?

Flanks255 commented 2 years ago

other thing that could cause it would be a mod or modpack replacing the recipe with a vanilla shaped recipe.

Keaft commented 2 years ago

So I was using a Tinker's crafting table, then switched over to the vanilla minecraft table. Both give the same result, but now I'm wondering if I've got FastWorkbench or something... Just checked and I removed FastWorkbench a while ago.

In my Crafttweaker script I do a Shaped recipe. Previous to the one in the above pastebin, I did actually comb through a lot of ore dictionary stuff with a different script and it did touch the backpack. I'll check that.

Keaft commented 2 years ago

That was it! My original Crafttweaker script did in fact mess it up in the first place and then I tried to chase it with the other.

I think I should be able to remove the entries in the ore dictionary unification script without issue, but just in case, would you happen to have an insight into why my shaped recipe with appropriate nbt data still wouldn't write properly? You mentioning the shaped recipe is interesting and I'm wondering if there is a more "set in stone" function of the vanilla shaped recipe vs something more dynamic behind the scenes.

Flanks255 commented 2 years ago

So, the vanilla shaped recipe does nothing, i have a custom recipe type of "simplybackpacks:copyBackpack" that does the nbt copying. also the recipe doesnt need to change the size of the inventory itself, the backpack will do that next time it gets opened... i think, im pretty sure it just looks up how many slots the item should have, and uses that instead of whats stored.

Flanks255 commented 2 years ago

also it shouldnt need unification as it already uses oredictionary entries for everything. https://github.com/Flanks255/simplybackpacks/blob/1.12.2/src/main/resources/assets/simplybackpacks/recipes/epic.json

Keaft commented 2 years ago

Interesting. Yeah I was attempting to match the nbt exactly which accounts for the manual size in my script. I mostly did that because it wasn't working and I wanted to rule out as much as I could.

As for the ore dictionary unification, it's more of the unification of a priority mod list. So like Thermal Foundation's Copper should override all other recipes involving copper whether they are ore dictionaried or not. In the case of the backpacks, the uncommon uses a gold block and the rare uses a diamond block. Both of those were on my list to unify under vanilla minecraft as chisel likes to have all of it's block variants as well. I don't think I'll run into any issues just removing gold and diamond off the list, but figured I'd nab as much information as I could get my hands on! :)

Flanks255 commented 2 years ago

could always just replace the recipe with a datapack if all else fails?

Keaft commented 2 years ago

So 1.12.2 unfortunately doesn't have the ability to do datapacks if I understand correctly. I look forward to wrapping up my 1.12.2 modpack once and for all. 1.18.1 looks like what I'm shooting for next. Has a good balance of updated vanilla content and appears to have some nice optimization mods as well.

But I digress. Thank you for being so helpful and answering some questions! It's exciting to learn all that I can to help design and develop my pack as best I can.