use of ValkyrienWarfareBase.Network.PhysWrapperPositionMessage in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class PhysicsObject method readSpawnData.
public void readSpawnData(ByteBuf additionalData) {
PacketBuffer modifiedBuffer = new PacketBuffer(additionalData);
ownedChunks = new ChunkSet(modifiedBuffer.readInt(), modifiedBuffer.readInt(), modifiedBuffer.readInt());
wrapper.posX = modifiedBuffer.readDouble();
wrapper.posY = modifiedBuffer.readDouble();
wrapper.posZ = modifiedBuffer.readDouble();
wrapper.pitch = modifiedBuffer.readDouble();
wrapper.yaw = modifiedBuffer.readDouble();
wrapper.roll = modifiedBuffer.readDouble();
wrapper.prevPitch = wrapper.pitch;
wrapper.prevYaw = wrapper.yaw;
wrapper.prevRoll = wrapper.roll;
wrapper.lastTickPosX = wrapper.posX;
wrapper.lastTickPosY = wrapper.posY;
wrapper.lastTickPosZ = wrapper.posZ;
centerCoord = new Vector(modifiedBuffer);
for (boolean[] array : ownedChunks.chunkOccupiedInLocal) {
for (int i = 0; i < array.length; i++) {
array[i] = modifiedBuffer.readBoolean();
}
}
loadClaimedChunks();
renderer.updateOffsetPos(refrenceBlockPos);
coordTransform.stack.pushMessage(new PhysWrapperPositionMessage(this));
try {
NBTTagCompound entityFixedPositionNBT = modifiedBuffer.readNBTTagCompoundFromBuffer();
entityLocalPositions = NBTUtils.readEntityPositionMap("entityFixedPosMap", entityFixedPositionNBT);
// if(worldObj.isRemote){
// System.out.println(entityLocalPositions.containsKey(Minecraft.getMinecraft().thePlayer.getPersistentID().hashCode()));
// System.out.println(Minecraft.getMinecraft().thePlayer.getPersistentID().hashCode());
// }
} catch (IOException e) {
System.err.println("Couldn't load the entityFixedPosNBT; this is really bad.");
e.printStackTrace();
}
isNameCustom = modifiedBuffer.readBoolean();
shipType = modifiedBuffer.readEnumValue(ShipType.class);
}
Aggregations