本文整理汇总了Java中net.minecraft.network.PacketBuffer.writeBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java PacketBuffer.writeBoolean方法的具体用法?Java PacketBuffer.writeBoolean怎么用?Java PacketBuffer.writeBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.network.PacketBuffer
的用法示例。
在下文中一共展示了PacketBuffer.writeBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeBoolean(this.isOverworld);
buf.writeVarIntToBuffer(this.chunksData.length);
for (int i = 0; i < this.xPositions.length; ++i)
{
buf.writeInt(this.xPositions[i]);
buf.writeInt(this.zPositions[i]);
buf.writeShort((short)(this.chunksData[i].dataSize & 65535));
}
for (int j = 0; j < this.xPositions.length; ++j)
{
buf.writeBytes(this.chunksData[j].data);
}
}
示例2: writeToBuf
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void writeToBuf(PacketBuffer buffer)
{
buffer.writeByte((byte)(this.size() & 255));
for (int i = 0; i < this.size(); ++i)
{
MerchantRecipe merchantrecipe = (MerchantRecipe)this.get(i);
buffer.writeItemStackToBuffer(merchantrecipe.getItemToBuy());
buffer.writeItemStackToBuffer(merchantrecipe.getItemToSell());
ItemStack itemstack = merchantrecipe.getSecondItemToBuy();
buffer.writeBoolean(itemstack != null);
if (itemstack != null)
{
buffer.writeItemStackToBuffer(itemstack);
}
buffer.writeBoolean(merchantrecipe.isRecipeDisabled());
buffer.writeInt(merchantrecipe.getToolUses());
buffer.writeInt(merchantrecipe.getMaxTradeUses());
}
}
示例3: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeInt(this.particleType.getParticleID());
buf.writeBoolean(this.longDistance);
buf.writeFloat(this.xCoord);
buf.writeFloat(this.yCoord);
buf.writeFloat(this.zCoord);
buf.writeFloat(this.xOffset);
buf.writeFloat(this.yOffset);
buf.writeFloat(this.zOffset);
buf.writeFloat(this.particleSpeed);
buf.writeInt(this.particleCount);
int i = this.particleType.getArgumentCount();
for (int j = 0; j < i; ++j)
{
buf.writeVarIntToBuffer(this.particleArguments[j]);
}
}
示例4: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeVarIntToBuffer(this.mapId);
buf.writeByte(this.mapScale);
buf.writeBoolean(this.trackingPosition);
buf.writeVarIntToBuffer(this.icons.length);
for (Vec4b vec4b : this.icons)
{
buf.writeByte((vec4b.getType() & 15) << 4 | vec4b.getRotation() & 15);
buf.writeByte(vec4b.getX());
buf.writeByte(vec4b.getY());
}
buf.writeByte(this.columns);
if (this.columns > 0)
{
buf.writeByte(this.rows);
buf.writeByte(this.minX);
buf.writeByte(this.minZ);
buf.writeByteArray(this.mapDataBytes);
}
}
示例5: actionPerformed
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
*/
protected void actionPerformed(GuiButton button) throws IOException
{
if (button.enabled)
{
if (button.id == 1)
{
this.commandBlockLogic.setTrackOutput(this.trackOutput);
this.mc.displayGuiScreen((GuiScreen)null);
}
else if (button.id == 0)
{
PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
packetbuffer.writeByte(this.commandBlockLogic.getCommandBlockType());
this.commandBlockLogic.fillInInfo(packetbuffer);
packetbuffer.writeString(this.commandField.getText());
packetbuffer.writeBoolean(this.commandBlockLogic.shouldTrackOutput());
this.mc.getConnection().sendPacket(new CPacketCustomPayload("MC|AdvCmd", packetbuffer));
if (!this.commandBlockLogic.shouldTrackOutput())
{
this.commandBlockLogic.setLastOutput((ITextComponent)null);
}
this.mc.displayGuiScreen((GuiScreen)null);
}
else if (button.id == 4)
{
this.commandBlockLogic.setTrackOutput(!this.commandBlockLogic.shouldTrackOutput());
this.updateCommandOutput();
}
}
}
示例6: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeString(this.lang);
buf.writeByte(this.view);
buf.writeByte(this.chatVisibility.getChatVisibility());
buf.writeBoolean(this.enableColors);
buf.writeByte(this.modelPartFlags);
}
示例7: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
super.writePacketData(buf);
buf.writeShort(this.posX);
buf.writeShort(this.posY);
buf.writeShort(this.posZ);
buf.writeByte(this.yaw);
buf.writeByte(this.pitch);
buf.writeBoolean(this.onGround);
}
示例8: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeString(StringUtils.substring(this.message, 0, 32767));
buf.writeBoolean(this.hasTargetBlock);
boolean flag = this.targetBlock != null;
buf.writeBoolean(flag);
if (flag)
{
buf.writeBlockPos(this.targetBlock);
}
}
示例9: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void writePacketData(PacketBuffer buf) throws IOException
{
super.writePacketData(buf);
buf.writeShort(this.posX);
buf.writeShort(this.posY);
buf.writeShort(this.posZ);
buf.writeBoolean(this.onGround);
}
示例10: write
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void write(PacketBuffer buf, Optional<UUID> value)
{
buf.writeBoolean(value.isPresent());
if (value.isPresent())
{
buf.writeUuid((UUID)value.get());
}
}
示例11: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void writePacketData(PacketBuffer buf) throws IOException
{
super.writePacketData(buf);
buf.writeByte(this.posX);
buf.writeByte(this.posY);
buf.writeByte(this.posZ);
buf.writeBoolean(this.onGround);
}
示例12: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeByte(this.windowId);
buf.writeShort(this.actionNumber);
buf.writeBoolean(this.field_148893_c);
}
示例13: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeByte(this.windowId);
buf.writeShort(this.actionNumber);
buf.writeBoolean(this.accepted);
}
示例14: writeSpawnData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
@Override
public void writeSpawnData(ByteBuf buffer) {
if(!this.first) {
PacketBuffer buff = new PacketBuffer(buffer);
buffer.writeBoolean(this.player);
if (this.profile != null) {
buff.writeUniqueId(this.profile.getId());
buff.writeString(this.profile.getName());
buff.writeVarInt(this.profile.getProperties().size());
for (Property property : this.profile.getProperties().values())
{
buff.writeString(property.getName());
buff.writeString(property.getValue());
if (property.hasSignature())
{
buff.writeBoolean(true);
buff.writeString(property.getSignature());
}
else
{
buff.writeBoolean(false);
}
}
}
buff.writeCompoundTag(data);
buff.writeBoolean(useHand);
}
}
示例15: writePacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeVarIntToBuffer(this.entityId);
buf.writeInt(this.posX);
buf.writeInt(this.posY);
buf.writeInt(this.posZ);
buf.writeByte(this.yaw);
buf.writeByte(this.pitch);
buf.writeBoolean(this.onGround);
}