Skip to content

Commit

Permalink
This fixes Botania creative tab breaking and shouldn't affect the rin…
Browse files Browse the repository at this point in the history
…g itself (GTNewHorizons#34)

* This fixes creative tab breaking and shouldn't affect the ring itself

* Adding change suggest by OneEyeMaker, placed check for tag compound inside of isRingEnabled and isRingBreaking methods.

* Forgot that bit. :)
  • Loading branch information
Cardinalstars authored and DrParadox7 committed Jun 1, 2024
1 parent 802dc87 commit f7eed81
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/java/vazkii/botania/common/item/relic/ItemLokiRing.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,19 @@ public static String getLokiCearText(ItemStack stack){
}

public static boolean isRingEnabled (final ItemStack stack){
return stack.stackTagCompound.getBoolean(TAG_MODE);
if (stack.hasTagCompound())
{
return stack.stackTagCompound.getBoolean(TAG_MODE);
}
return false;
}

public static boolean isRingBreakingEnabled (final ItemStack stack){
return stack.stackTagCompound.getBoolean(TAG_BREAKING_MODE);
if (stack.hasTagCompound())
{
return stack.stackTagCompound.getBoolean(TAG_BREAKING_MODE);
}
return false;
}

public static void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) {
Expand Down Expand Up @@ -292,7 +300,7 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.lokiDescription"), list);
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.lokiDescription2"), list);
addStringToTooltip("", list);
addStringToTooltip(EnumChatFormatting.WHITE +StatCollector.translateToLocal("botaniamisc.lokiCurrent"), list);
addStringToTooltip(EnumChatFormatting.WHITE +StatCollector.translateToLocal("botaniamisc.lokiCurrent"), list);
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.lokiState") + ": " + getOnOffString(isRingEnabled(stack)), list);
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.breaking") + ": " + getOnOffString(isRingBreakingEnabled(stack)), list);
addStringToTooltip("", list);
Expand Down

0 comments on commit f7eed81

Please sign in to comment.