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));
}
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));
}
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);
}
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);
}
Aggregations