use of net.minecraft.util.text.Style in project GregTech by GregTechCE.
the class RecipeMapMultiblockController method addDisplayText.
@Override
protected void addDisplayText(List<ITextComponent> textList) {
super.addDisplayText(textList);
if (isStructureFormed()) {
IEnergyContainer energyContainer = recipeMapWorkable.getEnergyContainer();
if (energyContainer != null && energyContainer.getEnergyCapacity() > 0) {
long maxVoltage = energyContainer.getInputVoltage();
String voltageName = GTValues.VN[GTUtility.getTierByVoltage(maxVoltage)];
textList.add(new TextComponentTranslation("gregtech.multiblock.max_energy_per_tick", maxVoltage, voltageName));
}
if (!recipeMapWorkable.isWorkingEnabled()) {
textList.add(new TextComponentTranslation("gregtech.multiblock.work_paused"));
} else if (recipeMapWorkable.isActive()) {
textList.add(new TextComponentTranslation("gregtech.multiblock.running"));
int currentProgress = (int) (recipeMapWorkable.getProgressPercent() * 100);
textList.add(new TextComponentTranslation("gregtech.multiblock.progress", currentProgress));
} else {
textList.add(new TextComponentTranslation("gregtech.multiblock.idling"));
}
if (recipeMapWorkable.isHasNotEnoughEnergy()) {
textList.add(new TextComponentTranslation("gregtech.multiblock.not_enough_energy").setStyle(new Style().setColor(TextFormatting.RED)));
}
}
}
use of net.minecraft.util.text.Style in project GregTech by GregTechCE.
the class MultiblockWithDisplayBase method addDisplayText.
/**
* Called serverside to obtain text displayed in GUI
* each element of list is displayed on new line
* to use translation, use TextComponentTranslation
*/
protected void addDisplayText(List<ITextComponent> textList) {
if (!isStructureFormed()) {
ITextComponent tooltip = new TextComponentTranslation("gregtech.multiblock.invalid_structure.tooltip");
tooltip.setStyle(new Style().setColor(TextFormatting.GRAY));
textList.add(new TextComponentTranslation("gregtech.multiblock.invalid_structure").setStyle(new Style().setColor(TextFormatting.RED).setHoverEvent(new HoverEvent(Action.SHOW_TEXT, tooltip))));
}
}
use of net.minecraft.util.text.Style in project GregTech by GregTechCE.
the class CommandWorldgenReload method execute.
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) {
try {
WorldGenRegistry.INSTANCE.reinitializeRegisteredVeins();
sender.sendMessage(new TextComponentTranslation("gregtech.command.worldgen.reload.success").setStyle(new Style().setColor(TextFormatting.GREEN)));
} catch (IOException | RuntimeException exception) {
GTLog.logger.error("Failed to reload worldgen config", exception);
sender.sendMessage(new TextComponentTranslation("gregtech.command.worldgen.reload.failed").setStyle(new Style().setColor(TextFormatting.RED)));
}
}
use of net.minecraft.util.text.Style in project GregTech by GregTechCE.
the class ElectricBlastFurnaceInfo method generateBlockTooltips.
@Override
protected void generateBlockTooltips() {
super.generateBlockTooltips();
ITextComponent tooltip = new TextComponentTranslation("gregtech.multiblock.preview.limit", 10).setStyle(new Style().setColor(TextFormatting.AQUA));
addBlockTooltip(MetaBlocks.METAL_CASING.getItemVariant(MetalCasingType.INVAR_HEATPROOF), tooltip);
}
use of net.minecraft.util.text.Style in project GregTech by GregTechCE.
the class MultiSmelterInfo method generateBlockTooltips.
@Override
protected void generateBlockTooltips() {
super.generateBlockTooltips();
ITextComponent tooltip = new TextComponentTranslation("gregtech.multiblock.preview.limit", 9).setStyle(new Style().setColor(TextFormatting.AQUA));
addBlockTooltip(MetaBlocks.METAL_CASING.getItemVariant(MetalCasingType.INVAR_HEATPROOF), tooltip);
}
Aggregations