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


Java ByteBufUtils.readUTF8String方法代码示例

本文整理汇总了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();
}
 
开发者ID:iChun,项目名称:Clef,代码行数:18,代码来源:PacketInstrumentPlayerInfo.java

示例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();
}
 
开发者ID:astronautlabs,项目名称:rezolve,代码行数:9,代码来源:RuleModificationMessage.java

示例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));
    }
}
 
开发者ID:TerminatorNL,项目名称:LagGoggles,代码行数:16,代码来源:ScanResult.java

示例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);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:9,代码来源:MessagePacketForceCauldronUpdate.java

示例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);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:34,代码来源:PacketUpdateGui.java

示例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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:32,代码来源:FMLMessage.java

示例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();
}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:10,代码来源:CPacketSpawnSipParticle.java

示例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;
}
 
开发者ID:IvanSteklow,项目名称:VanillaExtras,代码行数:15,代码来源:PacketReturnWorker.java

示例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);
    }
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:15,代码来源:ObservationFromGridImplementation.java

示例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);
}
 
开发者ID:iChun,项目名称:GeneralLaymansAestheticSpyingScreen,代码行数:8,代码来源:PacketSetChannel.java

示例11: readFrom

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readFrom(ByteBuf buf)
{
    file = ByteBufUtils.readUTF8String(buf);
    isInstrument = buf.readBoolean();
}
 
开发者ID:iChun,项目名称:Clef,代码行数:7,代码来源:PacketRequestFile.java

示例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);
}
 
开发者ID:astronautlabs,项目名称:rezolve,代码行数:7,代码来源:RemoteShellActivateMessage.java

示例13: fromBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void fromBytes(ByteBuf buf) {		
	tag = ByteBufUtils.readUTF8String(buf);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:5,代码来源:MessagePacketKillAllWithTag.java

示例14: readSpawnData

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readSpawnData(ByteBuf data) {
    playerName = ByteBufUtils.readUTF8String(data);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:EntityDrone.java

示例15: readFrom

import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void readFrom(ByteBuf buf)
{
    trackId = ByteBufUtils.readUTF8String(buf);
}
 
开发者ID:iChun,项目名称:Clef,代码行数:6,代码来源:PacketStopPlayingTrack.java


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