Search in sources :

Example 1 with SPacketTitle

use of net.minecraft.network.play.server.SPacketTitle in project Railcraft by Railcraft.

the class TrackKitMessenger method sendMessage.

protected void sendMessage(EntityMinecart cart) {
    cart.getRecursivePassengersByType(EntityPlayerMP.class).forEach(e -> {
        try {
            SPacketTitle pkt = new SPacketTitle(SPacketTitle.Type.SUBTITLE, TextComponentUtils.processComponent(cart, subtitle, e));
            e.connection.sendPacket(pkt);
            pkt = new SPacketTitle(SPacketTitle.Type.TITLE, TextComponentUtils.processComponent(cart, title, e));
            e.connection.sendPacket(pkt);
        } catch (CommandException ignored) {
        }
    });
}
Also used : EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) CommandException(net.minecraft.command.CommandException) SPacketTitle(net.minecraft.network.play.server.SPacketTitle)

Aggregations

CommandException (net.minecraft.command.CommandException)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 SPacketTitle (net.minecraft.network.play.server.SPacketTitle)1