From 4b2cf81a029b5b9934ca6a3c2bb61ee48e6afce6 Mon Sep 17 00:00:00 2001 From: Majrusz Date: Sun, 18 Jul 2021 12:02:14 +0200 Subject: [PATCH] Added new tooltips to End Items --- .../com/majruszs_difficulty/features/end_items/EndItems.java | 1 + src/main/java/com/majruszs_difficulty/items/EndAxeItem.java | 2 +- src/main/java/com/majruszs_difficulty/items/EndHoeItem.java | 2 +- .../java/com/majruszs_difficulty/items/EndPickaxeItem.java | 2 +- .../java/com/majruszs_difficulty/items/EndShovelItem.java | 2 +- .../java/com/majruszs_difficulty/items/EndSwordItem.java | 5 ++--- .../resources/assets/majruszs_difficulty/lang/en_us.json | 3 +++ 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/majruszs_difficulty/features/end_items/EndItems.java b/src/main/java/com/majruszs_difficulty/features/end_items/EndItems.java index 8e37c1ce8..7c8b2a25d 100644 --- a/src/main/java/com/majruszs_difficulty/features/end_items/EndItems.java +++ b/src/main/java/com/majruszs_difficulty/features/end_items/EndItems.java @@ -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. */ diff --git a/src/main/java/com/majruszs_difficulty/items/EndAxeItem.java b/src/main/java/com/majruszs_difficulty/items/EndAxeItem.java index cc93c1588..f1d1a6982 100644 --- a/src/main/java/com/majruszs_difficulty/items/EndAxeItem.java +++ b/src/main/java/com/majruszs_difficulty/items/EndAxeItem.java @@ -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 ); } } diff --git a/src/main/java/com/majruszs_difficulty/items/EndHoeItem.java b/src/main/java/com/majruszs_difficulty/items/EndHoeItem.java index f63dfa512..d6967c1d4 100644 --- a/src/main/java/com/majruszs_difficulty/items/EndHoeItem.java +++ b/src/main/java/com/majruszs_difficulty/items/EndHoeItem.java @@ -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. */ diff --git a/src/main/java/com/majruszs_difficulty/items/EndPickaxeItem.java b/src/main/java/com/majruszs_difficulty/items/EndPickaxeItem.java index e2b508049..80ddb764f 100644 --- a/src/main/java/com/majruszs_difficulty/items/EndPickaxeItem.java +++ b/src/main/java/com/majruszs_difficulty/items/EndPickaxeItem.java @@ -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 ); } } diff --git a/src/main/java/com/majruszs_difficulty/items/EndShovelItem.java b/src/main/java/com/majruszs_difficulty/items/EndShovelItem.java index 45577a7e5..f3d7b8c53 100644 --- a/src/main/java/com/majruszs_difficulty/items/EndShovelItem.java +++ b/src/main/java/com/majruszs_difficulty/items/EndShovelItem.java @@ -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 ); } } diff --git a/src/main/java/com/majruszs_difficulty/items/EndSwordItem.java b/src/main/java/com/majruszs_difficulty/items/EndSwordItem.java index 54e0e956e..67625daeb 100644 --- a/src/main/java/com/majruszs_difficulty/items/EndSwordItem.java +++ b/src/main/java/com/majruszs_difficulty/items/EndSwordItem.java @@ -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; @@ -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() ); @@ -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 ); } } diff --git a/src/main/resources/assets/majruszs_difficulty/lang/en_us.json b/src/main/resources/assets/majruszs_difficulty/lang/en_us.json index 2fae931b7..c03c092f3 100644 --- a/src/main/resources/assets/majruszs_difficulty/lang/en_us.json +++ b/src/main/resources/assets/majruszs_difficulty/lang/en_us.json @@ -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",