Search in sources :

Example 1 with BlockActionMessage

use of net.glowstone.net.message.play.game.BlockActionMessage in project Glowstone by GlowstoneMC.

the class ChestEntity method update.

@Override
public void update(GlowPlayer player) {
    super.update(player);
    player.getSession().send(new BlockActionMessage(block.getX(), block.getY(), block.getZ(), 1, viewers == 0 ? 0 : 1, block.getTypeId()));
}
Also used : BlockActionMessage(net.glowstone.net.message.play.game.BlockActionMessage)

Example 2 with BlockActionMessage

use of net.glowstone.net.message.play.game.BlockActionMessage in project Glowstone by GlowstoneMC.

the class BlockActionCodec method decode.

@Override
public BlockActionMessage decode(ByteBuf buf) throws IOException {
    BlockVector vector = GlowBufUtils.readBlockPosition(buf);
    int data1 = buf.readByte();
    int data2 = buf.readByte();
    int blockType = ByteBufUtils.readVarInt(buf);
    return new BlockActionMessage(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ(), data1, data2, blockType);
}
Also used : BlockVector(org.bukkit.util.BlockVector) BlockActionMessage(net.glowstone.net.message.play.game.BlockActionMessage)

Aggregations

BlockActionMessage (net.glowstone.net.message.play.game.BlockActionMessage)2 BlockVector (org.bukkit.util.BlockVector)1