當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。