当前位置: 首页>>代码示例>>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;未经允许,请勿转载。