本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例9: toBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeTag(buf, layout);
}
示例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);
}
示例11: toBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeTag(buf, tag);
}
示例12: toBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeTag(buf, compound);
}
示例13: toBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
ByteBufUtils.writeTag(buf, compound);
buf.writeInt(entityId);
}
示例14: toBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeTag(buf, handler.serializeNBT());
}
示例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));
}