Package net.glowstone.util

Examples of net.glowstone.util.TextMessage


import java.io.IOException;

public final class ChatCodec implements Codec<ChatMessage> {
    @Override
    public ChatMessage decode(ByteBuf buf) throws IOException {
        TextMessage message = GlowBufUtils.readChat(buf);
        int mode = buf.readByte();
        return new ChatMessage(message, mode);
    }
View Full Code Here


    private final TextMessage text;
    private final int mode;

    public ChatMessage(JSONObject json) {
        this(new TextMessage(json), 0);
    }
View Full Code Here

    public ChatMessage(JSONObject json) {
        this(new TextMessage(json), 0);
    }

    public ChatMessage(String text) {
        this(new TextMessage(text), 0);
    }
View Full Code Here

            throw new IllegalArgumentException();
        }

        TextMessage[] encoded = new TextMessage[4];
        for (int i = 0; i < 4; ++i) {
            encoded[i] = new TextMessage(message[i]);
        }
        return new UpdateSignMessage(x, y, z, encoded);
    }
View Full Code Here

public final class KickMessage implements Message {

    private final TextMessage text;

    public KickMessage(String text) {
        this(new TextMessage(text));
    }
View Full Code Here

import java.io.IOException;

public final class KickCodec implements Codec<KickMessage> {
    @Override
    public KickMessage decode(ByteBuf buf) throws IOException {
        TextMessage value = GlowBufUtils.readChat(buf);
        return new KickMessage(value);
    }
View Full Code Here

    private final String type;
    private final TextMessage title;
    private final int slots, entityId;

    public OpenWindowMessage(int id, String type, String title, int slots) {
        this(id, type, new TextMessage(title), slots, 0);
    }
View Full Code Here

    /**
     * Get a UserListItemMessage entry representing adding this player.
     * @return The entry (action ADD_PLAYER) with this player's information.
     */
    public UserListItemMessage.Entry getUserListEntry() {
        TextMessage displayName = null;
        if (playerListName != null && !playerListName.isEmpty()) {
            displayName = new TextMessage(playerListName);
        }
        return UserListItemMessage.add(getProfile(), getGameMode().getValue(), 0, displayName);
    }
View Full Code Here

    public void setPlayerListName(String name) {
        // update state
        playerListName = name;

        // send update message
        TextMessage displayName = null;
        if (playerListName != null && !playerListName.isEmpty()) {
            displayName = new TextMessage(playerListName);
        }
        Message updateMessage = UserListItemMessage.displayNameOne(getUniqueId(), displayName);
        for (GlowPlayer player : server.getOnlinePlayers()) {
            if (player.canSee(this)) {
                player.getSession().send(updateMessage);
View Full Code Here

        obj.put("key", "value");
        return obj;
    }

    public static TextMessage getTextMessage() {
        return new TextMessage("text");
    }
View Full Code Here

TOP

Related Classes of net.glowstone.util.TextMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.