net.minecraft.text.Style Java Examples

The following examples show how to use net.minecraft.text.Style. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GalacticraftCommands.java    From Galacticraft-Rewoven with MIT License 6 votes vote down vote up
private static int teleportMultiple(CommandContext<ServerCommandSource> context) {
    try {
        ServerWorld serverWorld = DimensionArgumentType.getDimensionArgument(context, "dimension");
        if (serverWorld == null) {
            context.getSource().sendError(new TranslatableText("commands.galacticraft-rewoven.dimensiontp.failure.dimension").setStyle(Style.EMPTY.withColor(Formatting.RED)));
            return -1;
        }

        Collection<? extends Entity> entities = EntityArgumentType.getEntities(context, "entities");
        entities.forEach((Consumer<Entity>) entity -> {
            entity.changeDimension(serverWorld);
            context.getSource().sendFeedback(new TranslatableText("commands.galacticraft-rewoven.dimensiontp.success.multiple", entities.size(), serverWorld.getRegistryKey().getValue()), true);
        });
    } catch (CommandSyntaxException ignore) {
        context.getSource().sendError(new TranslatableText("commands.galacticraft-rewoven.dimensiontp.failure.entity").setStyle(Style.EMPTY.withColor(Formatting.RED)));
        return -1;
    }
    return -1;
}
 
Example #2
Source File: GalacticraftCommands.java    From Galacticraft-Rewoven with MIT License 6 votes vote down vote up
private static int teleport(CommandContext<ServerCommandSource> context) {
    try {
        ServerWorld serverWorld = DimensionArgumentType.getDimensionArgument(context, "dimension");
        if (serverWorld == null) {
            context.getSource().sendError(new TranslatableText("commands.galacticraft-rewoven.dimensiontp.failure.dimension").setStyle(Style.EMPTY.withColor(Formatting.RED)));
            return -1;
        }

        context.getSource().getPlayer().changeDimension(serverWorld);
        context.getSource().sendFeedback(new TranslatableText("commands.galacticraft-rewoven.dimensiontp.success.single", serverWorld.getRegistryKey().getValue()), true);

    } catch (CommandSyntaxException ignore) {
        context.getSource().sendError(new TranslatableText("commands.galacticraft-rewoven.dimensiontp.failure.entity").setStyle(Style.EMPTY.withColor(Formatting.RED)));
        return -1;
    }
    return -1;
}
 
Example #3
Source File: OxygenCollectorScreen.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
@Override
public void drawMouseoverTooltip(MatrixStack stack, int mouseX, int mouseY) {
    super.drawMouseoverTooltip(stack, mouseX, mouseY);
    this.drawEnergyTooltip(stack, mouseX, mouseY, this.x + 11, this.y + 18);
    if (mouseX >= oxygenDisplayX && mouseX <= oxygenDisplayX + OVERLAY_WIDTH && mouseY >= oxygenDisplayY && mouseY <= oxygenDisplayY + OVERLAY_HEIGHT) {
        List<Text> toolTipLines = new ArrayList<>();
        toolTipLines.add(new TranslatableText("ui.galacticraft-rewoven.machine.current_oxygen", GalacticraftEnergy.GALACTICRAFT_JOULES.getDisplayAmount(this.handler.energy.get()).setStyle(Style.EMPTY.withColor(Formatting.BLUE))).setStyle(Style.EMPTY.withColor(Formatting.GOLD)));
        toolTipLines.add(new TranslatableText("ui.galacticraft-rewoven.machine.max_oxygen", GalacticraftEnergy.GALACTICRAFT_JOULES.getDisplayAmount(this.handler.getMaxEnergy())).setStyle(Style.EMPTY.withColor(Formatting.RED)));
        this.renderTooltip(stack, toolTipLines, mouseX, mouseY);
    }
}
 
