本文整理汇总了Java中io.netty.buffer.ByteBuf.writeBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBuf.writeBoolean方法的具体用法?Java ByteBuf.writeBoolean怎么用?Java ByteBuf.writeBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.netty.buffer.ByteBuf
的用法示例。
在下文中一共展示了ByteBuf.writeBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeToBuf
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
public void writeToBuf(ByteBuf buf) {
ByteBufUtils.writeUTF8String(buf, offeringPlayerName);
ByteBufUtils.writeUTF8String(buf, offeringPlayerId);
if (providingPosition != null) {
buf.writeBoolean(true);
buf.writeInt(providingPosition.getX());
buf.writeInt(providingPosition.getY());
buf.writeInt(providingPosition.getZ());
buf.writeInt(providingDimensionId);
} else {
buf.writeBoolean(false);
}
if (returningPosition != null) {
buf.writeBoolean(true);
buf.writeInt(returningPosition.getX());
buf.writeInt(returningPosition.getY());
buf.writeInt(returningPosition.getZ());
buf.writeInt(returningDimensionId);
} else {
buf.writeBoolean(false);
}
buf.writeInt(inStock);
buf.writeInt(maxTrades);
buf.writeInt(pendingPayments);
}
示例2: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
if (cat != null)
{
buf.writeInt(ArcaneMagicAPI.getNotebookCategories().indexOf(cat));
} else
{
buf.writeInt(-1);
}
buf.writeBoolean(showIfFail);
}
示例3: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
if (pos != null) {
buf.writeBoolean(true);
NetworkTools.writePos(buf, pos);
} else {
buf.writeBoolean(false);
}
NetworkTools.writeString(buf, actionId);
buf.writeBoolean(extended);
}
示例4: toBuffer
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBuffer(ByteBuf buf) throws IOException
{
buf.writeBytes(this.uuid.toString().getBytes(StandardCharsets.UTF_8));
buf.writeDouble(this.motionY);
buf.writeDouble(this.fallStartY);
buf.writeBoolean(this.isFalling);
buf.writeDouble(this.playerX);
buf.writeDouble(this.playerY);
}
示例5: write
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void write( ByteBuf buf ) throws IOException {
writeVarInt( entityId, buf );
buf.writeShort( deltaX );
buf.writeShort( deltaY );
buf.writeShort( deltaZ );
buf.writeByte( toAngle( yaw ) );
buf.writeByte( toAngle( pitch ) );
buf.writeBoolean( onGround );
}
示例6: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
buf.writeDouble(this.x);
buf.writeDouble(this.y);
buf.writeDouble(this.z);
buf.writeFloat(this.yaw);
buf.writeFloat(this.pitch);
buf.writeBoolean(this.setX);
buf.writeBoolean(this.setY);
buf.writeBoolean(this.setZ);
buf.writeBoolean(this.setYaw);
buf.writeBoolean(this.setPitch);
}
示例7: write
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void write(RakNetByteBuf out) {
super.write(out);
ByteBuf buf = Unpooled.buffer();
int recodeCnt = 0;
Integer[] records = this.records.toArray(new Integer[0]);
Arrays.sort(records);
for (int i = 0; i < records.length; i++) {
int indexStart = records[i];
int indexEnd = indexStart;
while (i + 1 < records.length && records[i + 1] == (indexEnd + 1)) {
indexEnd++;
i++;
}
if (indexStart == indexEnd) {
buf.writeBoolean(true); //No range
buf.writeMediumLE(indexStart);
recodeCnt++;
} else {
buf.writeBoolean(false); //Range
buf.writeMediumLE(indexStart);
buf.writeMediumLE(indexEnd);
recodeCnt++;
}
}
out.writeShort(recodeCnt);
out.writeBytes(buf);
}
示例8: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
buf.writeInt(this.pos.getX());
buf.writeInt(this.pos.getY());
buf.writeInt(this.pos.getZ());
ByteBufUtils.writeItemStack(buf, this.itemStack);
buf.writeInt(this.face.ordinal());
buf.writeBoolean(this.standOnPlacedBlock);
}
示例9: encode
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void encode(Packet msg, ByteBuf buf) {
TextMessagePacket packet = (TextMessagePacket) msg;
TextMessageType type = packet.getMessage().getType();
buf.writeByte(type.getOrdinal());
buf.writeBoolean(packet.isLocalized());
switch (type) {
case RAW: {
encodeRaw(buf, ((RawMessage) packet.getMessage()));
break;
}
case CHAT: {
encodeChat(buf, ((ChatMessage) packet.getMessage()));
break;
}
case LOCALIZED: {
encodeLocalized(buf, ((LocalizedMessage) packet.getMessage()));
break;
}
case POPUP: {
encodePopup(buf, ((PopupMessage) packet.getMessage()));
break;
}
case JUKEBOX_POPUP: {
encodeJukeboxPopup(buf, ((JukeboxPopupMessage) packet.getMessage()));
break;
}
case TIP: {
encodeTip(buf, ((TipMessage) packet.getMessage()));
break;
}
case SYSTEM: {
encodeSystem(buf, ((SystemMessage) packet.getMessage()));
break;
}
case WHISPER: {
encodeWhisper(buf, ((WhisperMessage) packet.getMessage()));
break;
}
case ANNOUNCEMENT: {
encodeAnnouncement(buf, ((AnnouncementMessage) packet.getMessage()));
break;
}
}
}
示例10: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(this.tile.getWorld().provider.getDimension());
buf.writeLong(this.tile.getPos().toLong());
buf.writeBoolean(this.hasFilter);
}
示例11: serialize
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void serialize(ByteBuf buf) {
buf.writeInt(interceptIndex);
buf.writeBoolean(fitIntercept);
buf.writeBoolean(standardization);
}
示例12: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
buf.writeBoolean(roleplayMode);
}
示例13: writeData
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void writeData(ByteBuf buf) {
buf.writeInt(mProtcolVersion);
buf.writeBoolean(status);
}
示例14: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
buf.writeByte(part.id);
buf.writeBoolean(hand == EnumHand.MAIN_HAND);
}
示例15: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(x);
buf.writeInt(y);
buf.writeBoolean(b);
}