use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayInSwapHandItems in project LanternServer by LanternPowered.
the class CodecPlayInPlayerDigging method decode.
@Override
public Message decode(CodecContext context, ByteBuffer buf) throws CodecException {
int action = buf.readByte();
Vector3i position = buf.read(Types.VECTOR_3_I);
int face = buf.readByte();
switch(action) {
case 0:
case 1:
case 2:
return new MessagePlayInPlayerDigging(MessagePlayInPlayerDigging.Action.values()[action], position, fromFace(face));
case 3:
case 4:
return new MessagePlayInDropHeldItem(action == 3);
case 5:
return new MessagePlayInOutFinishUsingItem();
case 6:
return new MessagePlayInSwapHandItems();
default:
throw new DecoderException("Unknown player digging message action: " + action);
}
}
Aggregations