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


Java ByteBufUtils.readUTF8String方法代码示例

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


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

示例1: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
void fromBytes(ByteBuf bytes)
{
    int listSize = bytes.readInt();
    for (int i = 0; i < listSize; i++) {
        String fluidName = ByteBufUtils.readUTF8String(bytes);
        int fluidId = bytes.readInt();
        fluidIds.put(FluidRegistry.getFluid(fluidName), fluidId);
    }
    // do we have a defaults list?

    if (bytes.isReadable())
    {
        for (int i = 0; i < listSize; i++)
        {
            defaultFluids.add(ByteBufUtils.readUTF8String(bytes));
        }
    }
    else
    {
        FMLLog.getLogger().log(Level.INFO, "Legacy server message contains no default fluid list - there may be problems with fluids");
        defaultFluids.clear();
    }
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:25,代码来源:ForgeMessage.java

示例2: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
void fromBytes(ByteBuf buf)
{
    windowId = buf.readInt();
    modId = ByteBufUtils.readUTF8String(buf);
    modGuiId = buf.readInt();
    x = buf.readInt();
    y = buf.readInt();
    z = buf.readInt();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:11,代码来源:FMLMessage.java

示例3: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {

    UUID = ByteBufUtils.readUTF8String(buf);
    Name = ByteBufUtils.readUTF8String(buf);
    X = buf.readDouble();
    Y = buf.readDouble();
    Z = buf.readDouble();

}
 
开发者ID:evshiron,项目名称:IngressCraft,代码行数:11,代码来源:MessageGetPortalInfo.java

示例4: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    identifier = ByteBufUtils.readUTF8String(buf);
    index = buf.readInt();
    title = ByteBufUtils.readUTF8String(buf);
    contents = ByteBufUtils.readUTF8String(buf);
}
 
开发者ID:AlmuraDev,项目名称:Guide-Legacy,代码行数:8,代码来源:C00PageInformation.java

示例5: handlePacketData

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void handlePacketData(ByteBuf dataStream) throws Exception {
	super.handlePacketData(dataStream);

	isActive = dataStream.readBoolean();

	long ownerUUIDMostSignificantBits = dataStream.readLong();
	long ownerUUIDLeastSignificantBits = dataStream.readLong();

	if (ownerUUIDMostSignificantBits != 0 && ownerUUIDLeastSignificantBits != 0) {
		ownerUUID = new UUID(ownerUUIDMostSignificantBits, ownerUUIDLeastSignificantBits);
	}

	String ownerNameText = ByteBufUtils.readUTF8String(dataStream);

	if (!ownerNameText.isEmpty()) {
		ownerName = ownerNameText;
	}

	electricTier = Tier.Electric.values()[dataStream.readInt()];
	electricityCount = dataStream.readDouble();

	// Re-render the block.
	worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);

	// Update potentially connected redstone blocks.
	worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
}
 
开发者ID:halvors,项目名称:Electrometrics,代码行数:29,代码来源:TileEntityElectricityMeter.java

示例6: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {

    FromUUID = ByteBufUtils.readUTF8String(buf);
    ToUUID = ByteBufUtils.readUTF8String(buf);
    Name = ByteBufUtils.readUTF8String(buf);
    Linkability = buf.readBoolean();

}
 
开发者ID:evshiron,项目名称:IngressCraft,代码行数:10,代码来源:MessageGetPortalLinkability.java

示例7: readString

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
private String readString(ByteBuf buf) {
    boolean hasString = buf.readBoolean();
    if (!hasString)
        return null;

    return ByteBufUtils.readUTF8String(buf);
}
 
开发者ID:CannibalVox,项目名称:McDiscord,代码行数:8,代码来源:UpdateServerPacket.java

示例8: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
    identifier = ByteBufUtils.readUTF8String(buf);
    index = buf.readInt();
    title = ByteBufUtils.readUTF8String(buf);
    created = new Date(buf.readLong());
    author = ByteBufUtils.readUTF8String(buf);
    lastModified = new Date(buf.readLong());
    lastContributor = ByteBufUtils.readUTF8String(buf);
    contents = ByteBufUtils.readUTF8String(buf);
}
 
开发者ID:AlmuraDev,项目名称:Guide-Legacy,代码行数:12,代码来源:S00PageInformation.java

示例9: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	super.fromBytes(buf);
	streamURL = ByteBufUtils.readUTF8String(buf);
	screenColor = buf.readInt();
	screenText = ByteBufUtils.readUTF8String(buf);
	playing = buf.readBoolean();
	volume = buf.readFloat();
}
 
开发者ID:PC-Logix,项目名称:OpenFM,代码行数:10,代码来源:MessageRadioSync.java

示例10: read

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void read( ByteBuf buffer )
{
	data.clear();
	
	int count = buffer.readInt();
	for ( int i = 0; i < count; ++i )
	{
		UUID id = new UUID( buffer.readLong(), buffer.readLong() );
		
		int dim = buffer.readInt();
		Vector3i pos = new Vector3i( buffer.readInt(), buffer.readInt(), buffer.readInt() );
		
		
       	String name = ByteBufUtils.readUTF8String( buffer );
       	String tex = ByteBufUtils.readUTF8String( buffer );;
       	int level = buffer.readInt();
       	
       	PetData pet = new PetData();
       	pet.dim = dim;
       	pet.pos = pos;
       	pet.name = name;
       	pet.tex = tex;
       	pet.level = level;
       	
       	data.put( id, pet );
	}
}
 
开发者ID:spacechase0,项目名称:UsefulPets,代码行数:29,代码来源:TrackingDataPacket.java

示例11: readSpawnData

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readSpawnData(ByteBuf additionalData) {

    Level = Integer.parseInt(ByteBufUtils.readUTF8String(additionalData));
    Faction = Integer.parseInt(ByteBufUtils.readUTF8String(additionalData));
    Owner = ByteBufUtils.readUTF8String(additionalData);

}
 
开发者ID:evshiron,项目名称:IngressCraft,代码行数:9,代码来源:EntityResonator.java

示例12: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	x = buf.readInt();
	y = buf.readInt();
	z = buf.readInt();
       val = buf.readInt();
       componentName = ByteBufUtils.readUTF8String(buf);
}
 
开发者ID:NotGyro,项目名称:WeirdScience,代码行数:9,代码来源:MessageTileIntComponent.java

示例13: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	x = buf.readInt();
	y = buf.readInt();
	z = buf.readInt();
	console = ByteBufUtils.readUTF8String(buf);
}
 
开发者ID:Mitchellbrine,项目名称:BinaryCraft,代码行数:8,代码来源:ConsolePacket.java

示例14: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
	playerName = ByteBufUtils.readUTF8String(buf);
	isAlex = buf.readBoolean();
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:6,代码来源:SetPlayerModelMessage.java

示例15: fromBytes

import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes( ByteBuf pBuffer )
{
	_mPayload = ByteBufUtils.readUTF8String( pBuffer );
}
 
开发者ID:GTNewHorizons,项目名称:EnhancedLootBags,代码行数:6,代码来源:LootBagClientSyncMessage.java


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