xt9 / DeepMobLearning

Server friendly mob loot acquisition.
https://minecraft.curseforge.com/projects/deep-mob-learning
MIT License
32 stars 33 forks source link

Deep mob learner doesn't work with spectre anchor / normalizes its nbt #46

Open hacatu opened 5 years ago

hacatu commented 5 years ago

The spectre anchor from random things is a really overpowered item that adds an nbt tag to nonstackable items that makes them not lost on death. It can be applied to the deep mob learner, but upon opening the deep mob learner the tag it adds will be removed. I expect this is caused by either writing back only relevant parts of the nbt tag causing injected tags to be dropped, or possibly by actively stripping injected tags.

Based on a cursory look at the code, I think this is caused by the end of ItemDeepLearner.setContainedItems where the deep learner's tag is set to the list of items, rather than setting some field in the tag to the list. Unfortunately if that is the problem, a fixed version of the mod would have to either go through all items in the world and update the nbt of any old style deep mob learners, or (probably better) have the deep mob learner check for the old format when it would normally need to and update it if it is found.