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;
TitleS2CPacket times = new TitleS2CPacket(fadeInTicks, stayTicks, fadeOutTicks);
player.networkHandler.sendPacket(times);
if (title != null) {
TitleS2CPacket titlepkt = new TitleS2CPacket(TitleS2CPacket.Action.TITLE, new LiteralText(title));
player.networkHandler.sendPacket(titlepkt);
}
if (subtitle != null) {
TitleS2CPacket subtitlepkt = new TitleS2CPacket(TitleS2CPacket.Action.SUBTITLE, new LiteralText(subtitle));
player.networkHandler.sendPacket(subtitlepkt);
}
}
}
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().broadcastChatMessage(component, true);
Log.info(stripChatColor(msg));
}
use of net.minecraft.text.LiteralText in project dynmap by webbukkit.
the class FabricPlayer method sendMessage.
@Override
public void sendMessage(String msg) {
Text ichatcomponent = new LiteralText(msg);
player.sendMessage(ichatcomponent);
}
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().broadcastChatMessage(component, true);
Log.info(stripChatColor(msg));
}
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