Skip to content

Commit

Permalink
throwing knife tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Uraneptus committed Aug 29, 2024
1 parent 81a1b6c commit 0a413a6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/generated/resources/assets/sullysmod/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@
"sullysmod.artifact.torn_cloth.desc": "A dirty torn off piece of clothing",
"sullysmod.artifact.torn_manuscript.desc": "Part of a manuscript with an unknown language",
"sullysmod.artifact.wide_ancient_skull.desc": "The head of an extinct animal with a strangely wide head and giant eye sockets",
"sullysmod.item.modifiers.thrown": "When Thrown:",
"sullysmod.item.throwing_knife.damage": " 2 Attack Damage",
"sullysmod.item.throwing_knife.damage.air": " 2 Airborne Bonus",
"sullysmod.itemGroup.artifacts": "Ancient Artifacts",
"sullysmod.jei.grindstone_polishing": "Polishing",
"sullysmod.jei.grindstone_polishing.info": "Right click to polish",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ItemParticleOption;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.Style;
import net.minecraft.server.level.ServerPlayer;
Expand Down Expand Up @@ -184,6 +185,12 @@ public static void onItemTooltip(ItemTooltipEvent event) {
}
}
}
if (itemstack.is(SMItems.THROWING_KNIFE.get())) {
event.getToolTip().add(CommonComponents.EMPTY);
event.getToolTip().add(SMTextDefinitions.WHEN_THROWN_TOOLTIP);
event.getToolTip().add(SMTextDefinitions.THROWING_KNIFE_DAMAGE);
event.getToolTip().add(SMTextDefinitions.THROWING_KNIFE_AIR_DAMAGE);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public class SMTextDefinitions {
public static Component JADE_UPGRADE_BASE_SLOT_DESCRIPTION;
public static Component JADE_UPGRADE_ADDITIONS_SLOT_DESCRIPTION;
public static Component ARTIFACT_TAB_TITLE;
public static Component WHEN_THROWN_TOOLTIP;
public static Component THROWING_KNIFE_DAMAGE;
public static Component THROWING_KNIFE_AIR_DAMAGE;

//ADVANCEMENTS
public static final String ADVENTURE_PATH = "advancements.adventure.";
Expand Down Expand Up @@ -84,6 +87,10 @@ public static void init() {
FIND_TABLETS_ADV = SMTextUtil.addAdvancementTranslatables(ADVENTURE_PATH + FIND_TABLETS_ADV_NAME, "The boogeyman", "Find both ancient tablets");
ALL_FOSSILS_ADV = SMTextUtil.addAdvancementTranslatables(ADVENTURE_PATH + ALL_FOSSILS_ADV_NAME, "Medusa's been busy", "Find all fossils");
ALL_ARTIFACTS_ADV = SMTextUtil.addAdvancementTranslatables(ADVENTURE_PATH + ALL_ARTIFACTS_ADV_NAME, "A grand collection", "Find all artifacts");
WHEN_THROWN_TOOLTIP = SMTextUtil.addSMTranslatable("item.modifiers.thrown", "When Thrown:").withStyle(ChatFormatting.GRAY);
THROWING_KNIFE_DAMAGE = SMTextUtil.addSMTranslatable("item.throwing_knife.damage", " 2 Attack Damage").withStyle(ChatFormatting.DARK_GREEN);
THROWING_KNIFE_AIR_DAMAGE = SMTextUtil.addSMTranslatable("item.throwing_knife.damage.air", " 2 Airborne Bonus").withStyle(ChatFormatting.GOLD);

}

private static ResourceLocation jadeUpgradeString(String suffix) {
Expand Down

0 comments on commit 0a413a6

Please sign in to comment.