当前位置: 首页>>代码示例>>Java>>正文


Java PacketBuffer.writeBoolean方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:S26PacketMapChunkBulk.java

示例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());
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:MerchantRecipeList.java

示例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]);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:SPacketParticles.java

示例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);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:SPacketMaps.java

示例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();
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:36,代码来源:GuiEditCommandBlockMinecart.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:C15PacketClientSettings.java

示例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);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:SPacketEntity.java

示例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);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:CPacketTabComplete.java

示例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);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:SPacketEntity.java

示例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());
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:DataSerializers.java

示例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);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:9,代码来源:S14PacketEntity.java

示例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);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:10,代码来源:S32PacketConfirmTransaction.java

示例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);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:SPacketConfirmTransaction.java

示例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);
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:33,代码来源:EntityStatue.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:S18PacketEntityTeleport.java


注:本文中的net.minecraft.network.PacketBuffer.writeBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。