Search in sources :

Example 66 with TranslatableText

use of net.minecraft.text.TranslatableText in project CopperEquipment by Redy1aye.

the class XmasCookie method appendTooltip.

@Override
public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) {
    tooltip.add(new TranslatableText(xmasEventCongrats));
    super.appendTooltip(stack, world, tooltip, context);
}
Also used : TranslatableText(net.minecraft.text.TranslatableText)

Example 67 with TranslatableText

use of net.minecraft.text.TranslatableText in project CopperEquipment by Redy1aye.

the class CandySwordSkin method appendTooltip.

@Override
public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) {
    tooltip.add(new TranslatableText(xmasEventCongrats));
    tooltip.add(new TranslatableText(" "));
    tooltip.add(new TranslatableText(skinInfo));
    tooltip.add(new TranslatableText(skinSuitable + "candy_sword_skin"));
    super.appendTooltip(stack, world, tooltip, context);
}
Also used : TranslatableText(net.minecraft.text.TranslatableText)

Example 68 with TranslatableText

use of net.minecraft.text.TranslatableText in project LittleMaidReBirth-Fabric by SistrScarlet.

the class LittleMaidScreen method drawForeground.

@Override
protected void drawForeground(MatrixStack matrices, int mouseX, int mouseY) {
    RenderSystem.disableBlend();
    this.textRenderer.draw(matrices, this.stateText.getString(), 8F, 65F, 0x404040);
    String insideSkirt = new TranslatableText("entity.littlemaidrebirth.little_maid_mob.InsideSkirt").getString();
    this.textRenderer.draw(matrices, insideSkirt, 168F - textRenderer.getWidth(insideSkirt), 65F, 0x404040);
    float left = (width - backgroundWidth) / 2F;
    float top = (height - backgroundHeight) / 2F;
    if (left + 7 <= mouseX && mouseX < left + 96 && top + 7 <= mouseY && mouseY < top + 60) {
        drawArmor(matrices);
    } else {
        drawHealth(matrices, mouseX, mouseY);
    }
}
Also used : TranslatableText(net.minecraft.text.TranslatableText)

Example 69 with TranslatableText

use of net.minecraft.text.TranslatableText in project LittleMaidReBirth-Fabric by SistrScarlet.

the class LittleMaidScreen method getStateText.

public Text getStateText() {
    MutableText stateText = new TranslatableText("state." + LittleMaidReBirthMod.MODID + "." + openAt.getMovingState().getName());
    openAt.getModeName().ifPresent(modeName -> stateText.append(" : ").append(new TranslatableText("mode." + LittleMaidReBirthMod.MODID + "." + modeName)));
    return stateText;
}
Also used : MutableText(net.minecraft.text.MutableText) TranslatableText(net.minecraft.text.TranslatableText)

Example 70 with TranslatableText

use of net.minecraft.text.TranslatableText in project LittleMaidReBirth-Fabric by SistrScarlet.

the class IFFType method render.

@Environment(EnvType.CLIENT)
public void render(MatrixStack matrices, int x, int y, int mouseX, int mouseY) {
    TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
    textRenderer.drawWithShadow(matrices, new TranslatableText(entityType.getTranslationKey()), (float) x + 60, (float) y - textRenderer.fontHeight, 0xFFFFFFFF);
    if (renderClashed || !(entity instanceof LivingEntity))
        return;
    try {
        InventoryScreen.drawEntity(x, y, 15, mouseX, mouseY, (LivingEntity) entity);
    } catch (Exception e) {
        LOGGER.warn("描画処理がクラッシュしました。" + entityType + ":" + entity);
        e.printStackTrace();
        renderClashed = true;
        // 行われない終了処理を行う
        // ちょっと強引
        VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers();
        immediate.draw();
        EntityRenderDispatcher entityRenderDispatcher = MinecraftClient.getInstance().getEntityRenderDispatcher();
        entityRenderDispatcher.setRenderShadows(true);
        RenderSystem.popMatrix();
    }
}
Also used : TranslatableText(net.minecraft.text.TranslatableText) LivingEntity(net.minecraft.entity.LivingEntity) TextRenderer(net.minecraft.client.font.TextRenderer) EntityRenderDispatcher(net.minecraft.client.render.entity.EntityRenderDispatcher) Environment(net.fabricmc.api.Environment)

Aggregations

TranslatableText (net.minecraft.text.TranslatableText)161 LiteralText (net.minecraft.text.LiteralText)30 Text (net.minecraft.text.Text)19 ItemStack (net.minecraft.item.ItemStack)16 ArrayList (java.util.ArrayList)15 ButtonWidget (net.minecraft.client.gui.widget.ButtonWidget)14 List (java.util.List)12 MinecraftClient (net.minecraft.client.MinecraftClient)12 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)12 SPEInterface (eu.pb4.armorstandeditor.helpers.SPEInterface)9 LivingEntity (net.minecraft.entity.LivingEntity)9 PlayerEntity (net.minecraft.entity.player.PlayerEntity)8 ListTag (net.minecraft.nbt.ListTag)8 Formatting (net.minecraft.util.Formatting)8 BlockPos (net.minecraft.util.math.BlockPos)8 Environment (net.fabricmc.api.Environment)7 AbstractButtonWidget (net.minecraft.client.gui.widget.AbstractButtonWidget)7 Entity (net.minecraft.entity.Entity)7 Collection (java.util.Collection)6 ArmorStandPreset (eu.pb4.armorstandeditor.config.ArmorStandPreset)5