Example #4
Source File: Messenger.java    From fabric-carpet with MIT License 5 votes vote down vote up
public static Style parseStyle(String style)
{
    //could be rewritten to be more efficient
    Style styleInstance = new Style();
    styleInstance.setItalic(style.indexOf('i')>=0);
    styleInstance.setStrikethrough(style.indexOf('s')>=0);
    styleInstance.setUnderline(style.indexOf('u')>=0);
    styleInstance.setBold(style.indexOf('b')>=0);
    styleInstance.setObfuscated(style.indexOf('o')>=0);
    styleInstance.setColor(Formatting.WHITE);
    if (style.indexOf('w')>=0) styleInstance.setColor(Formatting.WHITE); // not needed
    if (style.indexOf('y')>=0) styleInstance.setColor(Formatting.YELLOW);
    if (style.indexOf('m')>=0) styleInstance.setColor(Formatting.LIGHT_PURPLE);
    if (style.indexOf('r')>=0) styleInstance.setColor(Formatting.RED);
    if (style.indexOf('c')>=0) styleInstance.setColor(Formatting.AQUA);
    if (style.indexOf('l')>=0) styleInstance.setColor(Formatting.GREEN);
    if (style.indexOf('t')>=0) styleInstance.setColor(Formatting.BLUE);
    if (style.indexOf('f')>=0) styleInstance.setColor(Formatting.DARK_GRAY);
    if (style.indexOf('g')>=0) styleInstance.setColor(Formatting.GRAY);
    if (style.indexOf('d')>=0) styleInstance.setColor(Formatting.GOLD);
    if (style.indexOf('p')>=0) styleInstance.setColor(Formatting.DARK_PURPLE);
    if (style.indexOf('n')>=0) styleInstance.setColor(Formatting.DARK_RED);
    if (style.indexOf('q')>=0) styleInstance.setColor(Formatting.DARK_AQUA);
    if (style.indexOf('e')>=0) styleInstance.setColor(Formatting.DARK_GREEN);
    if (style.indexOf('v')>=0) styleInstance.setColor(Formatting.DARK_BLUE);
    if (style.indexOf('k')>=0) styleInstance.setColor(Formatting.BLACK);
    return styleInstance;
}
 
Example #5
Source File: WLabel.java    From LibGui with MIT License 5 votes vote down vote up
/**
 * Gets the text style at the specific widget-space coordinates.
 *
 * @param x the X coordinate in widget space
 * @param y the Y coordinate in widget space
 * @return the text style at the position, or null if not found
 */
@Environment(EnvType.CLIENT)
@Nullable
public Style getTextStyleAt(int x, int y) {
	if (isWithinBounds(x, y)) {
		return MinecraftClient.getInstance().textRenderer.getTextHandler().trimToWidth(text, x);
	}
	return null;
}
 
Example #6
Source File: WLabel.java    From LibGui with MIT License 5 votes vote down vote up
@Environment(EnvType.CLIENT)
@Override
public void onClick(int x, int y, int button) {
	Style hoveredTextStyle = getTextStyleAt(x, y);
	if (hoveredTextStyle != null) {
		Screen screen = MinecraftClient.getInstance().currentScreen;
		if (screen != null) {
			screen.handleTextClick(hoveredTextStyle);
		}
	}
}
 
Example #7
Source File: WLabel.java    From LibGui with MIT License 5 votes vote down vote up
@Override
public void paint(MatrixStack matrices, int x, int y, int mouseX, int mouseY) {
	MinecraftClient mc = MinecraftClient.getInstance();
	TextRenderer renderer = mc.textRenderer;
	int yOffset;

	switch (verticalAlignment) {
		case CENTER:
			yOffset = height / 2 - renderer.fontHeight / 2;
			break;
		case BOTTOM:
			yOffset = height - renderer.fontHeight;
			break;
		case TOP:
		default:
			yOffset = 0;
			break;
	}

	ScreenDrawing.drawString(matrices, text, horizontalAlignment, x, y + yOffset, this.getWidth(), LibGuiClient.config.darkMode ? darkmodeColor : color);

	Style hoveredTextStyle = getTextStyleAt(mouseX, mouseY);
	if (hoveredTextStyle != null) {
		Screen screen = MinecraftClient.getInstance().currentScreen;
		if (screen instanceof TextHoverRendererScreen) {
			((TextHoverRendererScreen) screen).renderTextHover(matrices, hoveredTextStyle, x + mouseX, y + mouseY);
		}
	}
}
 
