Skip to content

Commit

Permalink
Added new tooltips to End Items
Browse files Browse the repository at this point in the history
  • Loading branch information
Majrusz committed Jul 18, 2021
1 parent 429696e commit 4b2cf81
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static class Keys {
public static final String HASTE_TOOLTIP = "majruszs_difficulty.end_items.haste_tooltip";
public static final String BLEED_TOOLTIP = "majruszs_difficulty.end_items.bleed_tooltip";
public static final String LEVITATION_TOOLTIP = "majruszs_difficulty.end_items.levitation_tooltip";
public static final String TILL_TOOLTIP = "majruszs_difficulty.end_items.till_tooltip";
}

/** Returns whether item is either end tool or end sword. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public EndAxeItem() {
@OnlyIn( Dist.CLIENT )
public void addInformation( ItemStack itemStack, @Nullable World world, List< ITextComponent > tooltip, ITooltipFlag flag ) {
MajruszsHelper.addExtraTooltipIfDisabled( tooltip, Instances.END_SHARD_ORE.isEnabled() );
MajruszsHelper.addAdvancedTooltip( tooltip, flag, EndItems.Keys.HASTE_TOOLTIP );
MajruszsHelper.addAdvancedTooltips( tooltip, flag, EndItems.Keys.BLEED_TOOLTIP, EndItems.Keys.HASTE_TOOLTIP );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public ActionResultType onItemUse( ItemUseContext context ) {
@OnlyIn( Dist.CLIENT )
public void addInformation( ItemStack itemStack, @Nullable World world, List< ITextComponent > tooltip, ITooltipFlag flag ) {
MajruszsHelper.addExtraTooltipIfDisabled( tooltip, Instances.END_SHARD_ORE.isEnabled() );
MajruszsHelper.addAdvancedTooltip( tooltip, flag, EndItems.Keys.HASTE_TOOLTIP );
MajruszsHelper.addAdvancedTooltips( tooltip, flag, EndItems.Keys.BLEED_TOOLTIP, EndItems.Keys.HASTE_TOOLTIP, EndItems.Keys.LEVITATION_TOOLTIP, EndItems.Keys.TILL_TOOLTIP );
}

/** Tills nearby blocks in 3x1x3 grid around the context. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public EndPickaxeItem() {
@OnlyIn( Dist.CLIENT )
public void addInformation( ItemStack itemStack, @Nullable World world, List< ITextComponent > tooltip, ITooltipFlag flag ) {
MajruszsHelper.addExtraTooltipIfDisabled( tooltip, Instances.END_SHARD_ORE.isEnabled() );
MajruszsHelper.addAdvancedTooltip( tooltip, flag, EndItems.Keys.HASTE_TOOLTIP );
MajruszsHelper.addAdvancedTooltips( tooltip, flag, EndItems.Keys.HASTE_TOOLTIP, EndItems.Keys.LEVITATION_TOOLTIP );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public EndShovelItem() {
@OnlyIn( Dist.CLIENT )
public void addInformation( ItemStack itemStack, @Nullable World world, List< ITextComponent > tooltip, ITooltipFlag flag ) {
MajruszsHelper.addExtraTooltipIfDisabled( tooltip, Instances.END_SHARD_ORE.isEnabled() );
MajruszsHelper.addAdvancedTooltip( tooltip, flag, EndItems.Keys.HASTE_TOOLTIP );
MajruszsHelper.addAdvancedTooltips( tooltip, flag, EndItems.Keys.HASTE_TOOLTIP, EndItems.Keys.LEVITATION_TOOLTIP );
}
}
5 changes: 2 additions & 3 deletions src/main/java/com/majruszs_difficulty/items/EndSwordItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.majruszs_difficulty.Instances;
import com.majruszs_difficulty.MajruszsHelper;
import com.majruszs_difficulty.features.end_items.EndItems;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
Expand All @@ -17,8 +18,6 @@

/** New late game sword. */
public class EndSwordItem extends SwordItem {
private static final String TOOLTIP_TRANSLATION_KEY = "item.majruszs_difficulty.end_sword.item_tooltip";

public EndSwordItem() {
super( CustomItemTier.END, 3, -2.4f, ( new Item.Properties() ).group( Instances.ITEM_GROUP ).rarity( Rarity.UNCOMMON )
.isImmuneToFire() );
Expand All @@ -28,6 +27,6 @@ public EndSwordItem() {
@OnlyIn( Dist.CLIENT )
public void addInformation( ItemStack stack, @Nullable World world, List< ITextComponent > toolTip, ITooltipFlag flag ) {
MajruszsHelper.addExtraTooltipIfDisabled( toolTip, Instances.END_SHARD_ORE.isEnabled() );
MajruszsHelper.addAdvancedTooltip( toolTip, flag, TOOLTIP_TRANSLATION_KEY );
MajruszsHelper.addAdvancedTooltips( toolTip, flag, EndItems.Keys.BLEED_TOOLTIP, EndItems.Keys.HASTE_TOOLTIP );
}
}
3 changes: 3 additions & 0 deletions src/main/resources/assets/majruszs_difficulty/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@
"majruszs_difficulty.undead_army.south": "south",
"majruszs_difficulty.subtitle.undead_army.approaching": "Undead Army Approaching",
"majruszs_difficulty.subtitle.undead_army.wave_started": "Wave Started",
"majruszs_difficulty.end_items.bleed_tooltip": "Has a greater chance to inflict Bleeding effect on hit.",
"majruszs_difficulty.end_items.haste_tooltip": "Applies Haste effect whenever a block is destroyed.",
"majruszs_difficulty.end_items.levitation_tooltip": "Has a chance to inflict Levitation effect on hit.",
"majruszs_difficulty.end_items.till_tooltip": "Tills the ground in a 3x1x3 area.",
"majruszs_difficulty.items.undead_helmet": "Undead Army Helmet",
"majruszs_difficulty.items.undead_chestplate": "Undead Army Chestplate",
"majruszs_difficulty.items.undead_leggings": "Undead Army Leggings",
Expand Down

0 comments on commit 4b2cf81

Please sign in to comment.