本文整理汇总了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();
}
}
示例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();
}
示例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();
}
示例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);
}
示例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());
}
示例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();
}
示例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);
}
示例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);
}
示例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();
}
示例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 );
}
}
示例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);
}
示例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);
}
示例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);
}
示例14: fromBytes
import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
playerName = ByteBufUtils.readUTF8String(buf);
isAlex = buf.readBoolean();
}
示例15: fromBytes
import cpw.mods.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes( ByteBuf pBuffer )
{
_mPayload = ByteBufUtils.readUTF8String( pBuffer );
}