當前位置: 首頁>>代碼示例>>Java>>正文


Java ByteBufUtils.writeUTF8String方法代碼示例

本文整理匯總了Java中net.minecraftforge.fml.common.network.ByteBufUtils.writeUTF8String方法的典型用法代碼示例。如果您正苦於以下問題:Java ByteBufUtils.writeUTF8String方法的具體用法?Java ByteBufUtils.writeUTF8String怎麽用?Java ByteBufUtils.writeUTF8String使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.fml.common.network.ByteBufUtils的用法示例。


在下文中一共展示了ByteBufUtils.writeUTF8String方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
	ByteBufUtils.writeUTF8String(buf, this.playerId);
	RezolveByteBufUtils.writeBlockPos(buf, this.entityPos);
	ByteBufUtils.writeUTF8String(buf, this.ruleId);
	ByteBufUtils.writeUTF8String(buf, this.ruleName);
	buf.writeInt(this.mode);
}
 
開發者ID:astronautlabs,項目名稱:rezolve,代碼行數:9,代碼來源:RuleModificationMessage.java

示例2: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
	if (!this.messageValid)
		return;
	buf.writeInt(pos.getX());
	buf.writeInt(pos.getY());
	buf.writeInt(pos.getZ());
	ByteBufUtils.writeUTF8String(buf, this.side.getName2());
	ByteBufUtils.writeUTF8String(buf, this.className);
	ByteBufUtils.writeUTF8String(buf, this.cooldownFieldName);
	ByteBufUtils.writeUTF8String(buf, this.maxCooldownFieldName);
}
 
開發者ID:IvanSteklow,項目名稱:VanillaExtras,代碼行數:13,代碼來源:PacketGetWorker.java

示例3: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
	buf.writeInt(this.x);
	buf.writeInt(this.y);
	buf.writeInt(this.z);
	ByteBufUtils.writeUTF8String(buf, this.patternName);
}
 
開發者ID:astronautlabs,項目名稱:rezolve,代碼行數:8,代碼來源:BundleBuilderUpdateMessage.java

示例4: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
	buf.writeInt(entityID);
	ByteBufUtils.writeUTF8String(buf, animationName);
	buf.writeBoolean(loopAnim);
	buf.writeFloat(transitionTime);
}
 
開發者ID:ObsidianSuite,項目名稱:ObsidianSuite,代碼行數:8,代碼來源:MessageAnimationStart.java

示例5: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
    super.toBytes(buf);
    buf.writeBoolean(settingStack != null);
    if (settingStack != null) {
        ByteBufUtils.writeUTF8String(buf, settingStack.getFluid().getName());
        buf.writeInt(settingStack.amount);
        ByteBufUtils.writeTag(buf, settingStack.tag);
    }
    buf.writeInt(settingIndex);
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:12,代碼來源:PacketSetLogisticsFluidFilterStack.java

示例6: writeTo

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void writeTo(ByteBuf buf)
{
    PacketBuffer buffer = new PacketBuffer(buf);
    buffer.writeBlockPos(pos);
    ByteBufUtils.writeUTF8String(buffer, channel);
}
 
開發者ID:iChun,項目名稱:GeneralLaymansAestheticSpyingScreen,代碼行數:8,代碼來源:PacketSetChannel.java

示例7: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
	ByteBufUtils.writeUTF8String(buf, name);
	buf.writeFloat(pos.getX());
	buf.writeFloat(pos.getY());
	buf.writeFloat(pos.getZ());
}
 
開發者ID:Zundrel,項目名稱:Never-Enough-Currency,代碼行數:8,代碼來源:MessageSyncController.java

示例8: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
    ByteBufUtils.writeUTF8String(buf, varName);
    buf.writeInt(value.getX());
    buf.writeInt(value.getY());
    buf.writeInt(value.getZ());
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:8,代碼來源:PacketSetGlobalVariable.java

示例9: writeTo

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void writeTo(ByteBuf buf)
{
    ByteBufUtils.writeUTF8String(buf, abc_md5);
    ByteBufUtils.writeUTF8String(buf, bandName);
    buf.writeBoolean(syncPlay);
    buf.writeBoolean(syncTrack);
}
 
開發者ID:iChun,項目名稱:Clef,代碼行數:9,代碼來源:PacketPlayABC.java

