Skip to content

Commit

Permalink
fix: dictionary of spirits nbt sanitation not working
Browse files Browse the repository at this point in the history
Closes #1076
  • Loading branch information
klikli-dev committed Mar 11, 2024
1 parent a5102a9 commit 0d11adb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, Inte
//Copied from parent but statically gets DICTIONARY_OF_SPIRITS instead of from nbt
var itemInHand = pPlayer.getItemInHand(pUsedHand);

var pTag = itemInHand.getOrCreateTag();

if (!pTag.contains(ModonomiconConstants.Nbt.ITEM_BOOK_ID_TAG))
pTag.putString(ModonomiconConstants.Nbt.ITEM_BOOK_ID_TAG, DICTIONARY_OF_SPIRITS.toString());

if (pLevel.isClientSide) {

if (itemInHand.hasTag()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
}
],
"result": {
"item": "occultism:dictionary_of_spirits"
"item": "occultism:dictionary_of_spirits",
"nbt": {
"modonomicon:book_id": "occultism:dictionary_of_spirits"
}
}
}

0 comments on commit 0d11adb

Please sign in to comment.