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