Example #8
Source File: WText.java    From LibGui with MIT License 5 votes vote down vote up
@Environment(EnvType.CLIENT)
@Override
public void onClick(int x, int y, int button) {
	if (button != 0) return; // only left clicks

	Style hoveredTextStyle = getTextStyleAt(x, y);
	if (hoveredTextStyle != null) {
		MinecraftClient.getInstance().currentScreen.handleTextClick(hoveredTextStyle);
	}
}
 
Example #9
Source File: WText.java    From LibGui with MIT License 5 votes vote down vote up
@Environment(EnvType.CLIENT)
@Override
public void paint(MatrixStack matrices, int x, int y, int mouseX, int mouseY) {
	if (wrappedLines == null || wrappingScheduled) {
		wrapLines();
		wrappingScheduled = false;
	}

	TextRenderer font = MinecraftClient.getInstance().textRenderer;

	int yOffset;
	switch (verticalAlignment) {
		case CENTER:
			yOffset = height / 2 - font.fontHeight * wrappedLines.size() / 2;
			break;
		case BOTTOM:
			yOffset = height - font.fontHeight * wrappedLines.size();
			break;
		case TOP:
		default:
			yOffset = 0;
			break;
	}

	for (int i = 0; i < wrappedLines.size(); i++) {
		StringRenderable line = wrappedLines.get(i);
		int c = LibGuiClient.config.darkMode ? darkmodeColor : color;

		ScreenDrawing.drawString(matrices, line, horizontalAlignment, x, y + yOffset + i * font.fontHeight, width, c);
	}

	Style hoveredTextStyle = getTextStyleAt(mouseX, mouseY);
	if (hoveredTextStyle != null) {
		Screen screen = MinecraftClient.getInstance().currentScreen;
		if (screen instanceof TextHoverRendererScreen) {
			((TextHoverRendererScreen) screen).renderTextHover(matrices, hoveredTextStyle, x + mouseX, y + mouseY);
		}
	}
}
 
Example #10
Source File: WText.java    From LibGui with MIT License 5 votes vote down vote up
/**
 * Gets the text style at the specific widget-space coordinates.
 *
 * @param x the X coordinate in widget space
 * @param y the Y coordinate in widget space
 * @return the text style at the position, or null if not found
 */
@Environment(EnvType.CLIENT)
@Nullable
public Style getTextStyleAt(int x, int y) {
	TextRenderer font = MinecraftClient.getInstance().textRenderer;
	int lineIndex = y / font.fontHeight;

	if (lineIndex >= 0 && lineIndex < wrappedLines.size()) {
		StringRenderable line = wrappedLines.get(lineIndex);
		return font.getTextHandler().trimToWidth(line, x);
	}

	return null;
}
 
Example #11
Source File: BatteryItem.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
@Override
@Environment(EnvType.CLIENT)
public void appendTooltip(ItemStack stack, World world, List<Text> lines, TooltipContext context) {
    int charge = stack.getOrCreateTag().getInt("Energy");
    if (stack.getMaxDamage() - stack.getDamage() < 3334) {
        lines.add(new TranslatableText("tooltip.galacticraft-rewoven.energy-remaining", charge).setStyle(Style.EMPTY.withColor(Formatting.DARK_RED)));
    } else if (stack.getMaxDamage() - stack.getDamage() < 6667) {
        lines.add(new TranslatableText("tooltip.galacticraft-rewoven.energy-remaining", charge).setStyle(Style.EMPTY.withColor(Formatting.GOLD)));
    } else {
        lines.add(new TranslatableText("tooltip.galacticraft-rewoven.energy-remaining", charge).setStyle(Style.EMPTY.withColor(Formatting.GREEN)));
    }
    super.appendTooltip(stack, world, lines, context);
}
 
Example #12
Source File: StandardWrenchItem.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
@Override
@Environment(EnvType.CLIENT)
public void appendTooltip(ItemStack itemStack_1, World world_1, List<Text> list_1, TooltipContext tooltipContext_1) {
    if (Screen.hasShiftDown()) {
        list_1.add(new TranslatableText("tooltip.galacticraft-rewoven.standard_wrench").setStyle(Style.EMPTY.withColor(Formatting.GRAY)));
    } else {
        list_1.add(new TranslatableText("tooltip.galacticraft-rewoven.press_shift").setStyle(Style.EMPTY.withColor(Formatting.GRAY)));
    }
}
 
