本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例13: toBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeUTF8String(buf, nemesisId.toString());
}
示例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);
}
示例15: toBytes
import net.minecraftforge.fml.common.network.ByteBufUtils; //导入方法依赖的package包/类
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeUTF8String(buf, x + ";" + y + ";" + z);
}