Blood Magic

Blood Magic

90M Downloads

ItemInscriptionTool starts with no uses

agathezol opened this issue ยท 2 comments

commented

Issue Description:

The varients of the inscription tools do not start with any uses in survival mode single player or multi player worlds. Once bound to the player they have a single use before detecting uses as <= 0 and are removed.

What happens:

Item is removed on first use and cannot be recharged.

What you expected to happen:

Item should start with 10 uses, reduce uses as used, and allow recharging using LP.

For an example of both see: https://www.youtube.com/watch?v=ekWRUQStVeQ

Steps to reproduce:

  1. Startup minecraft
  2. Create tier3 blood altar
  3. Fill with blood, give yourself some obsidian and create some ritual stones
  4. Enter survival mode
  5. right click the blood alter with obsidian to create an earth inscription tool
  6. right click the air or ground or some other block to bind the tool to the player - note it now has zero charges left
  7. right click the ritual stone and the item will go away
    ...

Affected Versions (Do not use "latest"):

  • BloodMagic: 1.12.2-2.2.12-97 (commit 1096c69)
  • Minecraft: 1.12.2
  • Forge: 14.23.2.2611
commented

It is possible this is intentional as the "Ritual Diviner" can perform the task of building and colorizing the ritual stones so using the inscription tools individually isn't required. If so the text in the Sanguine Sientium should probably be updated to reflect this.

commented

If this is not intentional, this patch will allow the item to have 10 charges when it is created, and be destroyed after.

old mode 100644
new mode 100755
index 1566d5b..1ed252c
--- a/src/main/java/WayofTime/bloodmagic/ritual/EnumRuneType.java
+++ b/src/main/java/WayofTime/bloodmagic/ritual/EnumRuneType.java
@@ -2,6 +2,8 @@ package WayofTime.bloodmagic.ritual;
 
 import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
 import WayofTime.bloodmagic.item.types.ISubItem;
+import WayofTime.bloodmagic.util.Constants;
+import WayofTime.bloodmagic.util.helper.NBTHelper;
 import net.minecraft.item.ItemStack;
 import net.minecraft.util.IStringSerializable;
 import net.minecraft.util.text.TextFormatting;
@@ -44,7 +46,10 @@ public enum EnumRuneType implements IStringSerializable, ISubItem {
     @Nonnull
     @Override
     public ItemStack getStack(int count) {
-        return new ItemStack(RegistrarBloodMagicItems.INSCRIPTION_TOOL, count, ordinal());
+        ItemStack stack = new ItemStack(RegistrarBloodMagicItems.INSCRIPTION_TOOL, count, ordinal());
+        stack = NBTHelper.checkNBT(stack);
+        stack.getTagCompound().setInteger(Constants.NBT.USES, 10);
+        return stack;
     }
 
     public static EnumRuneType byMetadata(int meta) {