本文整理汇总了Java中net.minecraftforge.fml.common.network.ByteBufUtils.readUTF8String方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBufUtils.readUTF8String方法的具体用法?Java ByteBufUtils.readUTF8String怎么用?Java ByteBufUtils.readUTF8String使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fml.common.network.ByteBufUtils
的用法示例。
在下文中一共展示了ByteBufUtils.readUTF8String方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readFrom
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readFrom(ByteBuf buf)
{
PacketBuffer pb = new PacketBuffer(buf);
abc_md5s = new ArrayList<>();
int size = buf.readInt();
for(int i = 0; i < size; i++)
{
abc_md5s.add(ByteBufUtils.readUTF8String(buf));
}
bandName = ByteBufUtils.readUTF8String(buf);
syncPlay = buf.readBoolean();
syncTrack = buf.readBoolean();
repeat = buf.readInt();
shuffle = buf.readBoolean();
pos = pb.readBlockPos();
}
示例2: fromBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
this.playerId = ByteBufUtils.readUTF8String(buf);
this.entityPos = RezolveByteBufUtils.readBlockPos(buf);
this.ruleId = ByteBufUtils.readUTF8String(buf);
this.ruleName = ByteBufUtils.readUTF8String(buf);
this.mode = buf.readInt();
}
示例3: fromBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
worldID = buf.readInt();
nanos = buf.readLong();
name = ByteBufUtils.readUTF8String(buf);
className = ByteBufUtils.readUTF8String(buf);
isTileEntity = buf.readBoolean();
if(isTileEntity){
x = buf.readInt();
y = buf.readInt();
z = buf.readInt();
}else {
id = UUID.fromString(ByteBufUtils.readUTF8String(buf));
}
}
示例4: fromBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
this.pos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
this.level = buf.readInt();
this.fluidname = ByteBufUtils.readUTF8String(buf);
}
示例5: readField
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
public static Object readField(ByteBuf buf, int type) {
switch (type) {
case 0:
return buf.readInt();
case 1:
return buf.readFloat();
case 2:
return buf.readDouble();
case 3:
return buf.readBoolean();
case 4:
return ByteBufUtils.readUTF8String(buf);
case 5:
return buf.readByte();
case 6:
return ByteBufUtils.readItemStack(buf);
case 7:
if (!buf.readBoolean()) return null;
return new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(buf)), buf.readInt(), ByteBufUtils.readTag(buf));
case 8:
try {
PacketBuffer packetBuffer = new PacketBuffer(buf);
NBTTagCompound tag = packetBuffer.readCompoundTag();
if (tag == null) return EmptyHandler.INSTANCE;
ItemStackHandler handler = new ItemStackHandler();
handler.deserializeNBT(tag);
return handler;
} catch (IOException e) {
return EmptyHandler.INSTANCE;
}
}
throw new IllegalArgumentException("Invalid sync type! " + type);
}
示例6: fromBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
void fromBytes(ByteBuf dat)
{
super.fromBytes(dat);
modId = ByteBufUtils.readUTF8String(dat);
modEntityTypeId = dat.readInt();
entityUUID = new UUID(dat.readLong(), dat.readLong());
rawX = dat.readDouble();
rawY = dat.readDouble();
rawZ = dat.readDouble();
scaledYaw = dat.readByte() * 360F / 256F;
scaledPitch = dat.readByte() * 360F / 256F;
scaledHeadYaw = dat.readByte() * 360F / 256F;
try
{
dataWatcherList = EntityDataManager.readEntries(new PacketBuffer(dat));
} catch (IOException e)
{
FMLLog.log(Level.FATAL, e, "There was a critical error decoding the datawatcher stream for a mod entity.");
throw Throwables.propagate(e);
}
throwerId = dat.readInt();
if (throwerId != 0)
{
speedScaledX = dat.readInt() / 8000D;
speedScaledY = dat.readInt() / 8000D;
speedScaledZ = dat.readInt() / 8000D;
}
this.dataStream = dat;
}
示例7: fromBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf)
{
pos = ByteBufTools.readVector3d(buf);
posTo = ByteBufTools.readVector3d(buf);
speed = buf.readFloat();
sipType = ByteBufUtils.readUTF8String(buf);
amount = buf.readInt();
}
示例8: fromBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
try {
this.cooldown = buf.readInt();
this.maxCooldown = buf.readInt();
this.className = ByteBufUtils.readUTF8String(buf);
this.cooldownFieldName = ByteBufUtils.readUTF8String(buf);
this.maxCooldownFieldName = ByteBufUtils.readUTF8String(buf);
} catch (IndexOutOfBoundsException ioe) {
Utils.getLogger(Refs.NAME).catching(ioe);
return;
}
this.messageValid = true;
}
示例9: restoreState
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
void restoreState(ByteBuf buf)
{
int numGrids = buf.readInt();
this.environs = new ArrayList<SimpleGridDef>();
for (int i = 0; i < numGrids; i++)
{
SimpleGridDef sgd = new SimpleGridDef(buf.readInt(), buf.readInt(), buf.readInt(),
buf.readInt(), buf.readInt(), buf.readInt(),
ByteBufUtils.readUTF8String(buf),
buf.readBoolean());
this.environs.add(sgd);
}
}
示例10: readFrom
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readFrom(ByteBuf buf)
{
PacketBuffer buffer = new PacketBuffer(buf);
pos = buffer.readBlockPos();
channel = ByteBufUtils.readUTF8String(buffer);
}
示例11: readFrom
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readFrom(ByteBuf buf)
{
file = ByteBufUtils.readUTF8String(buf);
isInstrument = buf.readBoolean();
}
示例12: fromBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
this.entityPos = RezolveByteBufUtils.readBlockPos(buf);
this.activatedMachine = RezolveByteBufUtils.readBlockPos(buf);
this.playerId = ByteBufUtils.readUTF8String(buf);
}
示例13: fromBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {
tag = ByteBufUtils.readUTF8String(buf);
}
示例14: readSpawnData
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readSpawnData(ByteBuf data) {
playerName = ByteBufUtils.readUTF8String(data);
}
示例15: readFrom
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readFrom(ByteBuf buf)
{
trackId = ByteBufUtils.readUTF8String(buf);
}