Example #13
Source File: BasicSolarPanelScreen.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
@Override
@NotNull
protected Collection<? extends Text> getEnergyTooltipLines() {
    List<Text> lines = new ArrayList<>();
    if (this.handler.blockEntity.status != BasicSolarPanelBlockEntity.BasicSolarPanelStatus.FULL
            && this.handler.blockEntity.status != BasicSolarPanelBlockEntity.BasicSolarPanelStatus.BLOCKED) {
        long time = world.getTimeOfDay() % 24000;
        if (time > 6000) {
            lines.add(new TranslatableText("ui.galacticraft-rewoven.machine.gj_per_t", (int) (((6000D - (time - 6000D)) / 705.882353D) + 0.5D) * this.handler.blockEntity.multiplier).setStyle(Style.EMPTY.withColor(Formatting.LIGHT_PURPLE)));
        } else {
            lines.add(new TranslatableText("ui.galacticraft-rewoven.machine.gj_per_t", (int) ((time / 705.882353D) + 0.5D) * this.handler.blockEntity.multiplier).setStyle(Style.EMPTY.withColor(Formatting.LIGHT_PURPLE)));
        }
    }
    return lines;
}
 
Example #14
Source File: MachineHandledScreen.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
protected void drawEnergyTooltip(MatrixStack stack, int mouseX, int mouseY, int energyX, int energyY) {
    if (check(mouseX, mouseY, energyX, energyY, Constants.TextureCoordinates.OVERLAY_WIDTH, Constants.TextureCoordinates.OVERLAY_HEIGHT)) {
        List<Text> lines = new ArrayList<>();
        if (handler.blockEntity.getStatusForTooltip() != null) {
            lines.add(new TranslatableText("ui.galacticraft-rewoven.machine.status").setStyle(Style.EMPTY.withColor(Formatting.GRAY)).append(this.handler.blockEntity.getStatusForTooltip().getText()));
        }

        lines.add(new TranslatableText("ui.galacticraft-rewoven.machine.current_energy").setStyle(Style.EMPTY.withColor(Formatting.GOLD)).append(GalacticraftEnergy.GALACTICRAFT_JOULES.getDisplayAmount(this.handler.energy.get()).setStyle(Style.EMPTY.withColor(Formatting.BLUE))));
        lines.add(new TranslatableText("ui.galacticraft-rewoven.machine.max_energy").setStyle(Style.EMPTY.withColor(Formatting.RED)).append(GalacticraftEnergy.GALACTICRAFT_JOULES.getDisplayAmount(this.handler.getMaxEnergy()).setStyle(Style.EMPTY.withColor(Formatting.BLUE))));
        lines.addAll(getEnergyTooltipLines());

        this.renderTooltip(stack, lines, mouseX, mouseY);
    }
}
 
Example #15
Source File: CompressorScreen.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
@Override
public void drawMouseoverTooltip(MatrixStack stack, int mouseX, int mouseY) {
    super.drawMouseoverTooltip(stack, mouseX, mouseY);
    if (mouseX >= this.x - 22 && mouseX <= this.x && mouseY >= this.y + 3 && mouseY <= this.y + (22 + 3)) {
        this.renderTooltip(stack, new TranslatableText("ui.galacticraft-rewoven.tabs.side_config").setStyle(Style.EMPTY.withColor(Formatting.GRAY)), mouseX, mouseY);
    }
}
 
Example #16
Source File: CompressorBlock.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
@Override
@Environment(EnvType.CLIENT)
public final void buildTooltip(ItemStack itemStack_1, BlockView blockView_1, List<Text> list_1, TooltipContext tooltipContext_1) {
    if (Screen.hasShiftDown()) {
        list_1.add(new TranslatableText("tooltip.galacticraft-rewoven.compressor").setStyle(Style.EMPTY.withColor(Formatting.GRAY)));
    } else {
        list_1.add(new TranslatableText("tooltip.galacticraft-rewoven.press_shift").setStyle(Style.EMPTY.withColor(Formatting.GRAY)));
    }
}
 
