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


Java ByteBufUtils.writeItemStack方法代码示例

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


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

示例1: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	ByteBufUtils.writeUTF8String(buf, this.playerId);
	buf.writeInt(this.x);
	buf.writeInt(this.y);
	buf.writeInt(this.z);
	buf.writeInt(this.slot);
	ByteBufUtils.writeItemStack(buf, this.stack);
}
 
开发者ID:astronautlabs,项目名称:rezolve,代码行数:10,代码来源:GhostSlotUpdateMessage.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) {
    ByteBufUtils.writeUTF8String(buf, varName);
    buf.writeInt(pos.getX());
    buf.writeInt(pos.getY());
    buf.writeInt(pos.getZ());
    ByteBufUtils.writeItemStack(buf, stack);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:PacketCommandGetGlobalVariableOutput.java

示例4: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
    ByteBufUtils.writeItemStack(buf, stack);
    buf.writeInt(pos.getX());
    buf.writeInt(pos.getY());
    buf.writeInt(pos.getZ());
}
 
开发者ID:BenjaminSutter,项目名称:genera,代码行数:8,代码来源:MessageGlassJarUpdateStats.java

示例5: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	buf.writeShort(itemStacks.size());
	for (ItemStack itemstack : itemStacks) {
		ByteBufUtils.writeItemStack(buf, itemstack);
	}
	for (int i = 0; i < itemStacks.size(); i++) {
		buf.writeInt(stackSizes[i]);
	}
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:11,代码来源:PacketSyncDankNull.java

示例6: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf)
{
    buf.writeInt(player);
    buf.writeByte(where.ordinal());
    buf.writeByte(slot);
    ByteBufUtils.writeItemStack(buf, stack);
}
 
开发者ID:gigaherz,项目名称:ToolBelt,代码行数:9,代码来源:BeltContentsChange.java

示例7: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	buf.writeInt(this.entityId);
	buf.writeInt(cart.size());
	for (int i = 0; i < cart.size(); i++) {
		ByteBufUtils.writeItemStack(buf, cart.get(i));
	}
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:9,代码来源:MessageSyncCart.java

示例8: sendItemStackToClient

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
protected static void sendItemStackToClient(EntityPlayerMP player, MalmoMessageType message, ItemStack is)
{
    ByteBuf buf = Unpooled.buffer();
    ByteBufUtils.writeItemStack(buf, is);
    byte[] bytes = new byte[buf.readableBytes()];
    buf.getBytes(0, bytes);
    String data = DatatypeConverter.printBase64Binary(bytes);
    MalmoMod.MalmoMessage msg = new MalmoMod.MalmoMessage(message, data);
    MalmoMod.network.sendTo(msg, player);
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:11,代码来源:RewardForItemBase.java

示例9: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的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);
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:11,代码来源:DiscreteMovementCommandsImplementation.java

示例10: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
	buf.writeInt(this.tile.getWorld().provider.getDimension());
	buf.writeLong(this.tile.getPos().toLong());

	buf.writeInt(this.id);
	ByteBufUtils.writeItemStack(buf, this.stack);
	buf.writeFloat(this.progress);
	buf.writeByte(this.direction);
	buf.writeInt(this.color);
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:12,代码来源:PacketItemAdd.java

示例11: writeSpawnData

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void writeSpawnData(ByteBuf additionalData) 
{
	ByteBufUtils.writeItemStack(additionalData, knife);
	additionalData.writeFloat(baseDamage);
	additionalData.writeFloat(force);
}
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:8,代码来源:EntityThrownKnife.java

示例12: toBytes

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

示例13: toBytes

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

示例14: toBytes

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

示例15: toBytes

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


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