當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。