Example #17
Source File: GlowstoneWallTorchBlock.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
@Override
@Environment(EnvType.CLIENT)
public void buildTooltip(ItemStack itemStack, BlockView blockView, List<Text> list, TooltipContext tooltipContext) {
    if (Screen.hasShiftDown()) {
        list.add(new TranslatableText("tooltip.galacticraft-rewoven.glowstone_torch").setStyle(Style.EMPTY.withColor(Formatting.GRAY)));
    } else {
        list.add(new TranslatableText("tooltip.galacticraft-rewoven.press_shift").setStyle(Style.EMPTY.withColor(Formatting.GRAY)));
    }
}
 
Example #18
Source File: GlowstoneTorchBlock.java    From Galacticraft-Rewoven with MIT License 5 votes vote down vote up
@Override
@Environment(EnvType.CLIENT)
public void buildTooltip(ItemStack itemStack, BlockView blockView, List<Text> list, TooltipContext tooltipContext) {
    if (Screen.hasShiftDown()) {
        list.add(new TranslatableText("tooltip.galacticraft-rewoven.glowstone_torch").setStyle(Style.EMPTY.withColor(Formatting.GRAY)));
    } else {
        list.add(new TranslatableText("tooltip.galacticraft-rewoven.press_shift").setStyle(Style.EMPTY.withColor(Formatting.GRAY)));
    }
}
 
Example #19
Source File: EnergyStorageModuleBlock.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
@Override
public Text machineInfo(ItemStack itemStack_1, BlockView blockView_1, TooltipContext tooltipContext_1) {
    return new TranslatableText("tooltip.galacticraft-rewoven.energy_storage_module").setStyle(Style.EMPTY.withColor(Formatting.GRAY));
}
 
