use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutRecord in project LanternServer by LanternPowered.
the class LanternPlayer method playOrStopRecord.
private void playOrStopRecord(Vector3i position, @Nullable RecordType recordType) {
checkNotNull(position, "position");
getConnection().send(new MessagePlayOutRecord(position, recordType));
}
use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutRecord in project LanternServer by LanternPowered.
the class CodecPlayOutEffect method encode.
@Override
public ByteBuffer encode(CodecContext context, Message message) throws CodecException {
final ByteBuffer buf = context.byteBufAlloc().buffer();
if (message instanceof MessagePlayOutEffect) {
final MessagePlayOutEffect message1 = (MessagePlayOutEffect) message;
buf.writeInteger(message1.getType());
buf.write(Types.VECTOR_3_I, message1.getPosition());
buf.writeInteger(message1.getData());
buf.writeBoolean(message1.isBroadcast());
} else if (message instanceof MessagePlayOutRecord) {
final MessagePlayOutRecord message1 = (MessagePlayOutRecord) message;
buf.writeInteger(1010);
buf.write(Types.VECTOR_3_I, message1.getPosition());
buf.writeInteger(message1.getRecord().map(type -> 2256 + ((LanternRecordType) type).getInternalId()).orElse(0));
buf.writeBoolean(false);
} else {
throw new EncoderException("Unsupported message type: " + message.getClass().getName());
}
return buf;
}
use of org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayOutRecord in project LanternServer by LanternPowered.
the class LanternWorld method playOrStopRecord.
private void playOrStopRecord(Vector3i position, @Nullable RecordType recordType) {
checkNotNull(position, "position");
broadcast(() -> new MessagePlayOutRecord(position, recordType));
}
Aggregations