本文整理汇总了Java中net.minecraft.network.PacketBuffer.readFloat方法的典型用法代码示例。如果您正苦于以下问题:Java PacketBuffer.readFloat方法的具体用法?Java PacketBuffer.readFloat怎么用?Java PacketBuffer.readFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.network.PacketBuffer
的用法示例。
在下文中一共展示了PacketBuffer.readFloat方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.posX = (double)buf.readFloat();
this.posY = (double)buf.readFloat();
this.posZ = (double)buf.readFloat();
this.strength = buf.readFloat();
int i = buf.readInt();
this.affectedBlockPositions = Lists.<BlockPos>newArrayListWithCapacity(i);
int j = (int)this.posX;
int k = (int)this.posY;
int l = (int)this.posZ;
for (int i1 = 0; i1 < i; ++i1)
{
int j1 = buf.readByte() + j;
int k1 = buf.readByte() + k;
int l1 = buf.readByte() + l;
this.affectedBlockPositions.add(new BlockPos(j1, k1, l1));
}
this.motionX = buf.readFloat();
this.motionY = buf.readFloat();
this.motionZ = buf.readFloat();
}
示例2: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.particleType = EnumParticleTypes.getParticleFromId(buf.readInt());
if (this.particleType == null)
{
this.particleType = EnumParticleTypes.BARRIER;
}
this.longDistance = buf.readBoolean();
this.xCoord = buf.readFloat();
this.yCoord = buf.readFloat();
this.zCoord = buf.readFloat();
this.xOffset = buf.readFloat();
this.yOffset = buf.readFloat();
this.zOffset = buf.readFloat();
this.particleSpeed = buf.readFloat();
this.particleCount = buf.readInt();
int i = this.particleType.getArgumentCount();
this.particleArguments = new int[i];
for (int j = 0; j < i; ++j)
{
this.particleArguments[j] = buf.readVarIntFromBuffer();
}
}
示例3: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void readPacketData(PacketBuffer buf) throws IOException
{
this.x = buf.readDouble();
this.y = buf.readDouble();
this.z = buf.readDouble();
this.yaw = buf.readFloat();
this.pitch = buf.readFloat();
super.readPacketData(buf);
}
示例4: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.entityId = buf.readVarIntFromBuffer();
this.action = (C02PacketUseEntity.Action)buf.readEnumValue(C02PacketUseEntity.Action.class);
if (this.action == C02PacketUseEntity.Action.INTERACT_AT)
{
this.hitVec = new Vec3((double)buf.readFloat(), (double)buf.readFloat(), (double)buf.readFloat());
}
}
示例5: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.x = buf.readDouble();
this.y = buf.readDouble();
this.z = buf.readDouble();
this.yaw = buf.readFloat();
this.pitch = buf.readFloat();
this.field_179835_f = S08PacketPlayerPosLook.EnumFlags.func_180053_a(buf.readUnsignedByte());
}
示例6: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.health = buf.readFloat();
this.foodLevel = buf.readVarIntFromBuffer();
this.saturationLevel = buf.readFloat();
}
示例7: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.uniqueId = buf.readUuid();
this.operation = (SPacketUpdateBossInfo.Operation)buf.readEnumValue(SPacketUpdateBossInfo.Operation.class);
switch (this.operation)
{
case ADD:
this.name = buf.readTextComponent();
this.percent = buf.readFloat();
this.color = (BossInfo.Color)buf.readEnumValue(BossInfo.Color.class);
this.overlay = (BossInfo.Overlay)buf.readEnumValue(BossInfo.Overlay.class);
this.setFlags(buf.readUnsignedByte());
case REMOVE:
default:
break;
case UPDATE_PCT:
this.percent = buf.readFloat();
break;
case UPDATE_NAME:
this.name = buf.readTextComponent();
break;
case UPDATE_STYLE:
this.color = (BossInfo.Color)buf.readEnumValue(BossInfo.Color.class);
this.overlay = (BossInfo.Overlay)buf.readEnumValue(BossInfo.Overlay.class);
break;
case UPDATE_PROPERTIES:
this.setFlags(buf.readUnsignedByte());
}
}
示例8: createFromBuffer
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public static PathPoint createFromBuffer(PacketBuffer buf)
{
PathPoint pathpoint = new PathPoint(buf.readInt(), buf.readInt(), buf.readInt());
pathpoint.distanceFromOrigin = buf.readFloat();
pathpoint.cost = buf.readFloat();
pathpoint.costMalus = buf.readFloat();
pathpoint.visited = buf.readBoolean();
pathpoint.nodeType = PathNodeType.values()[buf.readInt()];
pathpoint.distanceToTarget = buf.readFloat();
return pathpoint;
}
示例9: read
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public Rotations read(PacketBuffer buf)
{
return new Rotations(buf.readFloat(), buf.readFloat(), buf.readFloat());
}
示例10: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.state = buf.readUnsignedByte();
this.field_149141_c = buf.readFloat();
}
示例11: readPacketData
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public void readPacketData(PacketBuffer buf) throws IOException
{
this.yaw = buf.readFloat();
this.pitch = buf.readFloat();
super.readPacketData(buf);
}
示例12: handleCustomPayload
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
/**
* Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to
* acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the
* player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server
* resourcepack for the client to load.
*/
public void handleCustomPayload(SPacketCustomPayload packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
if ("MC|TrList".equals(packetIn.getChannelName()))
{
PacketBuffer packetbuffer = packetIn.getBufferData();
try
{
int i = packetbuffer.readInt();
GuiScreen guiscreen = this.gameController.currentScreen;
if (guiscreen != null && guiscreen instanceof GuiMerchant && i == this.gameController.thePlayer.openContainer.windowId)
{
IMerchant imerchant = ((GuiMerchant)guiscreen).getMerchant();
MerchantRecipeList merchantrecipelist = MerchantRecipeList.readFromBuf(packetbuffer);
imerchant.setRecipes(merchantrecipelist);
}
}
catch (IOException ioexception)
{
LOGGER.error((String)"Couldn\'t load trade info", (Throwable)ioexception);
}
finally
{
packetbuffer.release();
}
}
else if ("MC|Brand".equals(packetIn.getChannelName()))
{
this.gameController.thePlayer.setServerBrand(packetIn.getBufferData().readStringFromBuffer(32767));
}
else if ("MC|BOpen".equals(packetIn.getChannelName()))
{
EnumHand enumhand = (EnumHand)packetIn.getBufferData().readEnumValue(EnumHand.class);
ItemStack itemstack = enumhand == EnumHand.OFF_HAND ? this.gameController.thePlayer.getHeldItemOffhand() : this.gameController.thePlayer.getHeldItemMainhand();
if (itemstack != null && itemstack.getItem() == Items.WRITTEN_BOOK)
{
this.gameController.displayGuiScreen(new GuiScreenBook(this.gameController.thePlayer, itemstack, false));
}
}
else if ("MC|DebugPath".equals(packetIn.getChannelName()))
{
PacketBuffer packetbuffer1 = packetIn.getBufferData();
int j = packetbuffer1.readInt();
float f = packetbuffer1.readFloat();
Path path = Path.read(packetbuffer1);
((DebugRendererPathfinding)this.gameController.debugRenderer.debugRendererPathfinding).addPath(j, path, f);
}
else if ("MC|StopSound".equals(packetIn.getChannelName()))
{
PacketBuffer packetbuffer2 = packetIn.getBufferData();
String s = packetbuffer2.readStringFromBuffer(32767);
String s1 = packetbuffer2.readStringFromBuffer(256);
this.gameController.getSoundHandler().stop(s1, SoundCategory.getByName(s));
}
}
示例13: readWatchedListFromPacketBuffer
import net.minecraft.network.PacketBuffer; //导入方法依赖的package包/类
public static List<DataWatcher.WatchableObject> readWatchedListFromPacketBuffer(PacketBuffer buffer) throws IOException
{
List<DataWatcher.WatchableObject> list = null;
for (int i = buffer.readByte(); i != 127; i = buffer.readByte())
{
if (list == null)
{
list = Lists.<DataWatcher.WatchableObject>newArrayList();
}
int j = (i & 224) >> 5;
int k = i & 31;
DataWatcher.WatchableObject datawatcher$watchableobject = null;
switch (j)
{
case 0:
datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Byte.valueOf(buffer.readByte()));
break;
case 1:
datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Short.valueOf(buffer.readShort()));
break;
case 2:
datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Integer.valueOf(buffer.readInt()));
break;
case 3:
datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, Float.valueOf(buffer.readFloat()));
break;
case 4:
datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, buffer.readStringFromBuffer(32767));
break;
case 5:
datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, buffer.readItemStackFromBuffer());
break;
case 6:
int l = buffer.readInt();
int i1 = buffer.readInt();
int j1 = buffer.readInt();
datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, new BlockPos(l, i1, j1));
break;
case 7:
float f = buffer.readFloat();
float f1 = buffer.readFloat();
float f2 = buffer.readFloat();
datawatcher$watchableobject = new DataWatcher.WatchableObject(j, k, new Rotations(f, f1, f2));
}
list.add(datawatcher$watchableobject);
}
return list;
}