Search in sources :

Example 1 with BuildingModes

use of com.direwolf20.buildinggadgets.common.items.modes.BuildingModes in project BuildingGadgets by Direwolf20-MC.

the class GadgetBuilding method appendHoverText.

@Override
public void appendHoverText(ItemStack stack, @Nullable Level world, List<Component> tooltip, TooltipFlag flag) {
    super.appendHoverText(stack, world, tooltip, flag);
    BuildingModes mode = getToolMode(stack);
    addEnergyInformation(tooltip, stack);
    tooltip.add(TooltipTranslation.GADGET_MODE.componentTranslation((mode == BuildingModes.SURFACE && getConnectedArea(stack) ? TooltipTranslation.GADGET_CONNECTED.format(new TranslatableComponent(mode.getTranslationKey()).getString()) : new TranslatableComponent(mode.getTranslationKey()))).setStyle(Styles.AQUA));
    tooltip.add(TooltipTranslation.GADGET_BLOCK.componentTranslation(LangUtil.getFormattedBlockName(getToolBlock(stack).getState())).setStyle(Styles.DK_GREEN));
    int range = getToolRange(stack);
    if (getToolMode(stack) != BuildingModes.BUILD_TO_ME)
        tooltip.add(TooltipTranslation.GADGET_RANGE.componentTranslation(range, getRangeInBlocks(range, mode.getMode())).setStyle(Styles.LT_PURPLE));
    if (getToolMode(stack) == BuildingModes.SURFACE)
        tooltip.add(TooltipTranslation.GADGET_FUZZY.componentTranslation(String.valueOf(getFuzzy(stack))).setStyle(Styles.GOLD));
    addInformationRayTraceFluid(tooltip, stack);
    tooltip.add(TooltipTranslation.GADGET_BUILDING_PLACE_ATOP.componentTranslation(String.valueOf(shouldPlaceAtop(stack))).setStyle(Styles.YELLOW));
}
Also used : TranslatableComponent(net.minecraft.network.chat.TranslatableComponent) BuildingModes(com.direwolf20.buildinggadgets.common.items.modes.BuildingModes)

Example 2 with BuildingModes

use of com.direwolf20.buildinggadgets.common.items.modes.BuildingModes in project BuildingGadgets-Fabric by St-ructure-Mods.

the class GadgetBuilding method appendHoverText.

@Override
public void appendHoverText(ItemStack stack, @Nullable Level world, List<Component> tooltip, TooltipFlag flag) {
    super.appendHoverText(stack, world, tooltip, flag);
    BuildingModes mode = getToolMode(stack);
    addEnergyInformation(tooltip, stack);
    tooltip.add(TooltipTranslation.GADGET_MODE.componentTranslation((mode == BuildingModes.SURFACE && getConnectedArea(stack) ? TooltipTranslation.GADGET_CONNECTED.format(new TranslatableComponent(mode.getTranslationKey()).getString()) : new TranslatableComponent(mode.getTranslationKey()))).setStyle(Styles.AQUA));
    tooltip.add(TooltipTranslation.GADGET_BLOCK.componentTranslation(LangUtil.getFormattedBlockName(getToolBlock(stack).getState())).setStyle(Styles.DK_GREEN));
    int range = getToolRange(stack);
    if (getToolMode(stack) != BuildingModes.BUILD_TO_ME)
        tooltip.add(TooltipTranslation.GADGET_RANGE.componentTranslation(range, getRangeInBlocks(range, mode.getMode())).setStyle(Styles.LT_PURPLE));
    if (getToolMode(stack) == BuildingModes.SURFACE)
        tooltip.add(TooltipTranslation.GADGET_FUZZY.componentTranslation(String.valueOf(getFuzzy(stack))).setStyle(Styles.GOLD));
    addInformationRayTraceFluid(tooltip, stack);
    tooltip.add(TooltipTranslation.GADGET_BUILDING_PLACE_ATOP.componentTranslation(String.valueOf(shouldPlaceAtop(stack))).setStyle(Styles.YELLOW));
}
Also used : TranslatableComponent(net.minecraft.network.chat.TranslatableComponent) BuildingModes(com.direwolf20.buildinggadgets.common.items.modes.BuildingModes)

Example 3 with BuildingModes

use of com.direwolf20.buildinggadgets.common.items.modes.BuildingModes in project BuildingGadgets-Fabric by St-ructure-Mods.

the class GadgetBuilding method setMode.

public void setMode(ItemStack heldItem, int modeInt) {
    // Called when we specify a mode with the radial menu
    BuildingModes mode = BuildingModes.values()[modeInt];
    setToolMode(heldItem, mode);
}
Also used : BuildingModes(com.direwolf20.buildinggadgets.common.items.modes.BuildingModes)

Example 4 with BuildingModes

use of com.direwolf20.buildinggadgets.common.items.modes.BuildingModes in project BuildingGadgets by Direwolf20-MC.

the class GadgetBuilding method setMode.

public void setMode(ItemStack heldItem, int modeInt) {
    // Called when we specify a mode with the radial menu
    BuildingModes mode = BuildingModes.values()[modeInt];
    setToolMode(heldItem, mode);
}
Also used : BuildingModes(com.direwolf20.buildinggadgets.common.items.modes.BuildingModes)

Aggregations

BuildingModes (com.direwolf20.buildinggadgets.common.items.modes.BuildingModes)4 TranslatableComponent (net.minecraft.network.chat.TranslatableComponent)2