Search in sources :

Example 21 with LiteralText

use of net.minecraft.text.LiteralText in project dynmap by webbukkit.

the class FabricServer method broadcastMessage.

@Override
public void broadcastMessage(String msg) {
    Text component = new LiteralText(msg);
    server.getPlayerManager().broadcast(component, MessageType.SYSTEM, Util.NIL_UUID);
    Log.info(stripChatColor(msg));
}
Also used : LiteralText(net.minecraft.text.LiteralText) Text(net.minecraft.text.Text) LiteralText(net.minecraft.text.LiteralText)

Example 22 with LiteralText

use of net.minecraft.text.LiteralText in project dynmap by webbukkit.

the class FabricCommandSender method sendMessage.

@Override
public void sendMessage(String msg) {
    if (sender != null) {
        Text ichatcomponent = new LiteralText(msg);
        sender.sendFeedback(ichatcomponent, false);
    }
}
Also used : LiteralText(net.minecraft.text.LiteralText) Text(net.minecraft.text.Text) LiteralText(net.minecraft.text.LiteralText)

Example 23 with LiteralText

use of net.minecraft.text.LiteralText in project dynmap by webbukkit.

the class FabricPlayer method sendTitleText.

/**
 * Send title and subtitle text (called from server thread)
 */
@Override
public void sendTitleText(String title, String subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks) {
    if (player != null) {
        ServerPlayerEntity player = this.player;
        TitleFadeS2CPacket times = new TitleFadeS2CPacket(fadeInTicks, stayTicks, fadeOutTicks);
        player.networkHandler.sendPacket(times);
        if (title != null) {
            TitleS2CPacket titlepkt = new TitleS2CPacket(new LiteralText(title));
            player.networkHandler.sendPacket(titlepkt);
        }
        if (subtitle != null) {
            SubtitleS2CPacket subtitlepkt = new SubtitleS2CPacket(new LiteralText(subtitle));
            player.networkHandler.sendPacket(subtitlepkt);
        }
    }
}
Also used : TitleFadeS2CPacket(net.minecraft.network.packet.s2c.play.TitleFadeS2CPacket) SubtitleS2CPacket(net.minecraft.network.packet.s2c.play.SubtitleS2CPacket) TitleS2CPacket(net.minecraft.network.packet.s2c.play.TitleS2CPacket) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity) LiteralText(net.minecraft.text.LiteralText)

Example 24 with LiteralText

use of net.minecraft.text.LiteralText in project dynmap by webbukkit.

the class FabricCommandSender method sendMessage.

@Override
public void sendMessage(String msg) {
    if (sender != null) {
        Text ichatcomponent = new LiteralText(msg);
        sender.sendFeedback(ichatcomponent, false);
    }
}
Also used : LiteralText(net.minecraft.text.LiteralText) Text(net.minecraft.text.Text) LiteralText(net.minecraft.text.LiteralText)

Example 25 with LiteralText

use of net.minecraft.text.LiteralText in project dynmap by webbukkit.

the class FabricPlayer method sendTitleText.

/**
 * Send title and subtitle text (called from server thread)
 */
@Override
public void sendTitleText(String title, String subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks) {
    if (player != null) {
        ServerPlayerEntity player = this.player;
        TitleFadeS2CPacket times = new TitleFadeS2CPacket(fadeInTicks, stayTicks, fadeOutTicks);
        player.networkHandler.sendPacket(times);
        if (title != null) {
            TitleS2CPacket titlepkt = new TitleS2CPacket(new LiteralText(title));
            player.networkHandler.sendPacket(titlepkt);
        }
        if (subtitle != null) {
            SubtitleS2CPacket subtitlepkt = new SubtitleS2CPacket(new LiteralText(subtitle));
            player.networkHandler.sendPacket(subtitlepkt);
        }
    }
}
Also used : TitleFadeS2CPacket(net.minecraft.network.packet.s2c.play.TitleFadeS2CPacket) SubtitleS2CPacket(net.minecraft.network.packet.s2c.play.SubtitleS2CPacket) TitleS2CPacket(net.minecraft.network.packet.s2c.play.TitleS2CPacket) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity) LiteralText(net.minecraft.text.LiteralText)

Aggregations

LiteralText (net.minecraft.text.LiteralText)354 Text (net.minecraft.text.Text)83 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)75 ServerCommandSource (net.minecraft.server.command.ServerCommandSource)50 TranslatableText (net.minecraft.text.TranslatableText)46 ItemStack (net.minecraft.item.ItemStack)42 MutableText (net.minecraft.text.MutableText)42 Screen (net.minecraft.client.gui.screen.Screen)39 ButtonWidget (net.minecraft.client.gui.widget.ButtonWidget)39 MatrixStack (net.minecraft.client.util.math.MatrixStack)33 Formatting (net.minecraft.util.Formatting)32 NbtCompound (net.minecraft.nbt.NbtCompound)30 HoverEvent (net.minecraft.text.HoverEvent)29 BaseText (net.minecraft.text.BaseText)26 Inject (org.spongepowered.asm.mixin.injection.Inject)25 ClickEvent (net.minecraft.text.ClickEvent)24 ArrayList (java.util.ArrayList)22 List (java.util.List)22 Identifier (net.minecraft.util.Identifier)22 IOException (java.io.IOException)21