Skip to content

Commit

Permalink
Tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
Leclowndu93150 committed Jun 19, 2024
1 parent 2871981 commit 7dc1a3c
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.leclowndu93150.modular_angelring.common;

import com.mojang.blaze3d.platform.InputConstants;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
Expand All @@ -22,6 +24,11 @@ public int getMaxStackSize(ItemStack stack) {
@Override
public void appendHoverText(@NotNull ItemStack pStack, @NotNull TooltipContext pContext, List<Component> pTooltipComponents, @NotNull TooltipFlag pTooltipFlag) {
pTooltipComponents.add(Component.literal("Allows you to configure your flight speed. (Range: 0% - 300%)").withStyle(ChatFormatting.GRAY));
pTooltipComponents.add(Component.literal("Shift for Info:").withStyle(ChatFormatting.GRAY));
if (InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(),InputConstants.KEY_LSHIFT)){
pTooltipComponents.add(Component.literal("Right-Click: +10% Speed").withStyle(ChatFormatting.GRAY));
pTooltipComponents.add(Component.literal("Shift + Right-Click: -10% Speed").withStyle(ChatFormatting.GRAY));
}
super.appendHoverText(pStack, pContext, pTooltipComponents, pTooltipFlag);
}
}

0 comments on commit 7dc1a3c

Please sign in to comment.