Skip to content

Commit

Permalink
fix: spirit name random despite using renamed dictionary
Browse files Browse the repository at this point in the history
Closes #1198
  • Loading branch information
klikli-dev committed Aug 29, 2024
1 parent dfc1b0c commit acfa07e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public BookOfBindingBoundItem(Item.Properties properties) {
super(properties);
}


@Override
public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List<Component> tooltip,
TooltipFlag flagIn) {
Expand All @@ -49,10 +48,9 @@ public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List<Compo
TextUtil.formatDemonName(ItemNBTUtil.getBoundSpiritName(stack))));
}


@Override
public void onCraftedBy(ItemStack pStack, Level pLevel, Player pPlayer) {
ItemNBTUtil.generateBoundSpiritName(pStack);
ItemNBTUtil.generateBoundSpiritNameIfNone(pStack);
super.onCraftedBy(pStack, pLevel, pPlayer);
}
}
5 changes: 5 additions & 0 deletions src/main/java/com/klikli_dev/occultism/util/ItemNBTUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ public static void updateItemNBTFromEntity(ItemStack stack, SpiritEntity entity)
if (job.getManagedMachine() != null)
ItemNBTUtil.setManagedMachine(stack, job.getManagedMachine());
});
}

public static void generateBoundSpiritNameIfNone(ItemStack stack) {
if(!stack.hasTag() && !stack.getTag().contains(SPIRIT_NAME_TAG)) {
generateBoundSpiritName(stack);
}
}

public static void generateBoundSpiritName(ItemStack stack) {
Expand Down

0 comments on commit acfa07e

Please sign in to comment.