Example #20
Source File: MachineHandledScreen.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
protected void drawTabTooltips(MatrixStack stack, int mouseX, int mouseY) {
    if (!IS_REDSTONE_OPEN) {
        if (mouseX >= this.x - REDSTONE_TAB_WIDTH && mouseX <= this.x && mouseY >= this.y + 3 && mouseY <= this.y + (22 + 3)) {
            this.renderTooltip(stack, new TranslatableText("ui.galacticraft-rewoven.tabs.redstone_activation_config").setStyle(Style.EMPTY.withColor(Formatting.GRAY)), mouseX, mouseY);
        }
    } else {
        if (mouseX >= (this.x - 78) && mouseX <= (this.x - 78) + 19 - 3 && mouseY >= this.y + 26 && mouseY <= this.y + 41) {
            this.renderTooltip(stack, new TranslatableText("ui.galacticraft-rewoven.tabs.redstone_activation_config.ignore").setStyle(Style.EMPTY.withColor(Formatting.WHITE)), mouseX, mouseY);
        }
        if (mouseX >= (this.x - 78) + 22 && mouseX <= (this.x - 78) + 41 - 3 && mouseY >= this.y + 26 && mouseY <= this.y + 41) {
            this.renderTooltip(stack, new TranslatableText("ui.galacticraft-rewoven.tabs.redstone_activation_config.redstone_means_off").setStyle(Style.EMPTY.withColor(Formatting.WHITE)), mouseX, mouseY);
        }
        if (mouseX >= (this.x - 78) + 44 && mouseX <= (this.x - 78) + 63 - 3 && mouseY >= this.y + 26 && mouseY <= this.y + 41) {
            this.renderTooltip(stack, new TranslatableText("ui.galacticraft-rewoven.tabs.redstone_activation_config.redstone_means_on").setStyle(Style.EMPTY.withColor(Formatting.WHITE)), mouseX, mouseY);
        }
    }
    if (!IS_CONFIG_OPEN) {
        if (IS_REDSTONE_OPEN) {
            if (mouseX >= this.x - REDSTONE_TAB_WIDTH && mouseX <= this.x && mouseY >= this.y + 96 && mouseY <= this.y + (REDSTONE_TAB_HEIGHT + 96)) {
                this.renderTooltip(stack, new TranslatableText("ui.galacticraft-rewoven.tabs.side_config").setStyle(Style.EMPTY.withColor(Formatting.WHITE)), mouseX, mouseY);
            }
        } else {
            if (mouseX >= this.x - REDSTONE_TAB_WIDTH && mouseX <= this.x && mouseY >= this.y + 26 && mouseY <= this.y + (REDSTONE_TAB_HEIGHT + 26)) {
                this.renderTooltip(stack, new TranslatableText("ui.galacticraft-rewoven.tabs.side_config").setStyle(Style.EMPTY.withColor(Formatting.WHITE)), mouseX, mouseY);
            }
        }
    } else {
        if (mouseX >= this.x - REDSTONE_PANEL_WIDTH + 43 - 3 - 5 && mouseX + 48 <= this.x && mouseY >= this.y + 49 + 3 + 18 && mouseY <= this.y + 68 + 18) {
            this.renderTooltip(stack, Lists.asList(new TranslatableText("ui.galacticraft-rewoven.tabs.side_config.north").setStyle(Style.EMPTY.withColor(Formatting.GRAY)), new Text[]{this.sideOptions.get(BlockFace.FRONT).getFormattedName()}), mouseX, mouseY);
        }

        if (mouseX >= this.x - REDSTONE_PANEL_WIDTH + 43 - 3 - 5 + 19 + 19 && mouseX + 48 - 19 - 19 <= this.x && mouseY >= this.y + 49 + 3 + 18 && mouseY <= this.y + 68 + 18) {//Front, Back, Right, Left, Up, Down
            this.renderTooltip(stack, Lists.asList(new TranslatableText("ui.galacticraft-rewoven.tabs.side_config.south").setStyle(Style.EMPTY.withColor(Formatting.GRAY)), new Text[]{this.sideOptions.get(BlockFace.BACK).getFormattedName()}), mouseX, mouseY);
        }

        if (mouseX >= this.x - REDSTONE_PANEL_WIDTH + 43 - 3 - 5 - 19 && mouseX + 48 + 19 <= this.x && mouseY >= this.y + 49 + 3 + 18 && mouseY <= this.y + 68 + 18) {
            this.renderTooltip(stack, Lists.asList(new TranslatableText("ui.galacticraft-rewoven.tabs.side_config.west").setStyle(Style.EMPTY.withColor(Formatting.GRAY)), new Text[]{this.sideOptions.get(BlockFace.RIGHT).getFormattedName()}), mouseX, mouseY);
        }

        if (mouseX >= this.x - REDSTONE_PANEL_WIDTH + 43 - 3 - 5 + 19 && mouseX + 48 - 19 <= this.x && mouseY >= this.y + 49 + 3 + 18 && mouseY <= this.y + 68 + 18) {
            this.renderTooltip(stack, Lists.asList(new TranslatableText("ui.galacticraft-rewoven.tabs.side_config.east").setStyle(Style.EMPTY.withColor(Formatting.GRAY)), new Text[]{this.sideOptions.get(BlockFace.LEFT).getFormattedName()}), mouseX, mouseY);
        }

        if (mouseX >= this.x - REDSTONE_PANEL_WIDTH + 43 - 3 - 5 && mouseX + 48 <= this.x && mouseY >= this.y + 49 + 3 && mouseY <= this.y + 68) {
            this.renderTooltip(stack, Lists.asList(new TranslatableText("ui.galacticraft-rewoven.tabs.side_config.up").setStyle(Style.EMPTY.withColor(Formatting.GRAY)), new Text[]{this.sideOptions.get(BlockFace.TOP).getFormattedName()}), mouseX, mouseY);
        }

        if (mouseX >= this.x - REDSTONE_PANEL_WIDTH + 43 - 3 - 5 && mouseX + 48 <= this.x && mouseY >= this.y + 49 + 3 + 18 + 18 && mouseY <= this.y + 68 + 18 + 18) {
            this.renderTooltip(stack, Lists.asList(new TranslatableText("ui.galacticraft-rewoven.tabs.side_config.down").setStyle(Style.EMPTY.withColor(Formatting.GRAY)), new Text[]{this.sideOptions.get(BlockFace.BOTTOM).getFormattedName()}), mouseX, mouseY);
        }
    }
    if (!IS_SECURITY_OPEN) {
        if (mouseX >= this.x - SECURITY_TAB_WIDTH + 176 + 21 && mouseX <= this.x + 176 + 21 && mouseY >= this.y + 3 && mouseY <= this.y + (SECURITY_TAB_HEIGHT + 3)) {
            this.renderTooltip(stack, new TranslatableText("ui.galacticraft-rewoven.tabs.security_config").setStyle(Style.EMPTY.withColor(Formatting.GRAY)), mouseX, mouseY);
        }
    } else {
        if (mouseX >= (this.x - 78) + 273 && mouseX <= (this.x - 78) + 19 + 273 - 3 && mouseY >= this.y + 26 && mouseY <= this.y + 41) {
            this.renderTooltip(stack, new TranslatableText("ui.galacticraft-rewoven.tabs.security_config.private").setStyle(Style.EMPTY.withColor(Formatting.WHITE)), mouseX, mouseY);
        }
        if (mouseX >= (this.x - 78) + 22 + 273 && mouseX <= (this.x - 78) + 41 + 273 - 3 && mouseY >= this.y + 26 && mouseY <= this.y + 41) {
            this.renderTooltip(stack, this.client.textRenderer.wrapLines(new TranslatableText("ui.galacticraft-rewoven.tabs.security_config.space_race", "[TEAM NAME]\u00a7r").setStyle(Style.EMPTY.withColor(Formatting.WHITE)), 150), mouseX, mouseY);
        }
        if (mouseX >= (this.x - 78) + 44 + 273 && mouseX <= (this.x - 78) + 63 + 273 - 3 && mouseY >= this.y + 26 && mouseY <= this.y + 41) {
            this.renderTooltip(stack, new TranslatableText("ui.galacticraft-rewoven.tabs.security_config.public").setStyle(Style.EMPTY.withColor(Formatting.WHITE)), mouseX, mouseY);
        }
    }
}
 
