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


Java ByteBufUtils.readVarInt方法代码示例

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


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

示例1: decodePacket

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void decodePacket(ChannelHandlerContext context, ByteBuf buffer) {
	int size = ByteBufUtils.readVarInt(buffer, 5);
	entityIds = new HashMap<Integer, VRPlayerData>(size);
	for (int i = 0; i < size; i++) {
		VRPlayerData data = new VRPlayerData();
		entityIds.put(ByteBufUtils.readVarInt(buffer, 5), data);
		data.newAPI = buffer.readBoolean();
		data.reverseHands = buffer.readBoolean();
		data.worldScale = buffer.readFloat();
		data.seated = buffer.readBoolean();
		int size2 = buffer.readUnsignedByte();
		for (int j = 0; j < size2; j++) {
			data.entityIds.add(ByteBufUtils.readVarInt(buffer, 5));
		}
	}
}
 
开发者ID:Techjar,项目名称:VivecraftForgeExtensions,代码行数:18,代码来源:PacketVRPlayerList.java

示例2: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buffer)
{
    super.fromBytes(buffer);
    int modCount = ByteBufUtils.readVarInt(buffer, 2);
    for (int i = 0; i < modCount; i++)
    {
        modTags.put(ByteBufUtils.readUTF8String(buffer), ByteBufUtils.readUTF8String(buffer));
    }
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:11,代码来源:FMLHandshakeMessage.java

示例3: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
	slotCount = (short) ByteBufUtils.readVarShort(buf);
	itemStacks = new ItemStack[slotCount];
	stackSizes = new int[slotCount];
	for (int i = 0; i < slotCount; i++) {
		itemStacks[i] = ByteBufUtils.readItemStack(buf);
		stackSizes[i] = ByteBufUtils.readVarInt(buf, 5);
		if (itemStacks[i] != null)
			itemStacks[i].stackSize = stackSizes[i];
	}
}
 
开发者ID:WanionCane,项目名称:Avaritiaddons,代码行数:14,代码来源:InfinityChestSyncAllSlots.java

示例4: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(final ByteBuf buf)
{
	windowId = ByteBufUtils.readVarInt(buf, 4);
	slotNumber = ByteBufUtils.readVarShort(buf);
	if (slotNumber < 0 || slotNumber > 279)
		slotNumber = -999;
	mouseButton = ByteBufUtils.readVarInt(buf, 4);
	modifier = ByteBufUtils.readVarInt(buf, 4);
	itemStack = ByteBufUtils.readItemStack(buf);
	stackSize = ByteBufUtils.readVarInt(buf, 5);
	if (itemStack != null)
		itemStack.stackSize = stackSize;
	transactionID = (short) ByteBufUtils.readVarShort(buf);
}
 
开发者ID:WanionCane,项目名称:Avaritiaddons,代码行数:16,代码来源:InfinityChestClick.java

示例5: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(final ByteBuf buf)
{
	itemStack = ByteBufUtils.readItemStack(buf);
	slot = ByteBufUtils.readVarShort(buf);
	stackSize = ByteBufUtils.readVarInt(buf, 5);
}
 
开发者ID:WanionCane,项目名称:Avaritiaddons,代码行数:8,代码来源:InfinityChestSlotSync.java

示例6: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(final ByteBuf buf)
{
	windowID = ByteBufUtils.readVarInt(buf, 4);
	transactionID = (short) ByteBufUtils.readVarShort(buf);
	confirmed = ByteBufUtils.readVarShort(buf) == 1;
}
 
开发者ID:WanionCane,项目名称:Avaritiaddons,代码行数:8,代码来源:InfinityChestConfirmation.java

示例7: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) 
{
 entityId = ByteBufUtils.readVarInt(buf, 4);
 entitySyncDataCompound = ByteBufUtils.readTag(buf); // this class is very useful in general for writing more complex objects
 // DEBUG
 System.out.println("fromBytes");
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:9,代码来源:MessageSyncEntityToServer.java

示例8: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
    location = new int[3];
    for (int i=0;i<3;i++)
    {
        location[i] = ByteBufUtils.readVarInt(buf,5);
    }
    tagCompound = ByteBufUtils.readTag(buf);
}
 
开发者ID:M4thG33k,项目名称:M4thThings,代码行数:11,代码来源:PacketNBT.java

示例9: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
    x = ByteBufUtils.readVarInt(buf, 5);
    y = ByteBufUtils.readVarInt(buf,5);
    z = ByteBufUtils.readVarInt(buf,5);
    direction = ByteBufUtils.readVarInt(buf,1);
    isFilling = ByteBufUtils.readVarInt(buf,1);
    fluidName = ByteBufUtils.readUTF8String(buf);
    amount = ByteBufUtils.readVarInt(buf,5);
    size = ByteBufUtils.readVarInt(buf,1);
}
 
开发者ID:M4thG33k,项目名称:M4thThings,代码行数:13,代码来源:PacketFilling.java

示例10: readFromPacket

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readFromPacket(ByteBuf buf) {
	charge = ByteBufUtils.readVarInt(buf, 4);
}
 
开发者ID:nikita488,项目名称:RainbowElectricity,代码行数:5,代码来源:TileEntityRainbowBatteryBox.java


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