List of usage examples for io.netty.buffer ByteBuf readDouble
public abstract double readDouble();
From source file:mca.network.packets.PacketSetPosition.java
License:Open Source License
@Override public void fromBytes(ByteBuf byteBuf) { entityId = byteBuf.readInt();// w w w . j a v a 2 s . com posX = byteBuf.readDouble(); posY = byteBuf.readDouble(); posZ = byteBuf.readDouble(); }
From source file:minechess.common.network.PacketSpawnParticle.java
License:LGPL
@Override public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { super.decodeInto(ctx, buffer); particleName = ByteBufUtils.readUTF8String(buffer); dx = buffer.readDouble(); dy = buffer.readDouble();//from w w w . j av a2s . co m dz = buffer.readDouble(); }
From source file:net.mechanicalcat.pycode.net.InvokeWandMessage.java
License:Open Source License
@Override public void fromBytes(ByteBuf buf) { hitVec = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble()); typeOfHit = RayTraceResult.Type.MISS; switch (buf.readShort()) { case 1://from www. ja v a 2 s .c om typeOfHit = RayTraceResult.Type.BLOCK; blockPos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt()); sideHit = EnumFacing.values()[buf.readShort()]; break; case 2: typeOfHit = RayTraceResult.Type.ENTITY; entityId = buf.readInt(); } }
From source file:net.tridentsdk.packets.play.in.PacketPlayInPlayerCompleteMove.java
License:Open Source License
@Override public Packet decode(ByteBuf buf) { double x = buf.readDouble(); double y = buf.readDouble(); double z = buf.readDouble(); super.location = new Location(null, x, y, z); this.newYaw = buf.readFloat(); this.newPitch = buf.readFloat(); super.onGround = buf.readBoolean(); return this; }
From source file:net.tridentsdk.packets.play.in.PacketPlayInPlayerMove.java
License:Open Source License
@Override public Packet decode(ByteBuf buf) { double x = buf.readDouble(); double y = buf.readDouble(); double z = buf.readDouble(); this.location = new Location(null, x, y, z); // TODO: Get the player's world this.onGround = buf.readBoolean(); return this; }
From source file:net.tridentsdk.server.packets.play.in.PacketPlayInPlayerCompleteMove.java
License:Apache License
@Override public Packet decode(ByteBuf buf) { double x = buf.readDouble(); double y = buf.readDouble(); double z = buf.readDouble(); super.location = Position.create(null, x, y, z); this.newYaw = buf.readFloat(); this.newPitch = buf.readFloat(); super.onGround = buf.readBoolean(); return this; }
From source file:net.tridentsdk.server.packets.play.in.PacketPlayInPlayerMove.java
License:Apache License
@Override public Packet decode(ByteBuf buf) { double x = buf.readDouble(); double y = buf.readDouble(); double z = buf.readDouble(); this.location = Position.create(null, x, y, z); // TODO: Get the player's world this.onGround = buf.readBoolean(); return this; }
From source file:org.blockartistry.DynSurround.network.PacketServerData.java
License:MIT License
@Override public void fromBytes(@Nonnull final ByteBuf buf) { this.meanTickTime = buf.readDouble(); int len = buf.readInt(); this.tMap = new TIntDoubleHashMap(len); while (len-- != 0) { this.tMap.put(buf.readInt(), buf.readDouble()); }//from w w w. j ava2 s. com this.free = buf.readInt(); this.total = buf.readInt(); this.max = buf.readInt(); }
From source file:org.comtel2000.opcua.client.service.OpcUaConverter.java
License:Apache License
public static String toRangeString(ByteString bs) { if (bs == null || bs.bytes() == null || bs.bytes().length != 16) { return "Range [unknown]"; }/* w w w. j av a 2s . c om*/ ByteBuf range = Unpooled.wrappedBuffer(bs.bytes()).order(Unpooled.LITTLE_ENDIAN); double low = range.readDouble(); double high = range.readDouble(); return String.format("Range [%s, %s]", toString(low), toString(high)); }
From source file:org.spongepowered.clean.network.packet.play.serverbound.PlayerPositionAndLookPacket.java
License:MIT License
@Override public void read(ByteBuf buffer) { this.x = buffer.readDouble(); this.y = buffer.readDouble(); this.z = buffer.readDouble(); this.yaw = buffer.readFloat(); this.pitch = buffer.readFloat(); this.onGround = buffer.readBoolean(); }