Example #21
Source File: CircuitFabricatorBlockEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
CircuitFabricatorStatus(TranslatableText text, Formatting color) {
    this.text = text.setStyle(Style.EMPTY.withColor(color));
}
 
Example #22
Source File: CoalGeneratorBlockEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
CoalGeneratorStatus(TranslatableText text, Formatting color) {
    this.text = text.setStyle(Style.EMPTY.withColor(color));
}
 
Example #23
Source File: OxygenCollectorBlockEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
OxygenCollectorStatus(TranslatableText text, Formatting color) {
    this.text = text.setStyle(Style.EMPTY.withColor(color));
}
 
Example #24
Source File: ElectricCompressorBlockEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
ElectricCompressorStatus(TranslatableText text, Formatting color) {
    this.text = text.setStyle(Style.EMPTY.withColor(color));
}
 
Example #25
Source File: CompressorBlockEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
CompressorStatus(TranslatableText text, Formatting color) {
    this.text = text.setStyle(Style.EMPTY.withColor(color));
}
 
Example #26
Source File: BasicSolarPanelBlockEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
BasicSolarPanelStatus(TranslatableText text, Formatting color) {
    this.text = text.setStyle(Style.EMPTY.withColor(color));
}
 
Example #27
Source File: CottonClientScreen.java    From LibGui with MIT License 4 votes vote down vote up
@Override
public void renderTextHover(MatrixStack matrices, Style textStyle, int x, int y) {
	renderTextHoverEffect(matrices, textStyle, x, y);
}
 
Example #28
Source File: CottonInventoryScreen.java    From LibGui with MIT License 4 votes vote down vote up
@Override
public void renderTextHover(MatrixStack matrices, Style textStyle, int x, int y) {
	renderTextHoverEffect(matrices, textStyle, x, y);
}
 
Example #29
Source File: RefineryBlockEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
RefineryStatus(TranslatableText text, Formatting color) {
    this.text = text.setStyle(Style.EMPTY.withColor(color));
}
 
Example #30
Source File: ElectricCompressorBlock.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
@Override
public Text machineInfo(ItemStack itemStack_1, BlockView blockView_1, TooltipContext tooltipContext_1) {
    return new TranslatableText("tooltip.galacticraft-rewoven.electric_compressor").setStyle(Style.EMPTY.withColor(Formatting.GRAY));
}