示例10: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
void toBytes(ByteBuf buf)
{
    super.toBytes(buf);
    ByteBufUtils.writeUTF8String(buf, modId);
    buf.writeInt(modEntityTypeId);
    buf.writeLong(entity.getUniqueID().getMostSignificantBits());
    buf.writeLong(entity.getUniqueID().getLeastSignificantBits());
    // posX, posY, posZ
    buf.writeDouble(entity.posX);
    buf.writeDouble(entity.posY);
    buf.writeDouble(entity.posZ);
    // yaw, pitch
    buf.writeByte((byte)(entity.rotationYaw * 256.0F / 360.0F));
    buf.writeByte((byte) (entity.rotationPitch * 256.0F / 360.0F));
    // head yaw
    if (entity instanceof EntityLivingBase)
    {
        buf.writeByte((byte) (((EntityLivingBase)entity).rotationYawHead * 256.0F / 360.0F));
    }
    else
    {
        buf.writeByte(0);
    }
    ByteBuf tmpBuf = Unpooled.buffer();
    PacketBuffer pb = new PacketBuffer(tmpBuf);
    try
    {
        entity.getDataManager().writeEntries(pb);
    } catch (IOException e)
    {
        FMLLog.log(Level.FATAL,e,"Encountered fatal exception trying to send entity spawn data watchers");
        throw Throwables.propagate(e);
    }
    buf.writeBytes(tmpBuf);

    if (entity instanceof IThrowableEntity)
    {
        Entity owner = ((IThrowableEntity)entity).getThrower();
        buf.writeInt(owner == null ? entity.getEntityId() : owner.getEntityId());
        double maxVel = 3.9D;
        double mX = entity.motionX;
        double mY = entity.motionY;
        double mZ = entity.motionZ;
        if (mX < -maxVel) mX = -maxVel;
        if (mY < -maxVel) mY = -maxVel;
        if (mZ < -maxVel) mZ = -maxVel;
        if (mX >  maxVel) mX =  maxVel;
        if (mY >  maxVel) mY =  maxVel;
        if (mZ >  maxVel) mZ =  maxVel;
        buf.writeInt((int)(mX * 8000D));
        buf.writeInt((int)(mY * 8000D));
        buf.writeInt((int)(mZ * 8000D));
    }
    else
    {
        buf.writeInt(0);
    }
    if (entity instanceof IEntityAdditionalSpawnData)
    {
        tmpBuf = Unpooled.buffer();
        ((IEntityAdditionalSpawnData)entity).writeSpawnData(tmpBuf);
        buf.writeBytes(tmpBuf);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:66,代碼來源:FMLMessage.java

示例11: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
	RezolveByteBufUtils.writeBlockPos(buf, this.entityPos);
	RezolveByteBufUtils.writeBlockPos(buf, this.machinePos);
	ByteBufUtils.writeUTF8String(buf, this.name);
}
 
開發者ID:astronautlabs,項目名稱:rezolve,代碼行數:7,代碼來源:RemoteShellRenameMachineMessage.java

示例12: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
  ByteBufUtils.writeTag(buf, processorData);
  buf.writeLong(pos.toLong());
  ByteBufUtils.writeUTF8String(buf, name);
}
 
開發者ID:ToroCraft,項目名稱:Minecoprocessors,代碼行數:7,代碼來源:MessageProcessorUpdate.java

示例13: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
	ByteBufUtils.writeUTF8String(buf, nemesisId.toString());
}
 
開發者ID:ToroCraft,項目名稱:NemesisSystem,代碼行數:5,代碼來源:MessageOpenNemesisDetailsGuiRequest.java

示例14: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
@Override
public void toBytes(ByteBuf buf) {
    buf.writeBoolean(isProfiling);
    buf.writeInt(length);
    ByteBufUtils.writeUTF8String(buf, issuedBy);
}
 
開發者ID:TerminatorNL,項目名稱:LagGoggles,代碼行數:7,代碼來源:ProfileStatus.java

示例15: toBytes

import net.minecraftforge.fml.common.network.ByteBufUtils; //導入方法依賴的package包/類
public void toBytes(ByteBuf buf) {
	ByteBufUtils.writeUTF8String(buf, x + ";" + y + ";" + z);
}
 
開發者ID:cjburkey01,項目名稱:MiningWells,代碼行數:4,代碼來源:PacketWellToServer.java


注:本文中的net.minecraftforge.fml.common.network.ByteBufUtils.writeUTF8String方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。