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


Java ByteBufUtils.writeTag方法代码示例

本文整理汇总了Java中net.minecraftforge.fml.common.network.ByteBufUtils.writeTag方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBufUtils.writeTag方法的具体用法?Java ByteBufUtils.writeTag怎么用?Java ByteBufUtils.writeTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.fml.common.network.ByteBufUtils的用法示例。


在下文中一共展示了ByteBufUtils.writeTag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
    super.toBytes(buf);
    buf.writeByte(type.ordinal());
    buf.writeInt(values.length);
    for (int i = 0; i < types.length; i++) {
        buf.writeByte(types[i]);
        PacketUpdateGui.writeField(buf, values[i], types[i]);
    }
    ByteBufUtils.writeTag(buf, extraData);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:12,代码来源:PacketDescription.java

示例2: writeFluidOrItemStack

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
public static void writeFluidOrItemStack(Object object, ByteBuf buf) {
    if (object instanceof ItemStack) {
        buf.writeByte(0);
        ByteBufUtils.writeItemStack(buf, (ItemStack) object);
    } else {
        buf.writeByte(1);
        FluidStack stack = (FluidStack) object;
        ByteBufUtils.writeUTF8String(buf, stack.getFluid().getName());
        buf.writeInt(stack.amount);
        ByteBufUtils.writeTag(buf, stack.tag);
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:13,代码来源:PacketSyncAmadronOffers.java

示例3: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
    NBTTagCompound tag = new NBTTagCompound();
    TileEntityProgrammer.setWidgetsToNBT(progWidgets, tag);
    ByteBufUtils.writeTag(buf, tag);

    buf.writeInt(entityId);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:PacketSyncDroneEntityProgWidgets.java

示例4: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	NBTTagCompound compound = new NBTTagCompound();
	compound.setInteger("size", objects.length);
	for(int i = 0; i < objects.length; i++) compound.setByteArray("byte" + i, HarshenUtils.serialize(objects[i]));
	ByteBufUtils.writeTag(buf, compound);

}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:9,代码来源:BaseMessagePacketSendPackage.java

示例5: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf){
	buf.writeInt(this.x);
	buf.writeInt(this.y);
	buf.writeInt(this.z);
	ByteBufUtils.writeTag(buf, tag);
}
 
开发者ID:DonBruce64,项目名称:OpenFlexiTrack,代码行数:8,代码来源:TileEntitySyncPacket.java

示例6: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	buf.writeLong(id.getMostSignificantBits());
	buf.writeLong(id.getLeastSignificantBits());
	ByteBufUtils.writeTag(buf, tag);
	buf.writeBoolean(mainHand);
}
 
开发者ID:TeamMelodium,项目名称:Melodium,代码行数:8,代码来源:MessageCompositionUpdate.java

示例7: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
    buf.writeByte(windowId);
    buf.writeByte(tank);
    NBTTagCompound fluidNbt = fluid == null ? null : fluid.writeToNBT(new NBTTagCompound());
    ByteBufUtils.writeTag(buf, fluidNbt);
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:9,代码来源:PacketSyncContainerFluid.java

示例8: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	NBTTagCompound c = new NBTTagCompound();
	nemesis.writeToNBT(c);
	ByteBufUtils.writeTag(buf, c);
}
 
开发者ID:ToroCraft,项目名称:NemesisSystem,代码行数:7,代码来源:MessageSyncNemesis.java

示例9: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
    ByteBufUtils.writeTag(buf, layout);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:PacketUpdateRemoteLayout.java

示例10: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
  ByteBufUtils.writeTag(buf, processorData);
  buf.writeLong(pos.toLong());
  ByteBufUtils.writeUTF8String(buf, name);
}
 
开发者ID:ToroCraft,项目名称:Minecoprocessors,代码行数:7,代码来源:MessageProcessorUpdate.java

示例11: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {		
	ByteBufUtils.writeTag(buf, tag);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:5,代码来源:MessagePacketUpdateXrayBlock.java

示例12: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	ByteBufUtils.writeTag(buf, compound);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:5,代码来源:MessagePacketSendStartupData.java

示例13: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) 
{
	ByteBufUtils.writeTag(buf, compound);
	buf.writeInt(entityId);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:7,代码来源:MessagePacketUpdateComplexEntity.java

示例14: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {	
	ByteBufUtils.writeTag(buf, handler.serializeNBT());
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:5,代码来源:MessageSendPlayerInvToClient.java

示例15: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	buf.writeInt(nbtList.tagCount());
	for(int i = 0; i < nbtList.tagCount(); i++)
		ByteBufUtils.writeTag(buf, nbtList.getCompoundTagAt(i));
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:7,代码来源:MessagePacketReviveInventory.java


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